Re: metadata searching

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Juriy Goloveshkin <j(at)gu(dot)ru>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: metadata searching
Date: 2004-02-04 10:04:44
Message-ID: 4020C3BC.2070201@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Juriy Goloveshkin wrote:

>>What happens when you have two tables that differ only in case? Seems
>>like the current behaviour is correct to me.
>
>
> Ok. Are You want to say that the different behavior in sql engine and jdbc
> code is normal?
> why I can build sql statement like 'select from Base' and 'select from base'
> while I have only one table 'base',
> but getTables(..., "Base", ...) and getTables(..., "base", ...) gives me a
> diffenent result.
> Where is the logic?
> What about psql?
> \d Base
> \d base
> gives me info about the table 'base'. but not jdbc getTables(). pretty nice.
>
> I think the logic of things like getTables have to be the same as the sql
> engine.

You're only seeing inconsistencies because you're using unquoted
identifiers on the SQL side. Java strings are case-sensitive; the
behaviour of getTables is consistent with what you get when using
case-sensitive (i.e. quoted) SQL identifiers. Witness:

$ psql testdb
Welcome to psql 7.4.1, the PostgreSQL interactive terminal.
[...]
testdb=> create table "test" (k int4);
CREATE TABLE
testdb=> create table "Test" (q int4);
CREATE TABLE
testdb=> \d "test"
Table "public.test"
Column | Type | Modifiers
--------+---------+-----------
k | integer |

testdb=> \d "Test"
Table "public.Test"
Column | Type | Modifiers
--------+---------+-----------
q | integer |

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-02-04 10:46:35 Re: metadata searching
Previous Message Kris Jurka 2004-02-04 09:37:04 Re: Comments on adding more connection URL parameters.