Only declare the attribute 'b' as serial the first time. From then on, whenever you 
recreate table DATA just declare: b int default nextval('data_b_seq'::text)

cheers,
thalis


On Thu, 21 Jun 2001, Kostis Mentzelos wrote:

> Hi all,
> 
> I want to rename a table from DATA to 'unique' every month
> and then recreate table DATA. (a number of applications works
> with table DATA)
> 
> DATA contains among the others a SERIAL field. 
> 
> create table DATA (a int, b serial,...);
> 
> I tried ALTER TABLE DATA RENAME TO XXXX but
> when I recreate table DATA I get this error:
> relation 'data_b_seq' already exists.
> 
> Is there any way to rename sequences?
> Is it better to create the new table, copy 1.000.000 to the new
> table and then delete them from DATA and then VACCUM the
> database?
> 
> kostis.


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to