About null
'anything' NOT LIKE NULLgives NULL, not TRUE.
And only TRUEsuitable for filter expressions in a sentence WHERE.
NULL NULL ( !).
NULL .
, :
AND (column_default LIKE 'nextval%') IS NOT TRUE;
. .
- . Postgres, search_path, .
SELECT column_name
FROM information_schema.columns
WHERE table_name = 'hstore1'
AND table_schema = 'public'
AND (column_default IS NULL OR
column_default NOT LIKE 'nextval%');
, . , "nextval" serial. , , "" . pg_get_serial_sequence(table_name, column_name) ...
. , . . . . Oracle ...
, Postgres. :
SELECT *
FROM pg_catalog.pg_attribute a
WHERE attrelid = 'table1'::regclass
AND NOT attisdropped
AND attnum > 0
AND NOT EXISTS (
SELECT 1 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) <> ''
);
, .
:
pg_attrdef . pg_attribute (. ). , ( ) .
'table1'::regclass search_path , . : 'myschema.table1'::regclass. :
,
:
Postgres?