Registry / workflow / apache-airflow-providers-postgres

apache-airflow-providers-postgres

JSON →
library7.0.2pypypi✓ verified 24d ago

The Apache Airflow Postgres Provider offers a comprehensive set of operators, hooks, and sensors for seamless interaction with PostgreSQL databases within Airflow DAGs. It enables tasks such as executing SQL queries, transferring data, and managing database connections. The current version is 6.6.2, and it follows a frequent release cadence to support new Airflow features and address issues.

pip install apache-airflow-providers-postgres
INSTALL
IMPORT
SIG · APACHE-AIRFLOW-PRO
A
apache-airflow-providers-postgres
workflowpythonv7.0.2
Install
25.3s avg
Import
Disk
292MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v7.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 291MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 25.3s · import 0.000s · 297MB
292MB installed
● package 292MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PostgresOperator
from airflow.providers.postgres.operators.postgres import PostgresOperator
from airflow.providers.postgres.operators.postgres import PostgresOperator

This example DAG defines two tasks using the `PostgresOperator`. The first task creates a 'pet' table if it doesn't already exist, and the second task populates it with sample data. Ensure you have an Airflow connection named 'postgres_default' configured in the Airflow UI, pointing to your PostgreSQL instance.

import datetime from airflow import DAG from airflow.providers.postgres.operators.postgres import PostgresOperator with DAG( dag_id="postgres_example_dag", start_date=datetime.datetime(2023, 1, 1), schedule_interval="@once", catchup=False, tags=["postgres", "example"] ) as dag: create_pet_table = PostgresOperator( task_id="create_pet_table", postgres_conn_id="postgres_default", sql=""" CREATE TABLE IF NOT EXISTS pet ( pet_id SERIAL PRIMARY KEY, name VARCHAR NOT NULL, pet_type VARCHAR NOT NULL, birth_date DATE NOT NULL, owner VARCHAR NOT NULL ); """ ) populate_pet_table = PostgresOperator( task_id="populate_pet_table", postgres_conn_id="postgres_default", sql=""" INSERT INTO pet (name, pet_type, birth_date, owner) VALUES ('Fido', 'Dog', '2020-01-01', 'Alice'), ('Whiskers', 'Cat', '2019-05-15', 'Bob'); """ ) create_pet_table >> populate_pet_table
Debug
Known issues
breakingProvider version 6.5.0 and later require Apache Airflow 2.11.0 or newer. Older Airflow versions will not be able to install or run these provider versions.
fix
Upgrade your Apache Airflow instance to version 2.11.0 or later, or use an older provider version compatible with your Airflow installation.
affects: >=6.5.0
breakingIn provider version 6.6.2 (released March 28, 2026), the `schema` argument in Postgres hooks (e.g., `PostgresHook`) has been renamed to `database`. Using `schema` will now raise an error.
fix
Update any usage of `schema` in `PostgresHook` or related classes to use `database` instead.
affects: >=6.6.2
breakingBeginning with provider version 4.0.0, the `get_uri()` method of `PostgresHook` returns a URI with the `postgresql://` prefix instead of the older `postgres://` prefix. This aligns with SQLAlchemy 1.4.0+ requirements.
fix
Update any code that parses or expects the `postgres://` prefix from `get_uri()` to handle `postgresql://`.
affects: >=4.0.0
deprecatedThe `runtime_parameters` argument in `PostgresOperator` was deprecated in favor of passing options via `hook_params` in provider version 5.5.2.
fix
Migrate from `runtime_parameters` to using `hook_params={'options': {'your_param': 'value'}}` for passing runtime configuration.
affects: >=5.5.2
gotchaPython 3.7 support was dropped in provider version 5.5.1. The current provider version requires Python >=3.10.
fix
Ensure your Airflow environment is running on Python 3.10 or higher. Check the `requires_python` field for precise version compatibility.
affects: >=5.5.1
Upgrade
Version history
7.0.2latest on PyPI · released Aug 23, 2026
Audit
Dependencies
apache-airflowrequiredCore dependency for any Airflow provider. Requires Airflow >=2.11.0 for provider version 6.5.0 and newer.
psycopg2-binaryrequiredPostgreSQL adapter for Python. Specific version requirements depend on Python version.
apache-airflow-providers-common-compatrequiredProvides common compatibility utilities for Airflow providers.
apache-airflow-providers-common-sqlrequiredProvides common SQL functionalities and base operators/hooks for SQL-based providers.
asyncpgoptionalOptional dependency for asynchronous PostgreSQL operations (requires >=0.30.0).
pandasoptionalOptional dependency for certain PostgresHook methods that return pandas DataFrames.
polarsoptionalOptional dependency for certain PostgresHook methods that return polars DataFrames.
Agent activity
45 hits · last 30 days
node
40
OpenAI (training)
1
Resources
apache-airflow-providers-postgres — pip install apache-airflow-providers-postgres · libregistry