[Bucardo-general] private key vs. unique index

Marc Farnum Rendino mvgfr1 at gmail.com
Fri Apr 15 17:59:56 UTC 2011


Joshua -

In my case, users will not have an opportunity to access let alone
modify this column, so that's perfect; thanks!

However, a thought just occurred to me: I came into this, presuming
that a unique index is simpler/cheaper than a private key - is this
true?

Since I could use either, I should probably use the better one from
the start. :)

Thanks,

Marc

On Fri, Apr 15, 2011 at 12:26 PM, Joshua Tolley <josh at endpoint.com> wrote:
> Defining columns as the SERIAL (or, if you expect more than 2 billion of them,
> BIGSERIAL) pseudo-datatype is a common method:
>
>    ALTER TABLE foo ADD bar SERIAL UNIQUE NOT NULL;
>
> The SERIAL pseudo-types create a column with INTEGER or BIGINTEGER type along
> with a sequence object, and then set the column's default value to that
> sequence, which should suffice if you have well-behaved users...


More information about the Bucardo-general mailing list