meta-data problem

From: "Tomi NA" <hefest(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: meta-data problem
Date: 2006-03-11 14:27:25
Message-ID: d487eb8e0603110627h28e634e2tad0233bf45bccb69@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi everyone,

I use cayenne as on object relational mapping system and have a question
about using it with pgsql. It seems that when I try to reverse engineer a
pgsql db (server v.8.1.2), the table structure is OK, but no table relations
are discovered, so all the foreign keys are simply interpreted as additional
integer columns, instead of foreign keys. I've tried using the driver
supplied with pgsql 8.1.2 (8.0-310?) and 8.2dev-501, but it makes no obvious
difference.
My question is: could this be a jdbc-driver bug? I can't tell, but I've used
another RDBMS with cayenne and database structure discovery worked
flawlessly there. Could be a cayenne issue, but the developers suggest it's
probably not, but could be worked arround if needed.

I don't think there's anything wrong with the table and references
definitions. To illustrate, here's one:
CREATE TABLE opca.dokument
(
sif_dokument int4 NOT NULL,
sif_vrsta_dokumenta int4,
sif_spis int4,
zaprema timestamp,
opis varchar(255),
CONSTRAINT dokument_pkey PRIMARY KEY (sif_dokument),
CONSTRAINT fk_dokument_1 FOREIGN KEY (sif_spis)
REFERENCES opca.spis (sif_spis) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk_dokument_2 FOREIGN KEY (sif_vrsta_dokumenta)
REFERENCES opca.vrsta_dokumenta (sif_vrsta_dokumenta) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITHOUT OIDS;

Btw, I don't use any composite keys in this database whatsoever, so that's
not part of the problem (I've seen it mentioned in o post some time ago).
I'll reconstruct the relationships by hand this time, but it'd be nice if we
find out why the relationships aren't found.

TIA,
Tomislav

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2006-03-11 14:39:23 Re: meta-data problem
Previous Message Kris Jurka 2006-03-10 19:25:28 Re: java.sql.SQLException: No suitable driver