Can't get all Imported Keys from dmd

From: "David A(dot) Bartmess" <dingodave(at)edingo(dot)net>
To: "PGSql JDBC Email List" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Can't get all Imported Keys from dmd
Date: 2002-06-25 16:15:09
Message-ID: 1025021709.2432.50.camel@Dingo.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

The following code SHOULD (according to the JDK1.4 docs) get all the
primary keys related to a table's foreign keys, if I read the docs
right. But I get back a ResultSet only containing one (1) key, not two,
as in my table.

Can someone explain this to me? Why won't it return all the keys in the
ResultSet?

Thanks!

ResultSet fkpk = dmd.getImportedKeys("", "", "login");

while (fkpk.next())
{
System.out.println("PK: " + fkpk.getString("PKTABLE_NAME"));
System.out.println("\t" + fkpk.getString("PKCOLUMN_NAME"));
System.out.println("FK: " + fkpk.getString("FKTABLE_NAME"));
System.out.println("\t" + fkpk.getString("FKCOLUMN_NAME"));
}

System.out.println(" ");
**********************************
Table creation script:

drop table login;
drop sequence login_id_seq;

create table login(
id serial primary key,
memberid int references members(id),
userid varchar(15) not null,
password varchar(15) not null,
verification char(20),
verifydatesent date,
verifydaterecd date,
accesslevel int references accesslevels(id),
remoteip varchar(16),
reminderquestion varchar(80),
reminderanswer varchar(25)
);
create index idxloginid on login(id);
create index idxlogin_memberid on members(id);

**********************************
Test results:

PK: accesslevels
id
FK: login
accesslevel

--
David A. Bartmess
Software Configuration Manager / Sr. Software Developer
eDingo Enterprises
http://edingo.net

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2002-06-25 16:22:41 Re: Can't get all Imported Keys from dmd
Previous Message Barry Lind 2002-06-25 16:11:42 Re: [HACKERS] Definite bug in JDBC