更改列类型并设置为非null


100

您如何更改列类型并将该列设置为not null一起?

我在尝试:

ALTER TABLE mytable ALTER COLUMN col TYPE character varying(15) SET NOT NULL

这将返回一个错误。

正确的语法是什么?



在一起(在一个查询中),不可能同时做这两件事吗?
Oto Shavadze

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.