Re: Bug in metadata.getColumns()/ORDINAL_POSITION

Поиск
Список
Период
Сортировка
От j.random.programmer
Тема Re: Bug in metadata.getColumns()/ORDINAL_POSITION
Дата
Msg-id 616596.40210.qm@web32005.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Bug in metadata.getColumns()/ORDINAL_POSITION  ("j.random.programmer" <javadesigner@yahoo.com>)
Ответы Re: Bug in metadata.getColumns()/ORDINAL_POSITION  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-jdbc
This is a quick followup to my earlier post. Upon
further
testing, this bug reliably and reproducably happens
when an "alter table" command is used on the database.

For for example:

test=# create table foo(x int, y varchar(5));

At this point, the jdbc metadata (md) method:

md.getColumns(
 catalogname, schemaname, tablename, "%");

returns the correct ORDINAL_POSITION for x and y.

x -- >1
y ---> 2

Now, let's do this:

test=# alter table foo add z text;
ALTER TABLE
test=# alter table foo drop z;
ALTER TABLE
test=# alter table foo drop y;
ALTER TABLE
test=# alter table foo add a varchar(10);


md.getColumns(
 catalogname, schemaname, tablename, "%");

now returns
x --> 1
a --> 4

and that's the bug right there.

Should be

a  ---> 2  (NOT 4)

since there are only 2 columsn in the database
at this point.


Maybe the database is not updating the system tables
properly when columns are altered/dropped ? Or is
this something in the driver ?

Either way, this totally breaks any O/R mapping tool.

Best regards,

-j





____________________________________________________________________________________
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.
http://tv.yahoo.com/

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Bug in metadata.getColumns()/ORDINAL_POSITION
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bug in metadata.getColumns()/ORDINAL_POSITION