From: Tomi NA <hefest@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: meta-data problem
Date: Sat, 11 Mar 2006 15:27:25 +0100
Message-ID: <d487eb8e0603110627h28e634e2tad0233bf45bccb69@mail.gmail.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: hefest@gmail.com
Subject: Re: meta-data problem
In-Reply-To: <d487eb8e0603110627h28e634e2tad0233bf45bccb69@mail.gmail.com>
References: <d487eb8e0603110627h28e634e2tad0233bf45bccb69@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox