Re: oid's and primary keys on insert
| От | Rob Brown-Bayliss |
|---|---|
| Тема | Re: oid's and primary keys on insert |
| Дата | |
| Msg-id | 1028948615.3625.3.camel@everglade.zoism.org обсуждение исходный текст |
| Ответ на | Re: oid's and primary keys on insert (Andrew Sullivan <andrew@libertyrms.info>) |
| Список | pgsql-general |
> Why don't you use a sequence at each site and a "site id" field? > Then put a unique index on the site id + the sequence. You'd get > something like > > |site_id|trans_id| > ------------------ > | 46 | 23456 | > > Also makes it easier to get "all transactions from site 46". You can > even set each site's site_id field to the appropriate default, if you > want, so that you don't have to handle it in your code. I started out that way, but thought the whole select and update thing would get messy, like select blah from wah where site_id = 43 and trans_id = 5345 rather than a single where pkey = 43-5345 Thats realy the only reason I didn't do that. Not realy a goot reason at that... -- * * Rob Brown-Bayliss *
В списке pgsql-general по дате отправления: