how to detect if a column of a table is set by a foreign key, and get the name of the referenced table, in Postgres?
I need this Information for a java GUI. So SQL solution is the best way it could be solved, i really can't manage it.
regards stefan
example:
create table SUREALTABLE(
VNR varchar(5),
tnumberone integer,
tnumbertwo integer,
foreign key (tnumberone ,tnumbertwo) references TESTTABLE(numberone,numbertwo),
primary key (VNR)
);
create table TESTTABLE(
numberone integer,
numbertwo integer,
primary key (numberone, numbertwo)
);