From: | Dave Page <dpage(at)postgresql(dot)org> |
---|---|
To: | Stephen Denne <Stephen(dot)Denne(at)datamail(dot)co(dot)nz> |
Cc: | pgAdmin Support <pgadmin-support(at)postgresql(dot)org> |
Subject: | Re: pgAdmin isn't quoting quotes |
Date: | 2007-10-18 08:50:51 |
Message-ID: | 47171E6B.9000200@postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-support |
Stephen Denne wrote:
> (1.8RC1)
>
> If for some unusual reason I want to use pgadmin to add a column named:
>
> one "two" three
>
> Then I am able to specify this identifier as
>
> "one ""two"" three"
>
> but pgadmin will always show it as
>
> one "two" three
>
> Which I think is ok, but it shows it in generated SQL as
>
> "one "two" three"
>
> instead of
>
> "one ""two"" three"
>
> So trying to change the column's type (for example) attempts this SQL:
>
> ALTER TABLE dbversion ALTER "one "two" three" TYPE bigint;
> ALTER TABLE dbversion ALTER COLUMN "one "two" three" SET STATISTICS -1;
>
> If I alter the name again when changing the type, I get this instead:
>
> ALTER TABLE dbversion RENAME "one "two" three" TO ""one ""two"" three"";
> ALTER TABLE dbversion ALTER ""one ""two"" three"" TYPE bigint;
> ALTER TABLE dbversion ALTER COLUMN ""one ""two"" three"" SET STATISTICS -1;
>
> Which still doesn't work.
>
> I don't think that this is a high priority bug, as those who use double quotes in identifiers probably deserve less than the level of quality that pgadmin already provides.
Yeah, using a column name like "one ""two"" three" really is asking for
trouble and falls firmly in the "Don't do that category".
I've worked up the attached patch for this, but I'm not going to apply
it for the 1.8 release - it'll have to wait for 1.10. Tradionally we've
found that changing the quoting rules tends to subtly break things we
don't think about at the time, which I'm not prepared to do so close to
release.
Thanks for the report.
Regards, Dave
Attachment | Content-Type | Size |
---|---|---|
pgadmin3-quotes-in-idents.diff | text/x-patch | 1.4 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Laurent ROCHE | 2007-10-18 10:13:32 | Wish list and Doc Errors |
Previous Message | Dave Page | 2007-10-18 07:57:26 | Re: pgAdmin 1.8RC1 - failed to launch on Mac OS X |