Finding columns that are NOT NULL in PostgreSQL
问题 I had an assignment for each table to count nullable columns. Easy: SELECT table_name, count(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE is_nullable='NO' GROUP BY table_name; Now I have to modify this to count "columns that have property "NOT NULL"". Will the following code do this or will it just check weather column name is not null? CREATE TEMP TABLE A AS SELECT DISTINCT column_name, table_name AS name FROM INFORMATION_SCHEMA.COLUMNS WHERE column_name IS NOT NULL GROUP BY table_name, column