Re: Case-sensitive problem in AS clause?

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: dmp <danap(at)ttc-cmc(dot)net>, Laurent Mazuel <lmazuel(at)antidot(dot)net>, PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Case-sensitive problem in AS clause?
Date: 2012-07-16 16:55:39
Message-ID: CADK3HHJcQZMrdmqo1pLCU3GVxB1QD5kGAHUA7mfskXrknv_t0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

The name of the column is not always case sensitive in fact postgresql
all names are folded to lower case unless quoted

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On Mon, Jul 16, 2012 at 12:49 PM, David Johnston <polobo(at)yahoo(dot)com> wrote:
>> -----Original Message-----
>> From: pgsql-jdbc-owner(at)postgresql(dot)org [mailto:pgsql-jdbc-
>> owner(at)postgresql(dot)org] On Behalf Of dmp
>> Sent: Monday, July 16, 2012 12:05 PM
>> To: Laurent Mazuel; PostgreSQL JDBC
>> Subject: Re: [JDBC] Case-sensitive problem in AS clause?
>>
>> Again as the as identifier is not quoting it default to the default
> behavior for
>> assignment. As far as the isCaseSensitive() it is found that the method in
> the
>> Pgjdbc, org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java is:
>>
>> /*
>> * Does a column's case matter? ASSUMPTION: Any field that is
>> * not obviously case insensitive is assumed to be case sensitive
>> *
>>
>> >
>> > Then, the column name is changed from StudentId to studentid, but the
>> > "isCaseSensitive" flag is "true". I think it is not correct, since it
>> > is impossible from now, when a user ask for the StudentId column to
>> > retrieve it from a resultset. The "isCaseSensitive" don't authorize to
>> > accept the string StudentId as a valid column name for the studentid
>> > column in the ResultSet.
>>
>> Recommed you quote AS "StudentID" to get the behavior you desire.
>>
>> danap.
>
> Does the "isCaseSensitive(int)" function return whether the "value" stored
> in the column is case-sensitive or does it return whether the "name" of the
> column is case-sensitive?
>
> The OP is using it to determine whether the "name" is case-sensitive - which
> it is always.
>
> My assumption is that it would indicate whether the "value" is
> case-sensitive - which is also true because varchar/text is case-sensitive.
>
> The fact that different fields may or may not be case-sensitive supports
> this since the "case-sensitive" property of a column "name" should be
> constant throughout the database/product.
>
> David J.
>
>
>
>
>
>
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Radim Kolar 2012-07-16 17:21:26 not fetching all query results
Previous Message David Johnston 2012-07-16 16:49:05 Re: Case-sensitive problem in AS clause?