aws-psycopg2
A aws psycopg2 package from psycopg2.
What it is and what it does
aws-psycopg2 is a pre-compiled variant of the psycopg2 PostgreSQL driver for Python, designed specifically to work in AWS Lambda. Standard psycopg2 relies on system PostgreSQL libraries (libpq) that are not present in Lambda's execution environment. This package solves that by bundling a statically linked version of libpq, allowing you to connect to PostgreSQL databases directly from Lambda functions without additional layer setup or custom compilation.
The package has no runtime dependencies and installs as a simple wheel. It is intended as a drop-in replacement for psycopg2 in Lambda contexts, though its dormant maintenance status (last release 2022-07-02) means it may not track the latest psycopg2 features or security updates.
Use it for:
- Connect to RDS PostgreSQL databases from AWS Lambda functions without packaging custom compiled libraries
- Query PostgreSQL in Lambda-based data pipelines or ETL workflows
- Build Lambda-triggered database operations for event-driven architectures
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides psycopg2 with statically linked PostgreSQL libraries for use in AWS Lambda environments where system PostgreSQL libraries are unavailable.
Yes, if you are deploying psycopg2 to AWS Lambda and do not want to manage custom compilation or Lambda layers. However, verify that the bundled PostgreSQL version and psycopg2 release remain compatible with your target Lambda runtime and database version, since the package has not been updated since 2022-07-02.
Install
aws-psycopg2 on PyPI
pip
pip install aws-psycopg2uv
uv add aws-psycopg2poetry
poetry add aws-psycopg2Installing aws-psycopg2
Before you install
Low install friction with a wheel distribution. Maintenance is dormant—last release was 2022-07-02 and no commits since 2024-03-10—so updates and bug fixes should not be expected.
License in practice
Licensed under MIT (permissive), so you can use and modify the package freely in commercial or private projects without restriction.
Quickstart
pip install aws-psycopg2
import psycopg2
conn = psycopg2.connect("dbname=mydb user=postgres host=localhost")
Designed for AWS Lambda; requires Lambda execution environment or compatible system with statically linked PostgreSQL libraries.
Verify before relying
- Whether the statically linked PostgreSQL version remains compatible with current AWS Lambda runtime environments
- Whether this package works with modern psycopg2 versions or if it is tied to an older release
- Support status for Python 3 versions beyond what the classifiers indicate
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,504 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,382,210/month — #2,643 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aws_psycopg2-1.3.8-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
psycopg2PostgreSQL database adapter for Python that…
copyleft · top 1,000 on PyPI
PyPgConfigPyPgConfig detects and exposes PostgreSQL…
permissive · top 15,000 on PyPI
postgresProvides a lightweight abstraction layer over…
permissive · top 15,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
sqlalchemy-rdsiamProvides SQLAlchemy dialects for connecting to…
unclear · top 15,000 on PyPI
sqlalchemy-pgspiderProvides a SQLAlchemy dialect that enables…
permissive · top 15,000 on PyPI
PyGreSQLPyGreSQL is a Python interface to PostgreSQL…
unclear · top 15,000 on PyPI
psycogreenIntegrates psycopg2 with coroutine libraries…
permissive · top 5,000 on PyPI
types-psycopg2Provides type hints for psycopg2, enabling…
permissive · top 5,000 on PyPI