psql - View column names and date types for a table or view
Query for specific view === SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'vw_some_view_name' ORDER BY ordinal_position; Query all tables and views within a database and/or schema === SELECT table_catalog, table_schema, table_name, column_name, data_type, character_maximum_length FROM information_schema.columns WHERE table_name NOT LIKE 'pg_%' AND domain_schema IS NULL AND table_schema = 'allied' ORDER BY table_name, ordinal_position;
Comments