SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' ORDER BY table_name ASC
SELECT column_name FROM information_schema.columns WHERE table_name ='training_contracts' ORDER BY column_name ASC;
select
t.relname as table_name,
i.relname as index_name,
a.attname as column_name
from
pg_class t,
pg_class i,
pg_index ix,
pg_attribute a
where
t.oid = ix.indrelid
and i.oid = ix.indexrelid
and a.attrelid = t.oid
and a.attnum = ANY(ix.indkey)
and t.relkind = 'r'
-- and t.relname like 'aac%'
order by
t.relname,
i.relname;