Re: Synthesize support for Statement.getGeneratedKeys()? - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Synthesize support for Statement.getGeneratedKeys()?
Date
Msg-id 45D5202A.5020000@ejurka.com
Whole thread Raw
In response to Synthesize support for Statement.getGeneratedKeys()?  (Ken Johanson <pg-user@kensystem.com>)
Responses Re: Synthesize support for Statement.getGeneratedKeys()?
List pgsql-jdbc
Ken Johanson wrote:
> Do you know what built-in method I can choose to determine what
> identifiers need quoting?
>

There isn't one, but I was thinking about it some more and I think we
might want to quote everything.  Otherwise we won't be able to
distinguish between columns that are created with quotes and those
without.  Consider a table like:

CREATE TABLE tab(a int, "A" int);

Without parsing the query and doing some metadata lookups we won't know
what the columns are.  I'd rather not try to do this and the behavior
matches our existing handling of DatabaseMetaData methods.  Although we
might get some complaints, I'm OK with it.

Right now the only place we quote identifiers in
jdbc3/PSQLSavepoint#getPGName.  I would suggest creating a method in
org.postgresql.core.Utils named appendEscapedIdentifier that works like
appendEscapedString and using it in both places.




pgsql-jdbc by date:

Previous
From: Ken Johanson
Date:
Subject: Re: Synthesize support for Statement.getGeneratedKeys()?
Next
From: Kris Jurka
Date:
Subject: Re: Synthesize support for Statement.getGeneratedKeys()?