Re: Column quoting in result set getters - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Column quoting in result set getters
Date
Msg-id Pine.BSO.4.56.0406070242210.29634@leary.csoft.net
Whole thread Raw
In response to Column quoting in result set getters  (Manuel Sugawara <masm@fciencias.unam.mx>)
List pgsql-jdbc

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

pgsql-jdbc by date:

Previous
From: Markus Schaber
Date:
Subject: Re: Using a COPY...FROM through JDBC?
Next
From: Kris Jurka
Date:
Subject: Re: Forcing use of cursor for large result sets