Re: [HACKERS] Sequences....

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: clark(dot)evans(at)manhattanproject(dot)com (Clark Evans)
Cc: rbrad(at)hpb50023(dot)boi(dot)hp(dot)com, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Sequences....
Date: 1999-03-17 16:18:32
Message-ID: 199903171618.LAA10133@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Wow. Serious effort here.
>
> Ryan Bradetich wrote:
> > 1. Leave it as it is now. It works, just explain to
> > people that sequences and tables are seperate entities,
> > and the serial type is just a shortcut.
>
> I dislike this approach. It seems that it is hiding detail
> that is necessary for proper maintence. It isn't that
> hard to type in the code. IMHO, the shortcut causes more
> confusion that it helps. So, I propose a third option:
>
> 0. Remove the SERIAL construct.

When they create a serial, we tell them:

ltest=> create table testx(x serial);
NOTICE: CREATE TABLE will create implicit sequence testx_x_seq for
SERIAL column testx.x
NOTICE: CREATE TABLE/UNIQUE will create implicit index testx_x_key for
table testx
CREATE

So it is not so terrible to tell them they have to delete it when
finished. We could also add a column to pg_class which tells us this
sequence was auto-created from oid 12, and remove it when we delete a
table. Or, we could name just try to delete a sequence that has the
name of the table with _seq at the end.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-03-17 16:21:41 Re: [HACKERS] Modulo syntax
Previous Message D'Arcy J.M. Cain 1999-03-17 13:47:17 Re: [HACKERS] Problems with >2GB tables on Linux 2.0