From: Tom Lane <tgl@sss.pgh.pa.us>
To: Will LaShell <will@lashell.net>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Using oid with RServ w/ Postgresql 7.2
Date: Thu, 17 Oct 2002 21:55:14 -0400
Message-ID: <13546.1034906114@sss.pgh.pa.us> (raw)
In-Reply-To: <1034888522.3498.3.camel@lyric.ofsloans.com>
References: <1034888522.3498.3.camel@lyric.ofsloans.com>
Will LaShell <will@lashell.net> writes:
> My question would then be, are there any problems/reasons or hints with
> using the oid field as the field that the rserv trigger is set on?
> We will be using rserv in a production environment so I'm looking at
> this as not just an academic solution but a real world one.
This is risky for a long-lived database. Things will work fine until
the OID counter wraps around (ie, more than 4 billion rows inserted
into your database). After that you have a risk of OID collisions.
You can prevent the worst problems by installing a unique index on OID
on each replicated table; but then you may occasionally get unexpected
"duplicate key" errors.
My advice would be to add a serial8 column to each table and use that
as the replication primary key.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, will@lashell.net
Subject: Re: Using oid with RServ w/ Postgresql 7.2
In-Reply-To: <13546.1034906114@sss.pgh.pa.us>
References: <1034888522.3498.3.camel@lyric.ofsloans.com> <13546.1034906114@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox