Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT column_name FROM information_schema.columns
- WHERE table_name = 'table1' AND column_default NOT LIKE 'nextval%'
- SELECT column_name FROM information_schema.columns
- WHERE table_name = 'table1'
- AND ( column_default IS NULL OR column_default NOT LIKE 'nextval%')
- AND (column_default LIKE 'nextval%') IS NOT TRUE;
- SELECT column_name
- FROM information_schema.columns
- WHERE table_name = 'hstore1'
- AND table_schema = 'public' -- your schema
- AND (column_default IS NULL OR
- column_default NOT LIKE 'nextval%');
- SELECT *
- FROM pg_catalog.pg_attribute a
- WHERE attrelid = 'table1'::regclass
- AND NOT attisdropped -- no dropped (dead) columns
- AND attnum > 0 -- no system columns
- AND NOT EXISTS (
- SELECT FROM pg_catalog.pg_attrdef d
- WHERE (d.adrelid, d.adnum) = (a.attrelid, a.attnum)
- AND d.adsrc LIKE 'nextval%'
- AND pg_get_serial_sequence(a.attrelid::regclass::text, a.attname) <> ''
- );
- AND column_default NOT LIKE 'nextval%' OR column_default IS NULL
- AND NOT column_default LIKE 'nextval%'
- SELECT column_name *FROM* information_schema.columns
- WHERE table_name = 'table1'
- AND ( nvl(column_default,0) *NOT LIKE* 'nextval%');
Add Comment
Please, Sign In to add comment