timescale/pg-aiguide / skills/schema-exploration
schema-exploration
VerifiedExplore an existing PostgreSQL database before answering questions about its data or writing SQL. Use this skill whenever a user asks for a query or a data-backed answer against an unfamiliar schema (counts, missing or failed records, recent changes), asks where a business concept lives, or asks how tables, joins, views, routines, triggers, RLS, or extensions work. Find the relevant objects with read-only pg_catalog queries, then request approval before inspecting data-derived statistics or rows. Not a schema-design or migration guide.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.3 KB |
| references/data-values.md | markdown | 5.7 KB |
| references/extensions.md | markdown | 1.8 KB |
| references/foreign-tables.md | markdown | 3.9 KB |
| references/overview.md | markdown | 5.9 KB |
| references/partitioning-and-inheritance.md | markdown | 6.7 KB |
| references/psql.md | markdown | 2.1 KB |
| references/query-authoring.md | markdown | 2.1 KB |
| references/routines.md | markdown | 2.9 KB |
| references/security.md | markdown | 2.5 KB |
| references/tables.md | markdown | 7.7 KB |
| references/triggers.md | markdown | 1.6 KB |
| references/views.md | markdown | 2.4 KB |
references/extensions.md
View on GitHub# Installed extensions and extension-owned objects
Use this reference if an unfamiliar schema or object appears to come from an extension. PostgreSQL 18 target; queries also use fields available in PostgreSQL 14–17. An installed extension is a clue, not evidence that its features are used by the application.
## Installed extensions
No parameters.
```sql
select
e.extname as extension_name
, e.extversion as installed_version
, n.nspname as installation_schema
, pg_catalog.obj_description(e.oid, 'pg_extension') as comment
from pg_catalog.pg_extension e
join pg_catalog.pg_namespace n on n.oid = e.extnamespace
order by e.extname
;
```
## Objects belonging to an extension
`$1` = extension name. Membership uses `pg_depend.deptype = 'e'`; merely residing in the extension's schema does not prove ownership. Object identity can disclose source names: keep output scoped.
```sql
select
o.type as object_type
, o.schema as object_schema
, o.identity as object_identity
from pg_catalog.pg_extension e
join pg_catalog.pg_depend d on d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
and d.refobjid = e.oid
and d.deptype = 'e'
cross join lateral pg_catalog.pg_identify_object(d.classid, d.objid, d.objsubid) o
where e.extname = $1 -- $1 = extension name
order by o.type, o.schema, o.identity
;
```
The owner of an extension can create application objects in the same schema, and application objects can depend on extension types or functions without being extension members. Conversely, extension-owned objects can live outside the extension's installation schema. Extension versions and feature availability are distinct from PostgreSQL server versions. For TimescaleDB, PostGIS, or pgvector, follow their documentation when interpreting extension-specific constructs; do not infer their internal representation from generic relation counts alone.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |