copy-family

Guide PostgreSQL COPY command internals across the four-file split.

Updated Jun 1, 2026
One-click install
npx skills add https://github.com/matejformanek/postgres-claude --skill copy-family
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: copy-family
Source: https://github.com/matejformanek/postgres-claude/tree/main/.claude/skills/copy-family
Command: npx skills add https://github.com/matejformanek/postgres-claude --skill copy-family

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the complexity of navigating PostgreSQL's bulk-load machinery, preventing common errors when extending or debugging the COPY command family.

Core Features & Use Cases

  • Internals Navigation: Provides authoritative guidance on the four-file split (copy.c, copyto.c, copyfrom.c, copyfromparse.c) to ensure patches are applied to the correct subsystem.
  • Feature Extension: Offers a structured approach to adding new COPY options, formats, or progress reporting fields.
  • Use Case: When implementing a new bulk-load feature or debugging performance issues in partition routing, this skill provides the necessary context to safely modify the COPY machinery without breaking existing trigger or multi-insert logic.

Quick Start

Use the copy-family skill to analyze the current implementation of the COPY FROM row loop and identify the correct file for adding a new format option.

Frequently Asked Questions about copy-family

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does the PostgreSQL COPY command four-file split work for bulk-loading?

The PostgreSQL COPY command four-file split separates bulk-loading logic across copy.c, copyto.c, copyfrom.c, and copyfromparse.c. Each file handles distinct routing, export, import, and parsing subsystems to ensure patches target the correct internal machinery.

How do I add new options to the PostgreSQL COPY FROM row loop?

To add new options to the PostgreSQL COPY FROM row loop, you must navigate the four-file split architecture and apply patches to the correct subsystem, ensuring new formats or progress reporting fields integrate safely with existing multi-insert buffer management.

Why does my PostgreSQL bulk-load patch break trigger firing mechanisms?

PostgreSQL bulk-load patches break trigger firing mechanisms when modifications to the COPY machinery bypass the backend utility path. You must preserve existing trigger and multi-insert buffer logic when extending the COPY FROM command internals.

Does the PostgreSQL COPY command work with custom table AMs for partition routing?

The PostgreSQL COPY command integrates with table AMs for partition routing during bulk-loading. Proper integration requires deep knowledge of the backend utility path and multi-insert buffer management to avoid breaking existing trigger firing mechanisms.

What is the best way to audit PostgreSQL COPY performance for bulk-load operations?

The best way to audit PostgreSQL COPY performance is to analyze the bulk-load machinery and multi-insert buffer management within the copyfrom.c and copyfromparse.c subsystems. This identifies bottlenecks in the COPY FROM row processing loop.