Reputation: 11774
I am trying to alter a tables column with a default value of -11 and it can be null
ALTER TABLE devicedata ALTER COLUMN "weather" smallint NULL DEFAULT -11 ;
it says error
Upvotes: 0
Views: 55
Reputation: 222432
In Postgres the syntax for this is:
alter table device_data alter column wheather type smallint;
Then you can change the default
:
alter table device_data alter column wheather set default 10;
The column
keyword is optional.
Upvotes: 1