Re: [HACKERS] SERIAL data type

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: "Billy G(dot) Allie" <Bill(dot)Allie(at)mug(dot)org>, Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] SERIAL data type
Date: 1998-09-12 06:09:41
Message-ID: 35FA1025.EF2C0AC1@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> o dropping a table including a serial data type does not drop the
> sequence corresponding to the table. This prevents re-creating the
> table. Do we have to remove the sequence by hand?

Yes, at the moment. I don't have specific plans to change/fix things for
v6.4, but might be possible. It would be OK if someone else wanted to
pick up the coding and carry it forward...

> 1. Explicit insertion into a serial column be dis-allowed.
> 2. If explicit insertion is allowed, then the sequence need to be set
> so the next implicit insertsion result in the last explicit
> insertion value + 1 being used
> Of these two options, I prefer #1.

I wonder if we can use the rewrite rules system to implement #1?

> Also, should we be able to specify a starting value for the sequence
> when the table is created? For example
> create table t (c text, i serial(1000));
> to set the starting value of the sequence to 1000.

There was some discussion of this and at least one person thought it was
an ugly feature (this is available on Sybase, right?). So I didn't even
try to implement it.

- Tom

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Keith Parks 1998-09-12 13:56:39 Exception in select IN with index
Previous Message Thomas G. Lockhart 1998-09-12 05:57:52 Re: [HACKERS] Serial Data Type