pgcopy
Fast db insert with postgresql binary copy
Decision gist · record as of 2026-08-14
Yes, if you need to load bulk data into PostgreSQL and speed is a priority. The package is stable, has no known vulnerabilities, and carries minimal dependencies. The main caveat is aging maintenance—last release was 264 days ago—so if you hit a bug or need support for a new PostgreSQL feature, responsiveness is uncertain. For one-off bulk loads or established workflows, it's a solid choice; for mission-critical systems requiring active support, verify the maintainer's current availability first.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires an active PostgreSQL database and a valid psycopg2 connection; the target table must already exist.
- Low install friction with a pure-Python wheel and only two runtime dependencies (psycopg2 and pytz).
- Maintenance status is aging—last release was 264 days ago—but the package is marked Production/Stable and carries no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute pgcopy freely in commercial and private projects with minimal restrictions.
last release 2025-11-23 (264 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 239,550 downloads/mo, #8,919 on PyPI
Alternatives
Verify before relying
from pgcopy import CopyManager
import psycopg2
conn = psycopg2.connect(database='mydb')
mgr = CopyManager(conn, 'my_table', ('col1', 'col2'))
mgr.copy([(1, 'a'), (2, 'b')])
conn.commit()- Whether the package works with current PostgreSQL versions beyond 9.3 (documentation references 9.3 but classifiers list Python 3.9–3.14).
- Current maintenance status and likelihood of future updates or bug fixes given the 264-day release gap.
What it is and what it does
pgcopy is a thin wrapper around PostgreSQL's native binary COPY command, exposed through a simple Python API. It lets you load bulk data into PostgreSQL tables orders of magnitude faster than traditional INSERT statements by leveraging the database's optimized binary protocol. The package handles encoding, type conversion, and schema awareness transparently, supporting a wide range of PostgreSQL data types including arrays, JSON, UUIDs, and timestamps with timezone.
You instantiate a CopyManager with a psycopg2 connection, table name, and column list, then call copy() with an iterable of tuples or dicts. The package converts your Python data to PostgreSQL's binary format and streams it directly into the table. It's designed for one-shot bulk loads and table replacements rather than streaming or incremental inserts.
Use it for
- Migrating large datasets into PostgreSQL from CSV, JSON, or in-memory collections.
- Periodic bulk imports of metrics, logs, or sensor data where speed matters more than row-by-row control.
- Replacing entire tables atomically with fresh data from an external source.
- Loading test fixtures or seed data during application initialization or CI/CD pipelines.
- Batch ETL workflows where you stage data in Python and need to land it in Postgres quickly.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to load bulk data into PostgreSQL and speed is a priority.
The package is stable, has no known vulnerabilities, and carries minimal dependencies. The main caveat is aging maintenance—last release was 264 days ago—so if you hit a bug or need support for a new PostgreSQL feature, responsiveness is uncertain. For one-off bulk loads or established workflows, it's a solid choice; for mission-critical systems requiring active support, verify the maintainer's current availability first.
Install
pgcopy on PyPI
Before you install
Low install friction with a pure-Python wheel and only two runtime dependencies (psycopg2 and pytz). Maintenance status is aging—last release was 264 days ago—but the package is marked Production/Stable and carries no known vulnerabilities.
Requires an active PostgreSQL database and a valid psycopg2 connection; the target table must already exist.
License in practice
MIT license is permissive; you can use, modify, and distribute pgcopy freely in commercial and private projects with minimal restrictions.
Quickstart
from pgcopy import CopyManager
import psycopg2
conn = psycopg2.connect(database='mydb')
mgr = CopyManager(conn, 'my_table', ('col1', 'col2'))
mgr.copy([(1, 'a'), (2, 'b')])
conn.commit()
Verify before relying
- Whether the package works with current PostgreSQL versions beyond 9.3 (documentation references 9.3 but classifiers list Python 3.9–3.14).
- Current maintenance status and likelihood of future updates or bug fixes given the 264-day release gap.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespsycopg2pytz |
| Maintenance | Aging 264 days since the last release |
| First released | |
| Downloads | 239,550 / month, #8,919 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Database |
Evidence: pgcopy-1.6.2-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “postgresql bulk insert”
- pgcopypgcopy wraps PostgreSQL's binary COPY protocol to load data into…
- django-pg-bulk-updateExecutes bulk update and bulk create operations on PostgreSQL…
- sqlalchemy-mateSimplifies SQLAlchemy code with helper functions for credential…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also django-postgres-copy · pgpq · pysqlsync · psycopg2-pool · postgres · queries · django-pg-bulk-update · pgdb · tsv2py