Re: how to create secondary key!!
От | Josh Berkus |
---|---|
Тема | Re: how to create secondary key!! |
Дата | |
Msg-id | web-1801250@davinci.ethosmedia.com обсуждение исходный текст |
Ответ на | how to create secondary key!! ("Nelson Yong" <nelsonyong@ipmuda.com.my>) |
Список | pgsql-novice |
Nelson, > I appriciate u reply, thank u. > > I try the sql statement which u commented then how to solve not null > problem. > > ALTER TABLE king ADD CONSTRAINT king_PK > PRIMARY KEY (vb1, vb2); > > Error hit during execute this command > Number: -2147467259 > > Description: Error while executing the query; > ERROR: Existing attribute "vb1" cannot be a PRIMARY KEY because it > is > not marked NOT NULL > --------------------------- > OK > --------------------------- > > i try to use command below but no function, kindly command. > > ALTER TABLE table_name > ALTER COLUMN column_name INT NOT NULL Regrettably, this function of the ALTER TABLE command is currently not supported in PostgreSQL. In order to mark a column as NOT NULL, you must: 1) make sure to remove all NULLs from the column, and 2) modify the system tables to set the column NOT NULL. Hopefully someone will post more detailed instructions on step 2), as I cannot remember them right now. -Josh
В списке pgsql-novice по дате отправления: