CREATE TABLE glitch -fix request for 7.2 - Mailing list pgsql-sql

From Josh Berkus
Subject CREATE TABLE glitch -fix request for 7.2
Date
Msg-id web-600816@davinci.ethosmedia.com
Whole thread Raw
Responses Re: CREATE TABLE glitch -fix request for 7.2
Re: CREATE TABLE glitch -fix request for 7.2
List pgsql-sql
Tom, Peter, Stephan, et al.:

Here's a glitch that's bothered me for a while (ver 7.0 -> 7.2b4 ) inPostgreSQL DDL statements.  I was thinking that
since7.2 is still in beta,that you could fix it this version.
 

To produce the glitch:
1. Create a SQL script file that drops a table, then creates that table with aSERIAL primary key (I do this all the
timeto build my databases)
 
2. Run the script once to create the table.  You'll get a error (no table todrop) but that doesn't matter.
3. Run the script a second time, as if you were making changes to the datastructure and needed to rebuild.  
4. You will get an error telling you that "table1_id_seq" already exists, andthe CREATE TABLE statement will fail.

This is very user-unfriendly behaviour, especially in a database that stilldoes not support about 50% of ALTER TABLE.
Ispend a fair amount of extratime deleting SERIAL sequences when I am doing the database-building part ofthe
developmentprocess.
 

Can we change this behavior, please?  I'd suppose that it would require you tocreate some sort of permanent link
betweenSERIAL columns and the sequencesthey spawn.
 

-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: "steve boyle"
Date:
Subject: Re: Retrieving information from System Tables
Next
From: Tom Lane
Date:
Subject: Re: CREATE TABLE glitch -fix request for 7.2