Column quoting in result set getters
Column quoting in result set getters
От:
Manuel Sugawara <masm@fciencias.unam.mx>
Дата:
Hi,
When I try to get the value of a column by name, using quotes the
driver throws an exception telling me that that column does not
exists. The column name has accents:
int val = res.getInt("\"última\"");
Since quote_ident() quotes the names containing accents I think the
driver should accept the quoted version as well or am I missing
something? I'm using pg74.1jdbc3.jar.
Any thoughts?
Regards,
Manuel.
Re: Column quoting in result set getters
От:
Kris Jurka <books@ejurka.com>
Дата:
On Wed, 2 Jun 2004, Manuel Sugawara wrote:
> When I try to get the value of a column by name, using quotes the
> driver throws an exception telling me that that column does not
> exists. The column name has accents:
>
> int val = res.getInt("\"última\"");
>
> Since quote_ident() quotes the names containing accents I think the
> driver should accept the quoted version as well or am I missing
> something? I'm using pg74.1jdbc3.jar.
>
I'm not sure what connection you are making between quote_ident and the
ResultSet methods, why should these act the same? It certainly is
possible to have column names with quotes, for example:
jurka=# create table quote ("""a""" int);
CREATE TABLE
jurka=# \d quote
Table "public.quote"
Column | Type | Modifiers
--------+---------+-----------
"a" | integer |
In this case ResultSet.getInt("\"a\"") would be correct, what are you
suggesting should be used in this case? ResultSet.getInt("\"\"\"a\"\"\"")
Kris Jurka