valehdba

valehdba / pgclone

Public

A PostgreSQL extension written in C for cloning databases, schemas, tables, and functions between PostgreSQL hosts — directly from SQL.

11
0
100% credibility
Found Mar 31, 2026 at 11 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
C
AI Summary

PgClone is a PostgreSQL extension that allows users to clone tables, schemas, databases, functions, views, and more from remote PostgreSQL instances directly using SQL functions.

How It Works

1
🔍 Discover PgClone

You find PgClone while searching for an easy way to duplicate tables or entire sections of data from one database to another.

2
⚙️ Prepare your database

You add the copying tool to the database where you want the new copies to appear.

3
🔗 Link the original database

You share the location details of the source database containing the data or structures you need.

4
Choose what to copy

You select a single table, a group of related items, or a whole database section and decide if you want the actual data included.

5
Copy now or later?
🚀
Quick copy

Everything copies right away and finishes fast for small tasks.

Background copy

The copy runs quietly in the background while you do other things.

6
📊 Check progress

You glance at updates to see how many items are done and what's next.

Perfect duplicate ready

Your new database now has an exact copy, safe for testing, backups, or sharing.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 11 to 11 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is pgclone?

Pgclone is a PostgreSQL extension written in C that clones databases, schemas, tables, and functions between PostgreSQL hosts directly from SQL—no pg_dump or external tools needed. Pass a connection string like 'host=source dbname=mydb', specify schema/table, and toggle data, indexes, constraints, or triggers via JSON options or booleans. It supports selective columns, WHERE filters for data, and works on PostgreSQL 14-18 using fast COPY protocol for transfers.

Why is it gaining traction?

It beats dblink-style queries or manual scripting with async background workers for non-blocking clones, real-time progress via pgclone_progress(), cancel/resume, and parallel workers for schemas (e.g., '{"parallel":4}'). Conflict options like skip/replace/rename handle existing objects gracefully, making it smoother than pg_restore for live replication between servers. Devs like the Docker setup for testing and integration with postgresql extensions list staples like postgis, timescaledb, or vector.

Who should use this?

DBAs mirroring prod schemas to staging without downtime, backend devs pulling filtered prod data into dev instances, or teams in postgresql github docker workflows needing quick clones between containers. Ideal for postgresql extension development where you prototype features across hosts, skipping unaccent/uuid-ossp boilerplate.

Verdict

With 11 stars and 1.0% credibility score, it's early-stage but promising—solid README examples, docker-compose tests across PG versions, and PostgreSQL License. Try it for SQL-driven cloning between hosts if dump/restore feels clunky; monitor releases on the postgresql github repo for maturity.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.