Skip site navigation (1) Skip section navigation (2)

renaming sequences ?

From: Jonathan Vanasco <postgres(at)2xlp(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: renaming sequences ?
Date: 2008-05-27 01:34:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
What is the correct way to rename a sequence?

I keep running into this bug:

Where "ALTER TABLE/SEQUENCE RENAME TO ____" will rename the sequence,  
but the 'sequence_name' attribute in 'select * from sequence' and (i  
believe) the pg catalog info will keep the original name

this creates an issue with most ORM software under python, perl, php  
which will pull the old sequence name.

the 'fix' i found is to just dump , drop, create and reload the  
database -- which works perfect on small databases.  but i'm left  
wondering what the correct fix is for medium/larger databases.


pgsql-general by date

Next:From: Mark NeelyDate: 2008-05-27 02:18:57
Subject: Open Source CRM - Options?
Previous:From: Tom LaneDate: 2008-05-27 00:36:10
Subject: Re: select query takes 13 seconds to run with index

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group