Re: Notes about int8 sequences

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: thomas(at)pgsql(dot)com
Cc: "Roderick A(dot) Anderson" <raanders(at)tincan(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Notes about int8 sequences
Date: 2001-08-07 00:32:45
Message-ID: 26459.997144365@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu> writes:
> Hmm. How far away are we from doing SERIAL in a way that you find more
> acceptable than the current technique of mucking around internally with
> sequences and default values?

I'd say "won't happen for 7.2", whereas it seems like changing sequences
to use int8 is something that could get done this month.

A true SERIAL type is something that we should think about along with
per-table OID generation, since they have essentially the same
requirement: a lightweight sequence generator. Our present approach of
a one-row table to represent a sequence is not sufficiently lightweight,
IMHO, either from an implementation or a conceptual viewpoint. (In
particular, it requires each sequence to have a unique name taken from
the table namespace, whereas for both table OIDs and serial columns
I think we'd much prefer the sequences to be anonymous ... or at least
in a different namespace. But how do we change that without breaking a
lot of existing application code?)

Offhand I don't see that adding a SERIAL8 type to the mix (or just
changing SERIAL to be int8) would make this any harder or easier.
The underlying implementation is exposed just as much as before,
but not any more so.

> If we do blast ahead with a SERIAL8, then we should consider
> implementing a SERIAL4 and then aliasing SERIAL to one or the other (can
> be done in the parser as you know).

Sure, that'd be a reasonable way to set it up, if we decide to have two
SERIAL types.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-08-07 01:41:48 Planned change in initdb-time OID allocation
Previous Message Tom Lane 2001-08-07 00:14:06 Re: [GENERAL] Re: user guide