validate_db
Skill1.1k starsChanged 9 months agoApache-2.0View on GitHub
Connect to live PostgreSQL database to validate schema assumptions, compare pg_dump vs pgschema output, and query system catalogs interactively. Use this skill whenever you need to test queries against a real database, verify how PostgreSQL stores or formats objects, debug introspection issues, or check version-specific behavior (PostgreSQL 14-18).
- Reads credentials
1 other project uses a version of this.
Trending
More talk lately.about the whole repository
Most recently taken up by
- pgschema/pgschemaword for word, first seen Oct 8, 2026
Who's talking about pgplex/pgschema
- ONREZA/sqlx-js“feat: harden sql contract boundaries”GitHub · Aug 4, 2026 · 1 reactions
- NixOS/nixpkgs“pgschema: 1.13.4 -> 1.14.1”GitHub · Nov 12, 2026
- yuniruyuni/FighterNotes“ci(deps): Update release supply chain”GitHub · Nov 8, 2026
- sudosubin/agents.nix“agent-skills.github.pgplex.pgschema: 1.14.0 → 1.14.1”GitHub · Nov 8, 2026
- sudosubin/agents.nix“agent-skills.github.pgplex.pgschema: 1.13.4 → 1.14.0”GitHub · Nov 6, 2026
The biggest 5 of 22 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 22
Talked about on GitHub (22 times).
On GitHub · 22
- Aug 4, 2026feat: harden sql contract boundaries — ONREZA/sqlx-js1 reaction
- Nov 12, 2026pgschema: 1.13.4 -> 1.14.1 — NixOS/nixpkgs0 reactions · 1 comment
- Nov 8, 2026ci(deps): Update release supply chain — yuniruyuni/FighterNotes0 reactions · 1 comment
- Nov 8, 2026agent-skills.github.pgplex.pgschema: 1.14.0 → 1.14.1 — sudosubin/agents.nix0 reactions
- Nov 6, 2026agent-skills.github.pgplex.pgschema: 1.13.4 → 1.14.0 — sudosubin/agents.nix0 reactions
17 more on GitHub
- Oct 31, 2026pgschema: 1.13.3 -> 1.13.4 — NixOS/nixpkgs0 reactions · 3 comments
- Oct 30, 2026ci(deps): Update release supply chain — yuniruyuni/FighterNotes0 reactions · 2 comments
- Oct 27, 2026agent-skills.github.pgplex.pgschema: 1.13.3 → 1.13.4 — sudosubin/agents.nix0 reactions
- Oct 19, 2026pgschema: 1.13.1 -> 1.13.3 — NixOS/nixpkgs0 reactions · 4 comments
- Oct 15, 2026agent-skills.github.pgplex.pgschema: 1.13.2 → 1.13.3 — sudosubin/agents.nix0 reactions
- Oct 15, 2026agent-skills.github.pgplex.pgschema: 1.13.1 → 1.13.2 — sudosubin/agents.nix0 reactions
- Oct 11, 2026chore(deps): update release supply chain — yuniruyuni/FighterNotes0 reactions · 1 comment
- Oct 1, 2026agent-skills.github.pgplex.pgschema: init at 1.13.1 — sudosubin/agents.nix0 reactions
- Sep 27, 2026pgschema: 1.13.0 -> 1.13.1 — NixOS/nixpkgs0 reactions · 4 comments
- Sep 17, 2026pgschema: 1.12.5 -> 1.13.0 — NixOS/nixpkgs0 reactions · 5 comments
- Sep 6, 2026pgschema: 1.12.4 -> 1.12.5 — NixOS/nixpkgs0 reactions · 4 comments
- Aug 27, 2026pgschema: 1.12.3 -> 1.12.4 — NixOS/nixpkgs0 reactions · 1 comment
- Jun 15, 2026sha256 is inconsistent with the one on github release — pgplex/homebrew-pgschema0 reactions
- Apr 22, 2026pg-delta: add enum-arg function privilege parity coverage (pgschema #366) — supabase/pg-toolbelt0 reactions · 1 comment
- Apr 22, 2026pg-delta: add parity coverage for DEFERRABLE UNIQUE constraints (pgschema #404) — supabase/pg-toolbelt0 reactions · 2 comments
- Mar 5, 2026Daily scan, git submodules, GitHub Models API, Copilot instruction docs — avallete/delta-schema-compare0 reactions
- Mar 3, 2026Joergs TODO list — numtide/llm-agents.nix0 reactions
Other versions1 project uses a version of this.
Word for word · 1
- pgschema/pgschema★ 1.1k100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- fix_bugSkill
- pg_dumpSkill
- postgres_syntaxSkill
- review_commentsSkill
- run_testsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Default test credentials: password testpwd1, user postgres, host localhost, port 5432.
- Distinctive: line 38
Look for: missing objects (bugs), different DDL structure (investigate), formatting differences (expected).
- Distinctive: line 42
Create test objects in a test database
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Validate with Database
Connect to the test PostgreSQL database to validate assumptions, compare implementations, and test queries.
Connection
Default test credentials: password testpwd1, user postgres, host localhost, port 5432. Also see .env at project root.
# One-off query
PGPASSWORD='testpwd1' psql -h localhost -p 5432 -U postgres -d employee -c "SELECT version();"
# pg_dump schema
PGPASSWORD='testpwd1' pg_dump -h localhost -p 5432 -U postgres -d employee --schema-only --schema=public
# pgschema dump (reads .env automatically)
./pgschema dump --schema publicCore Workflows
Compare pg_dump vs pgschema
# 1. Dump both
PGPASSWORD='testpwd1' pg_dump -h localhost -p 5432 -U postgres -d employee --schema-only --schema=public > /tmp/pg_dump_output.sql
./pgschema dump --schema public -o /tmp/pgschema_output.sql
# 2. Compare
diff -u /tmp/pg_dump_output.sql /tmp/pgschema_output.sqlLook for: missing objects (bugs), different DDL structure (investigate), formatting differences (expected).
Validate System Catalog Queries
- Create test objects in a test database
- Query system catalogs to verify expected data
- Compare with pgschema output
- Clean up test objects
Test Plan/Apply Workflow
# 1. Create test schema
PGPASSWORD='testpwd1' psql -h localhost -p 5432 -U postgres -d postgres -c "
DROP SCHEMA IF EXISTS test_workflow CASCADE;
CREATE SCHEMA test_workflow;
CREATE TABLE test_workflow.users (id SERIAL PRIMARY KEY, email TEXT NOT NULL UNIQUE);
"
# 2. Dump, modify, plan, apply
./pgschema dump --schema test_workflow -o /tmp/schema.sql
# Edit /tmp/schema.sql with desired changes
./pgschema plan --schema test_workflow --file /tmp/schema.sql
./pgschema apply --schema test_workflow --file /tmp/schema.sql --auto-approve
# 3. Verify and cleanup
PGPASSWORD='testpwd1' psql -h localhost -p 5432 -U postgres -d postgres -c "\d test_workflow.users"
PGPASSWORD='testpwd1' psql -h localhost -p 5432 -U postgres -d postgres -c "DROP SCHEMA IF EXISTS test_workflow CASCADE;"Cross-Version Testing
PGSCHEMA_POSTGRES_VERSION=14 go test -v ./cmd/dump -run TestDumpCommand_Employee
PGSCHEMA_POSTGRES_VERSION=17 go test -v ./cmd/dump -run TestDumpCommand_EmployeeSupported versions: 14, 15, 16, 17, 18.
Useful System Catalog Queries
-- Columns with types
SELECT a.attname, pg_catalog.format_type(a.atttypid, a.atttypmod) as data_type,
a.attnotnull, pg_get_expr(ad.adbin, ad.adrelid) as default_value, a.attgenerated
FROM pg_attribute a
LEFT JOIN pg_attrdef ad ON (a.attrelid = ad.adrelid AND a.attnum = ad.adnum)
WHERE a.attrelid = 'public.TABLE_NAME'::regclass AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum;
-- Constraints
SELECT con.conname, con.contype, pg_get_constraintdef(con.oid)
FROM pg_constraint con WHERE con.conrelid = 'public.TABLE_NAME'::regclass;
-- Indexes
SELECT i.relname, am.amname, pg_get_indexdef(idx.indexrelid),
CASE WHEN idx.indpred IS NOT NULL THEN pg_get_expr(idx.indpred, idx.indrelid, true) END as where_clause
FROM pg_index idx
JOIN pg_class i ON i.oid = idx.indexrelid
JOIN pg_class t ON t.oid = idx.indrelid
JOIN pg_am am ON i.relam = am.oid
WHERE t.relname = 'TABLE_NAME' AND t.relnamespace = 'public'::regnamespace;
-- Triggers
SELECT t.tgname, pg_get_triggerdef(t.oid),
CASE WHEN t.tgqual IS NOT NULL THEN pg_get_expr(t.tgqual, t.tgrelid, false) END as when_condition
FROM pg_trigger t
JOIN pg_class c ON t.tgrelid = c.oid
WHERE c.relname = 'TABLE_NAME' AND c.relnamespace = 'public'::regnamespace AND NOT t.tgisinternal;
-- Comments on tables
SELECT c.relname, d.description FROM pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
JOIN pg_description d ON d.objoid = c.oid AND d.objsubid = 0
WHERE n.nspname = 'public' AND c.relkind = 'r';Checklist
- Database is running and accessible
- pg_dump produces expected output
- pgschema produces comparable output
- System catalog queries return expected data
- Plan generates correct migration DDL
- Tested across PostgreSQL versions if version-specific
- Test database cleaned up
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

