Re: oid's and primary keys on insert
От | Rob Brown-Bayliss |
---|---|
Тема | Re: oid's and primary keys on insert |
Дата | |
Msg-id | 1028927625.1855.63.camel@everglade.zoism.org обсуждение исходный текст |
Ответ на | Re: oid's and primary keys on insert ("Nigel J. Andrews" <nandrews@investsystems.co.uk>) |
Ответы |
Re: oid's and primary keys on insert
Re: oid's and primary keys on insert |
Список | pgsql-general |
On Sat, 2002-08-10 at 08:55, Nigel J. Andrews wrote: > I believe you are misunderstanding the suggestion. > > what happens if for your table without OID you define a column called oid with > a sequence attached? How is that different to using the OID column from a > table with OID? My application (will) runs on several sites, each site updating the main site each night, and each morning getting updates from all other sites via the main site. So if all goes well, each morning each site will start with essentially identical databases. Many tables in the database refer to transactions specific to one site or another. The primary key on these tables are inserted via a trigger, and are in the form of "location-sequence" so that this 46-23456 represents the primary key for location 46, sequence 23456 on that machine. I cant just use a sequence at each site otherwise I could end up with 46 identical primary keys (23456) refering to different data. I cant just make a OID sequence on each machine as this is teh same problem, and I only need to know the oid to retrieve the primary key from the row just inserted, after that I don't care about it at all... And inserts are nice enough to return teh OID of a just inserted row which is helpful. > And in a separate message you ask how will PostgreSQL identify data if OIDs are > removed from the system? Well doesn't the data identify the data? Doesnt' PostgreSQL use the OID's for it's own internal use? So that every item has a unique identifier for postgresql to play with, not necessarily the user) Thats what I thought but I really have know idea why or what they are for. -- * * Rob Brown-Bayliss *
В списке pgsql-general по дате отправления: