Re: [HACKERS] Sequences....

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ryan Bradetich <rbrad(at)hpb50023(dot)boi(dot)hp(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Sequences....
Date: 1999-03-16 03:45:47
Message-ID: 14967.921555947@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

BTW, has anyone thought twice about the interaction of SERIAL columns
with inheritance? If I create a table having a SERIAL column and then
create a child table that inherits from the first, what happens? Does
the child share the use of the parent's sequence (implying that serial
number assignments are unique across the parent and all its children)?
Or does the child get a new sequence object of its very own --- and if
so, what does that sequence object start out at?

We ought to find out what the current code actually does and then think
about whether we like it or not; I'll bet that the current behavior was
not designed but just fell out of the implementation.

If we do want shared use of a parent's sequence, that's going to
complicate Ryan's new system table considerably --- probably it needs
to have a row for each table using a particular sequence-created-to-
implement-SERIAL, and the sequence object can be deleted only when the
last reference to it goes away. Life may become even more interesting
for pg_dump, too.

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 1999-03-16 03:59:02 Re: [HACKERS] HTML index of source code
Previous Message Tom Lane 1999-03-16 03:33:52 Re: [HACKERS] Re: [GENERAL] Bug with sequences in 6.4.2