pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: CREATE TABLE glitch -fix request for 7.2
Date: Mon, 14 Jan 2002 13:07:57 -0500 (EST)
Message-ID: <200201141807.g0EI7v313637@candle.pha.pa.us> (raw)
In-Reply-To: <web-600816@davinci.ethosmedia.com>

Josh Berkus wrote:
> Tom, Peter, Stephan, et al.:
> 
> Here's a glitch that's bothered me for a while (ver 7.0 -> 7.2b4 ) in
>  PostgreSQL DDL statements.  I was thinking that since 7.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 a
>  SERIAL primary key (I do this all the time to build my databases)
> 2. Run the script once to create the table.  You'll get a error (no table to
>  drop) but that doesn't matter.
> 3. Run the script a second time, as if you were making changes to the data
>  structure and needed to rebuild.  
> 4. You will get an error telling you that "table1_id_seq" already exists, and
>  the CREATE TABLE statement will fail.
> 
> This is very user-unfriendly behaviour, especially in a database that still
>  does not support about 50% of ALTER TABLE.  I spend a fair amount of extra
>  time deleting SERIAL sequences when I am doing the database-building part of
>  the development process.
> 
> Can we change this behavior, please?  I'd suppose that it would require you to
>  create some sort of permanent link between SERIAL columns and the sequences
>  they spawn.

We need pg_depend table to track dependency of sequence on specific
tables, hopefully in >=7.3.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



view thread (5+ messages)  latest in thread

Message-ID: <200201141807.g0EI7v313637@candle.pha.pa.us>
Permalink:  ../200201141807.g0EI7v313637@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200201141807.g0EI7v313637@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pgman@candle.pha.pa.us, josh@agliodbs.com
  Subject: Re: CREATE TABLE glitch -fix request for 7.2
  In-Reply-To: <200201141807.g0EI7v313637@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox