> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PostgreSQL-instrumentatie

export const Compatibility = ({versions = [], label = "Available in"}) => {
  if (!Array.isArray(versions) || versions.length === 0) {
    return null;
  }
  const defaultPillStyle = {
    borderColor: "#d4d4d8",
    background: "#f4f4f5",
    color: "#3f3f46"
  };
  const pillStyles = {
    "AppSignal for Elixir": {
      background: "#f3e8ff",
      borderColor: "#d8b4fe",
      color: "#6b21a8"
    },
    "AppSignal for Front-end": {
      background: "#fef9c3",
      borderColor: "#fde047",
      color: "#854d0e"
    },
    "AppSignal for Go": {
      background: "#ccfbf1",
      borderColor: "#5eead4",
      color: "#115e59"
    },
    "AppSignal for JavaScript": {
      background: "#fef9c3",
      borderColor: "#fde047",
      color: "#854d0e"
    },
    "AppSignal for Node.js": {
      background: "#dcfce7",
      borderColor: "#86efac",
      color: "#166534"
    },
    "AppSignal for Python": {
      background: "#dbeafe",
      borderColor: "#93c5fd",
      color: "#1e40af"
    },
    "AppSignal for Ruby": {
      background: "#fee2e2",
      borderColor: "#fca5a5",
      color: "#991b1b"
    },
    "AppSignal for Rust": {
      background: "#ffedd5",
      borderColor: "#fdba74",
      color: "#9a3412"
    }
  };
  const getPillStyle = name => ({
    ...defaultPillStyle,
    ...pillStyles[name] || ({})
  });
  return <div className="not-prose my-4 rounded-lg border border-zinc-200 bg-zinc-50 px-4 py-3 text-sm dark:border-white/10 dark:bg-white/5">
      <div className="flex flex-wrap items-center gap-x-2 gap-y-1">
        <span className="font-semibold text-zinc-700 dark:text-zinc-200">
          {label}:
        </span>
        {versions.map((v, i) => <span key={`${v.name}-${v.version}-${i}`} className="inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium" style={getPillStyle(v.name)}>
            <span>{v.name}</span>
            <span className="opacity-70">
              {v.version}
              {v.exact ? "" : "+"}
            </span>
          </span>)}
      </div>
    </div>;
};

## Installatie

<Note>
  🐍 Vergeet niet om eerst het [AppSignal for Python-package te installeren](/python/installation) in uw applicatie.
</Note>

De installatie-instructies verschillen op basis van het PostgreSQL-adapterpakket dat u gebruikt:

* [`aiopg`](#using-aiopg)
* [`asyncpg`](#using-asyncpg)
* [`psycopg2`](#using-psycopg2)
* [`psycopg`](#using-psycopg) (versie 3)

<Warning>
  Wanneer u [SQLAlchemy](/python/instrumentations/sqlalchemy) gebruikt, installeer deze instrumentatie-packages dan **niet**. De instrumentatie voor SQLAlchemy instrumenteert query's naar de onderliggende database automatisch. Het installeren van beide instrumentatie-packages leidt tot dubbele events.
</Warning>

### Met behulp van `aiopg`

<Compatibility
  versions={[
{ name: "AppSignal for Python", version: "1.3.2" },
{ name: "aiopg", version: "0.13.0" },
]}
/>

Wanneer u het `aiopg` PostgreSQL-adapterpakket gebruikt, installeert u het `opentelemetry-instrumentation-aiopg`-pakket. Om het aan uw project toe te voegen, voegt u de volgende regel toe aan uw `requirements.txt`-bestand:

<CodeGroup>
  ```python Python theme={null}

  <PythonDisableInstrumentations />
  # requirements.txt
  opentelemetry-instrumentation-aiopg
  ```
</CodeGroup>

### Met behulp van `asyncpg`

<Compatibility
  versions={[
{ name: "AppSignal for Python", version: "1.3.2" },
{ name: "asyncpg", version: "0.12.0" },
]}
/>

Wanneer u het `asyncpg` PostgreSQL-adapterpakket gebruikt, installeert u het `opentelemetry-instrumentation-asyncpg`-pakket. Om het aan uw project toe te voegen, voegt u de volgende regel toe aan uw `requirements.txt`-bestand:

<CodeGroup>
  ```python Python theme={null}
  # requirements.txt
  opentelemetry-instrumentation-asyncpg
  ```
</CodeGroup>

### Met behulp van `psycopg2`

<Compatibility
  versions={[
{ name: "AppSignal for Python", version: "0.1.0" },
{ name: "psycopg2", version: "2.7.3.1" },
]}
/>

Wanneer u het `psycopg2` PostgreSQL-adapterpakket gebruikt, installeert u het `opentelemetry-instrumentation-psycopg2`-pakket. Om het aan uw project toe te voegen, voegt u de volgende regel toe aan uw `requirements.txt`-bestand:

<CodeGroup>
  ```python Python theme={null}
  # requirements.txt
  opentelemetry-instrumentation-psycopg2
  ```
</CodeGroup>

### Met behulp van `psycopg`

<Compatibility
  versions={[
{ name: "AppSignal for Python", version: "1.3.1" },
{ name: "psycopg", version: "3.1.0" },
]}
/>

Wanneer u het `psycopg` (versie 3) PostgreSQL-adapterpakket gebruikt, installeert u het `opentelemetry-instrumentation-psycopg`-pakket. Om het aan uw project toe te voegen, voegt u de volgende regel toe aan uw `requirements.txt`-bestand:

<CodeGroup>
  ```python Python theme={null}
  # requirements.txt
  opentelemetry-instrumentation-psycopg
  ```
</CodeGroup>
