1 2 3 4 5 6 7 8 | -- Tables of db2 without PK SELECT table_catalog, table_schema, table_name FROM information_schema.tables WHERE (table_catalog, table_schema, table_name) NOT IN ( SELECT table_catalog, table_schema, table_name FROM information_schema.table_constraints WHERE constraint_type = 'PRIMARY KEY' ) AND table_schema NOT IN ( 'information_schema' , 'pg_catalog' ) and table_schema ~ '_db$' and table_schema not in ( 'prov_db' , 'queue_db' , 'ota_db' , 'sla_db' ); |