--To get the list of tables in Postresql:
SELECT * FROM information_schema.tables WHERE table_name = 'tablename'
--To get the list of columns in the Postgresql tables:
SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tablename';