Thread: Problem:Row Versioning with multiple field Primary Key

Problem:Row Versioning with multiple field Primary Key

From
DI Hasenöhrl
Date:
Hi,
I use postgresql 7.0.2 with ODBC 7.1.0003 as backend and MsAccess97 as frontend.
In order to be able to work with float and numeric values I must enable Row Versioning, but this only works with single field primary keys.
In my database design I use multiple field primary keys and also multiple field foreign keys.
For enabling Row Versioning I changed the multiple field Primary keys to a *dummy* single field primary key and created unique indexes but how can I realize referential integrity on these unique indexes???????????
I can imagine to handle referential integrity with triggers. Is there another, better solution for this problem?
 
Please, let me know where I can find some hints :-)
Kind regards
Irina

E-Mail: i.hasenoehrl@aon.at

Re: Problem:Row Versioning with multiple field Primary Key

From
Cedar Cox
Date:
From the reference manual:

REFERENCES Constraint

[ CONSTRAINT constraint_name ] REFERENCES reftable [ ( refcolumn ) ]
    [ MATCH matchtype ]
    [ ON DELETE action ]
    [ ON UPDATE action ]
    [ [ NOT ] DEFERRABLE ]
    [ INITIALLY checktime ]

The refcolumn doesn't need to be the primary key.  Do you just want to
have referential integrity between your two (or more) unique fields (the
ones you originally used as the primary key) and some other table(s)?

-Cedar

On Mon, 30 Jul 2001, DI Hasenöhrl wrote:

> Hi,
> I use postgresql 7.0.2 with ODBC 7.1.0003 as backend and MsAccess97 as frontend.
> In order to be able to work with float and numeric values I must enable Row Versioning, but this only works with
singlefield primary keys. 
> In my database design I use multiple field primary keys and also multiple field foreign keys.
> For enabling Row Versioning I changed the multiple field Primary keys to a *dummy* single field primary key and
createdunique indexes but how can I realize referential integrity on these unique indexes??????????? 
> I can imagine to handle referential integrity with triggers. Is there another, better solution for this problem?
>
> Please, let me know where I can find some hints :-)
> Kind regards
> Irina
>
> E-Mail: i.hasenoehrl@aon.at
>


Re: Problem:Row Versioning with multiple field Primary Key

From
Cedar Cox
Date:
> >From the reference manual:
>
> REFERENCES Constraint

hehe.. no pun intended :)

Forgot to say, "from CREATE TABLE..."