PostgreSQL

How to remove the DEFAULT value of a table column in PostgreSQL

Written by Ian Carnaghan · 10 sec read >

Execute the following command

ALTER TABLE your_table ALTER COLUMN your_column DROP DEFAULT;

Replace your_table with the table and your_column with the column name where you wish to remove the default value

The above command is the same as setting the DEFAULT to NULL

Last Updated On April 07, 2018
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. Profile

Leave a Reply

avatar
  Subscribe  
Notify of