I was creating tables in PostgreSQL. Then I had to use an column as foreign key so I altered my table to define that column as foreign key.
But I got an error at "WITH",
ALTER TABLE Account WITH NOCHECK ADD CONSTRAINT FK_Account_AccountCPCMapping FOREIGN KEY(nAccountCPCMappingID)
REFERENCES AccountCPCMapping (nAccountCPCMappingID);
I am getting error like,
ERROR: syntax error at or near "WITH"
LINE 1: ALTER TABLE Account WITH NOCHECK ADD CONSTRAINT FK_Account...
Please suggest any corrections.
with nocheck? What do you expect it to do?NOT VALID; it goes at the very end of your query and will prevent PostgreSQL from checking existing rows against this constraint.