May 17, 2026, 11:40 PM

This commit is contained in:
Paweł Domański
2026-05-18 06:40:19 +00:00
commit 64944cf004
896 changed files with 310709 additions and 0 deletions
@@ -0,0 +1,21 @@
SELECT table_schema as schema,
table_name as table,
column_name as column,
column_default,
data_type
FROM information_schema.columns
WHERE column_default LIKE 'nextval%'
ORDER BY 1, 2, 3;
SELECT tbl.relname,
col.attname,
col.attnum
FROM pg_attrdef def
JOIN pg_class tbl ON tbl.oid = def.adrelid
JOIN pg_attribute col ON col.attrelid = tbl.oid
WHERE def.adsrc LIKE 'nextval%'
AND col.attnum = def.adnum
ORDER BY 1;