Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

find all Default Values of the Columns

In this post, I am sharing one script to find all default values of the PostgreSQL columns.

Sometimes, it is required to find out default values of a column which is creating a problem in the data.

You can easily find default values in the table definition script, but if you require to report all default values of a database, you desire only one script to find all default values.

Using below script you can find all default values and also if you require to find particular default value, you can add a filter in WHERE clause.
FROM information_schema.columns
WHERE table_schema = 'schema_name'
 AND column_default IS NOT NULL
ORDER BY column_name;


Popular posts from this blog

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

PostgreSQL Database startup / shutdown /restart

PostgreSQL Pgbadger Installation On Linux

PostgreSQL pgBadger

ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated ORA-01262: Stat failed on a file destination directory Linux-x86_64 Error: 2: No such file or directory