ALTER TABLE users ADD "priv_user" BIT ALTER priv_user SET DEFAULT '0'
谢谢!
ALTER TABLE users ADD "priv_user" BIT ALTER priv_user SET DEFAULT '0'
谢谢!
ALTER TABLE users ADD COLUMN "priv_user" BOOLEAN DEFAULT FALSE;
你也可以直接指定NOT NULL
ALTER TABLE users ADD COLUMN "priv_user" BOOLEAN NOT NULL DEFAULT FALSE;
正如Craig在填充表中提到的,它更有效地分成步骤:
ALTER TABLE users ADD COLUMN priv_user BOOLEAN; UPDATE users SET priv_user = 'f'; ALTER TABLE users ALTER COLUMN priv_user SET NOT NULL; ALTER TABLE users ALTER COLUMN priv_user SET DEFAULT FALSE;