On 14 Apr 2003, Dave Cramer wrote:
[ foreign keys don't show up if they reference a unique key other than the
primary key]
Basically the problem is that there is no real link between the foreign
key and the index. With a primary key this is not a problem because there
can be only one primary key per table. Supposing I had done:
create table tab (a int not null, b int not null);
create unique index t1 on tab (a,b);
create unique index t2 on tab (a,b);
create unique index t3 on tab (b,a);
create table tab2 (a int, b int);
alter table tab2 add constraint tab2_fk_tab foreign key (a,b) references
tab(a,b);
What is the resulting value in the PK_NAME column from a getCrossReference
call?
Actually looking at the javadoc it appears this may be null which would be
OK. Getting at the data could be another problem as it is rather
complicated for the existing functionality.
Unfortunately jxdbcon is LGPL licensed which is no good as a source of
inspiration to our BSD driver. I will be away for the next two weeks and
will look at this more closely later. My initial reaction is that this
will depend on Joe Conway's work on the new array functionality and
getting something like contrib/array integrated into the backend, which
will then allow this for >= 7.4 servers.
Kris Jurka