Home > Blockchain >  postgres - how to alter a column with timestamp?
postgres - how to alter a column with timestamp?

Time:10-21

In postgre sql - How do I alter a column which has time stamp. Currently the column is defined as below -
creation_time timestamp(6) with time zone
and i want to make the above column not null also. So i have tried below but had no luck

ALTER TABLE my_table ALTER COLUMN creation_time TYPE timestamp(6) with time zone NOT NULL;

What is the correct syntax ?

CodePudding user response:

According to the documentation:

alter table my_table alter creation_time set not null;
  • Related