db-load-csv

Import CSV files into PostgreSQL tables using COPY with staging validation.

3|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/gabrielnsmnto/kord-aios --skill db-load-csv-gabrielnsmnto
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: db-load-csv
Source: https://github.com/gabrielnsmnto/kord-aios/tree/main/src/features/builtin-skills/kord-aios/database/db-load-csv
Command: npx skills add https://github.com/gabrielnsmnto/kord-aios --skill db-load-csv-gabrielnsmnto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Bulk-loading CSV data into a PostgreSQL or Supabase database is error-prone: encoding issues, type mismatches, duplicate keys, and NULL violations can corrupt production tables. This Skill provides a safe, staged import workflow that validates data before it ever touches the target table. ## Core Features & Use Cases - Staging Table Import: Loads CSV data into a temporary staging table with PostgreSQL COPY, keeping the target table untouched until validation passes. - Pre-Merge Validation: Runs checks for NULL values, duplicate keys, and type-conversion failures before merging. - Idempotent UPSERT Merge: Merges staged rows with ON CONFLICT DO UPDATE so re-running the import never creates duplicates. - Use Case: You receive a 500MB customer export CSV and need it in your Supabase database. The Skill validates the file, loads it to staging, checks for bad rows, and merges it idempotently — with guidance for splitting large files into batches. ## Quick Start Ask the agent to import your CSV file into a specific PostgreSQL table, for example: load the file customers.csv into the customers table using the staged COPY workflow.

Frequently Asked Questions about db-load-csv

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

FAQPage Schema
How do I import a CSV file into PostgreSQL?▼

Use the PostgreSQL COPY command or the psql \copy meta-command to load CSV data. This workflow loads into a staging table first, validates the rows, then merges into the target table with an idempotent UPSERT.

How to bulk load CSV data into Supabase?▼

Connect psql using the Supabase database URL and run \copy with FORMAT csv and HEADER true into a staging table. After validation, merge with INSERT ... ON CONFLICT DO UPDATE for safe, repeatable imports.

COPY vs INSERT for loading CSV into PostgreSQL?▼

COPY is 10-100x faster than row-by-row INSERT for bulk loads. For small datasets under 1000 rows, a regular INSERT or the Supabase client upsert method is acceptable, but COPY is preferred for large files.

Why does PostgreSQL COPY fail with invalid byte sequence for encoding UTF8?▼

The CSV file is not UTF-8 encoded. Convert it first with iconv, for example: iconv -f ISO-8859-1 -t UTF-8 input.csv > output.csv, then rerun the COPY import.

How do I handle CSV files larger than 100MB in PostgreSQL?▼

Split the file into chunks with the split command and import each batch separately, or stream the file with cat piped into psql using COPY FROM STDIN. Both approaches avoid memory pressure during large loads.

How do I prevent duplicate rows when importing CSV into PostgreSQL?▼

Use an UPSERT merge: INSERT INTO the target table from staging with ON CONFLICT (id) DO UPDATE. This makes the import idempotent, so rerunning it updates existing rows instead of failing or duplicating.