pgdiff icon indicating copy to clipboard operation
pgdiff copied to clipboard

Syntax error in 7-INDEX.sql (1.0 beta 1 for linux)

Open m3dbedb opened this issue 7 years ago • 0 comments

This is 7-INDEX.sql generated by pgdiff

CREATE UNIQUE INDEX books_lost_id_pkey ON books_lost USING btree (id)
ALTER TABLE public.books_lost ADD CONSTRAINT books_lost_id_pkey PRIMARY KEY USING INDEX books_lost_id_pkey; 

It fails to run with error

ERROR:  syntax error (approximate position: "ALTER")
STRING 2: ALTER TABLE public.books_lost ADD CONSTRAINT books_lost_id_p...
          ^

And it gone after adding a semicolon to the first string:

CREATE UNIQUE INDEX books_lost_id_pkey ON books_lost USING btree (id);
ALTER TABLE public.books_lost ADD CONSTRAINT books_lost_id_pkey PRIMARY KEY USING INDEX books_lost_id_pkey;

m3dbedb avatar Jun 08 '18 10:06 m3dbedb