PG 7.3: Query Meta Data with the JDBC-driver

Поиск
Список
Период
Сортировка
От Henner Zeller
Тема PG 7.3: Query Meta Data with the JDBC-driver
Дата
Msg-id Pine.LNX.4.44.0212022025090.6323-100000@kupfersulfat.toxine.lan
обсуждение исходный текст
Ответы Re: PG 7.3: Query Meta Data with the JDBC-driver  (Kris Jurka <books@ejurka.com>)
Re: PG 7.3: Query Meta Data with the JDBC-driver  (snpe <snpe@snpe.co.yu>)
Список pgsql-hackers
Hi,
Just compiled the 7.3 branch from source and made some tests using the 
JDBC driver coming with it. I did some tests with the henplus 
JDBC-shell and noticed some problems quering the database meta data:
  o the foreign key name is 'wierd'    ---      DatabaseMetaData meta = conn.getMetaData();      ResultSet rset =
meta.getImportedKeys(null,null, 'bar');      rset.next();      String foreignKeyName=rset.getString(12);    ---
resultsin names that seemingly contains the internal representation:
fk_foo_id\000bar\000foo\000UNSPECIFIED\000fooref\000id\000   (see below for an example)
 
  o It takes _ages_ to retrieve the meta data. While doing a 'describe',    the postmaster process runs on 100% CPU.
And:it takes extremly     different amounts of time. Executing the describe-command below, it     took (56.285 sec,
12.799sec, 5 min 13.468, 12.203 sec) to execute     the same command. This look very like a missing or     random
break-conditionsomewhere in a loop ?
 
  o this might be a minor point, but annoying as well: the columns are    not ordered in the sequence the're created in
thetable.
 

If this cannot be reproduced, I'll try to track this down, but probably 
this seems simple to you (BTW: doing this with the current 7.4development 
CVS on my machine, this results in a segmentation fault on the postmaster 
side - this indicates, that there indeed is a problem ..)

===============8<==============
pg> create table foo (id int4 constraint pk_foo primary key);
pg> create table bar ( id     int4 constraint pk_bar primary key,                       fooref int4 constraint
fk_foo_idreferences foo(id)                    );
 
pg> describe bar
catalog: postgres'->' : referencing
--------+---------+------+---------+--------+------------------------------------------------------------+column |
type  | null | default |   pk   |                             fk                             |
 
--------+---------+------+---------+--------+------------------------------------------------------------+fooref |
int4(4)| YES  | [NULL]  |        | fk_foo_id\000bar\000foo\000UNSPECIFIED\000fooref\000id\000 |       |         |
|        |        |  -> foo(id)                                                |id     | int4(4) | NO   | [NULL]  |
pk_bar|                                                            |
 
--------+---------+------+---------+--------+------------------------------------------------------------+
56.285 sec
===============================


ciao, -hen

BTW:
henplus JDBC-Shell can be found <http://henplus.sourceforge.net/>



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joel Burton
Дата:
Сообщение: Re: numeric to text (7.3)
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: ALTER TABLE schema SCHEMA TO new_schema?