Postgres select columns names without default value

 PostgreSQL select column names where there is no default value :

 

SELECT column_name, column_default
FROM information_schema.columns
WHERE (table_schema, table_name) = ('public', 'test') AND column_default IS NULL
ORDER BY ordinal_position;

 

Comments

Popular posts from this blog

Mapserver install on Ubuntu 18.04 with Naviserver:

Certbot