Re: Dump serials as serial -- not a sequence

From: Rod Taylor <rbt(at)zort(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Dump serials as serial -- not a sequence
Date: 2002-08-17 20:27:19
Message-ID: 1029616039.37296.27.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


> The "serial primary key" hack in analyze.c does make that a bit ugly,
> but one simple answer is not to try to dump as a serial if there's a
> primary key on the column.

> A radical answer to that is to get rid of the implied UNIQUE constraint
> associated with SERIAL, thus making the combinations "serial unique" and
> "serial primary key" actually mean something. I fear this won't fly :-(

My serials are almost always primary key's. Wouldn't change anything in
that regard.

Docs suggest that UNIQUE and NOT NULL be applied to the column anyway.
http://www7.us.postgresql.org/users-lounge/docs/7.2/postgres/datatype.html#D

I'll see what others do.

> but it might be worth proposing. If we have to maintain backwards
> compatibility, perhaps pg_dump could DROP the unique constraint just
> after making the table, and re-create it (possibly as a primary key
> rather than plain unique) when it makes indexes.

This seems really ugly, but would do the trick.

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-08-17 23:53:26 Re: updated lock listing patch
Previous Message Tom Lane 2002-08-17 20:14:30 Re: updated lock listing patch