Skip to content

Instantly share code, notes, and snippets.

@soltrinox
Created February 16, 2015 20:35
Show Gist options
  • Save soltrinox/f38146c20c5523533bb6 to your computer and use it in GitHub Desktop.
Save soltrinox/f38146c20c5523533bb6 to your computer and use it in GitHub Desktop.
CREATE SEQUENCE POSTGRES FOR EXISTING TABLE
CREATE SEQUENCE "TYPES_typeid_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."TYPES_typeid_seq" OWNER TO postgres;
ALTER SEQUENCE "TYPES_typeid_seq" OWNED BY "TYPES".typeid;
ALTER TABLE ONLY "TYPES" ALTER COLUMN typeid SET DEFAULT nextval('"TYPES_typeid_seq"'::regclass);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment