serial type

Started by Jose' Soaresabout 27 years ago2 messages
#1Jose' Soares
jose@sferacarta.com

Hi all,

I don't know if this was alredy reported, if so, please forget it.
I created a table with a serial data type and PostgreSQL creates an
implicit sequence,
then I droped the table but the sequence is already there, if I try to
re-create
the same table PostgreSQL refuse to do that...

prova=> create table a (i int, s smallint, c serial);
NOTICE: CREATE TABLE will create implicit sequence a_c_seq for SERIAL
column a.c
NOTICE: CREATE TABLE/UNIQUE will create implicit index a_c_key for
table a
CREATE
prova=> drop table a;
DROP
prova=> create table a (i int, s smallint, c serial);
NOTICE: CREATE TABLE will create implicit sequence a_c_seq for SERIAL
column a.c
NOTICE: CREATE TABLE/UNIQUE will create implicit index a_c_key for
table a
ERROR: a_c_seq relation already exists

Jose'

#2Thomas G. Lockhart
lockhart@alumni.caltech.edu
In reply to: Jose' Soares (#1)
Re: [HACKERS] serial type

I don't know if this was alredy reported, if so, please forget it.
I created a table with a serial data type and PostgreSQL creates an
implicit sequence,
then I droped the table but the sequence is already there, if I try to
re-create
the same table PostgreSQL refuse to do that...

Yes, it is a known feature for v6.4, and is in the docs (which doesn't
make it right, of course :)

Hopefully we will merge this with other improvements for v6.5 and get it
better then.

- Tom