>
> Hi,
>
> I have run into a problem dropping and re-creating tables with
> type SERIAL:
>
> CREATE TABLE t ( s SERIAL);
> DROP TABLE t;
> CREATE TABLE t ( s SERIAL);
>
> gives
> ERROR: t_s_seq relation already exists
>
> This looks like the implicitly created sequence t_s_seq is not dropped
> together with the table.
>
> I am running a current (?) cvs snapshot from anoncvs@postgresql.org.
>
> Jan
>
>
Yepp. The serial type is implemented as an integer with a
default of nextval('tab_attr_seq') and the sequence itself
created on the fly.
I think we should have an additional oid field in
pg_attribute that holds the oid of the created sequence and
that is examined at drop table time to drop the serials too.
TODO for v6.5 ?
Jan :-)
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck@debis.com (Jan Wieck) #