Re: oid's and primary keys on insert

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: PostgreSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: oid's and primary keys on insert
Date: 2002-08-12 14:22:17
Message-ID: 20020812102216.D17166@mail.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Aug 09, 2002 at 08:23:54PM -0700, Joe Conway wrote:
> I had the exact same experience. Having a 2 column primary key on every
> table (and hence for every foreign key as well) gets unmanageable pretty
> quickly.

You could write a trigger which populates the primary key as a
combination of site_id and trans_id. Then you still get the
advantage of a simple sequence plus a site id, without needing a
two-column primary key. Of course, then you pay the price of a
trigger every time you insert.

A

--
----
Andrew Sullivan 87 Mowat Avenue
Liberty RMS Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info> M6K 3E3
+1 416 646 3304 x110

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2002-08-12 14:39:12 Re: [HACKERS] Linux Largefile Support In Postgresql RPMS
Previous Message Randall Perry 2002-08-12 13:44:08 Re: Craetalang function can't find libgcc_s.so.1 on