Re: oid's and primary keys on insert
| От | Andrew Sullivan |
|---|---|
| Тема | Re: oid's and primary keys on insert |
| Дата | |
| Msg-id | 20020812102216.D17166@mail.libertyrms.com обсуждение исходный текст |
| Ответ на | Re: oid's and primary keys on insert (Joe Conway <mail@joeconway.com>) |
| Список | 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@libertyrms.info> M6K 3E3
+1 416 646 3304 x110
В списке pgsql-general по дате отправления: