[PATCH] Fix CREATE INDEX/CONSTRAINT syntax when tablespace and fillfactor are specified

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: pgAdmin hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: [PATCH] Fix CREATE INDEX/CONSTRAINT syntax when tablespace and fillfactor are specified
Date: 2010-10-05 21:33:57
Message-ID: AANLkTikvq9Y5RTbJKXOmUnyw-_+z2wJoXdZY8531XyVN@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi list,

Quite recently I stumbled upon this bug in pgAdminIII and today I was
reading Guillaume Lelarge's article about pgAdmin's git repository and
this is the result. :)

The patch is attached, or you can also get it at
http://github.com/intgr/pgadmin3 branch "mybugfix"

Regards,
Marti

----
Commit message:
Fix CREATE INDEX/CONSTRAINT syntax when tablespace and fillfactor are specified

Reverse the order of TABLESPACE and WITH() clauses for indexes. Previously
pgAdminIII generated CREATE scripts like:

ALTER TABLE foo ADD CONSTRAINT foo_pkey PRIMARY KEY(foo_id)
USING INDEX TABLESPACE bar WITH (FILLFACTOR=50);
CREATE INDEX foo_foo_id ON foo USING btree (foo_id)
TABLESPACE bar WITH (FILLFACTOR=50);

However these are illegal PostgreSQL syntax, the WITH() clause must come before
TABLESPACE.

The statements generated by "new index" or "new primary key" dialogs are
already correct.

Attachment Content-Type Size
0001-Fix-CREATE-INDEX-CONSTRAINT-syntax-when-tablespace-a.patch text/x-patch 2.7 KB

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2010-10-05 22:25:59 Re: [PATCH] Fix CREATE INDEX/CONSTRAINT syntax when tablespace and fillfactor are specified
Previous Message Dave Page 2010-10-04 12:54:45 Re: pgAdmin 1.12.1 tarball available