Re: WIP -- renaming implicit sequences - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: WIP -- renaming implicit sequences
Date
Msg-id CADLWmXWLnzSc2xAdNLDjq7nBDMfVtH+GAjehw21WT1YmRhQ66w@mail.gmail.com
Whole thread Raw
In response to Re: WIP -- renaming implicit sequences  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 12 January 2012 00:58, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <munro@ip9.org> writes:
>> Here is an unfinished patch to implement something which appears on
>> the TODO list under ALTER: automatic renaming of sequences created
>> with serial when the table and column names change.  I've often wanted
>> this feature and it seemed like a good starter project.
>
> Hmm ... this seems a bit inconsistent with the fact that we got rid of
> automatic renaming of indexes a year or three back.  Won't renaming of
> serials have all the same problems that caused us to give up on renaming
> indexes?

Ah.  I assume this is it:

http://archives.postgresql.org/pgsql-committers/2009-12/msg00209.php

I used ChooseRelationName to generate a new unique name during
transformation.  Presumably the implicit ALTER SEQUENCE will fail at
execution if someone manages to nab the name after
ChooseRelationName's get_relname_relid check.

So with the patch, ALTER TABLE RENAME with serial columns has the same
concurrency caveat as CREATE TABLE with serial columns, which I hoped
was reasonable or at least symmetrical.


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: measuring spinning
Next
From: Tom Lane
Date:
Subject: rewriteheap.c bug: toast rows don't get XIDs matching their parents