Re: metadata searching - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: metadata searching
Date
Msg-id 4020C3BC.2070201@opencloud.com
Whole thread Raw
In response to metadata searching  ("Juriy Goloveshkin" <j@gu.ru>)
Responses Re: metadata searching  (Oliver Jowett <oliver@opencloud.com>)
List 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

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Comments on adding more connection URL parameters.
Next
From: Oliver Jowett
Date:
Subject: Re: metadata searching