Problems with DatabaseMetaData.getImportedKeys

Поиск
Список
Период
Сортировка
От Carlos Correia
Тема Problems with DatabaseMetaData.getImportedKeys
Дата
Msg-id 1076076492.31184.43.camel@devo.m16e.com
обсуждение исходный текст
Ответы Re: Problems with DatabaseMetaData.getImportedKeys  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
Hi,

When I try to run the program DatabaseTest.java (see attach) with the
db-test database (see attach: db-test.sql) I get duplicated tuples for
each foreign key:

<Database.getKeyInfo> for table: table_1
>>> Imported keys

>>> Exported keys:


  1: c2
  from table_1  to   table_2.t2_f2

  1: c1
  from table_1  to   table_2.t2_f1

  1: c2
  from table_1  to   table_2.t2_f2

  1: c1
  from table_1  to   table_2.t2_f1

<Database.getKeyInfo> for table: table_2
>>> Imported keys


  1: c2
  from table_1  to   table_2.t2_f2

  1: c1
  from table_1  to   table_2.t2_f1

  1: c2
  from table_1  to   table_2.t2_f2

  1: c1
  from table_1  to   table_2.t2_f1
>>> Exported keys:

Is there any way of avoiding these duplicated tuples?

I'm running PostgreSQL version 7.3.2 (Mandrake 9.1) with pg73jdbc3.jar
driver.

Thanks,

carlos
CREATE TABLE table_1 (
    t1_f1 integer NOT NULL,
    t1_f2 character(20) NOT NULL
);


CREATE TABLE table_2 (
    t2_f1 integer NOT NULL,
    t2_f2 integer NOT NULL
);

ALTER TABLE table_1
        ADD CONSTRAINT pk1 PRIMARY KEY (t1_f1);

ALTER TABLE table_2
        ADD CONSTRAINT pk2 PRIMARY KEY (t2_f1);

ALTER TABLE table_2
    ADD CONSTRAINT c1
        FOREIGN KEY (t2_f1)
        REFERENCES table_1(t1_f1);

ALTER TABLE ONLY table_2
    ADD CONSTRAINT c2
        FOREIGN KEY (t2_f2)
        REFERENCES table_1(t1_f1);


Вложения

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: ResultSet construction and byte arrays
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Problems with DatabaseMetaData.getImportedKeys