Skip site navigation (1) Skip section navigation (2)

Re: Column quoting in result set getters

From: Kris Jurka <books(at)ejurka(dot)com>
To: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Column quoting in result set getters
Date: 2004-06-07 07:47:57
Message-ID: Pine.BSO.4.56.0406070242210.29634@leary.csoft.net (view raw or flat)
Thread:
Lists: 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

In response to

pgsql-jdbc by date

Next:From: Markus SchaberDate: 2004-06-07 07:47:58
Subject: Re: Using a COPY...FROM through JDBC?
Previous:From: Markus SchaberDate: 2004-06-06 22:08:00
Subject: Re: Using a COPY...FROM through JDBC?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group