开发者

How do I change column default value in PostgreSQL?

How do I change column default value in PostgreSQL?

I've tr开发者_如何学运维ied:

ALTER TABLE ONLY users ALTER COLUMN lang DEFAULT 'en_GB';

But it gave me an error:

ERROR: syntax error at or near "DEFAULT"


'SET' is forgotten

ALTER TABLE ONLY users ALTER COLUMN lang SET DEFAULT 'en_GB';


If you want to remove the default value constraint, you can do:

ALTER TABLE <table> ALTER COLUMN <column> DROP DEFAULT;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜