Created
September 26, 2015 14:07
-
-
Save ilovejs/d2eb1c8d8bab7328e01a to your computer and use it in GitHub Desktop.
alter column to be serial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE SEQUENCE "temp1_id_seq" OWNED BY "Temp1". ID; | |
ALTER TABLE "Temp1" ALTER COLUMN ID | |
SET DEFAULT nextval('temp1_id_seq'); | |
COMMIT; | |
--Temp1 is table name, however, sequence name must be low-cased. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment