Re: ALTER SEQUENCE - Mailing list pgsql-general

From Bruce Momjian
Subject Re: ALTER SEQUENCE
Date
Msg-id 200605172146.k4HLkde17423@candle.pha.pa.us
Whole thread Raw
In response to Re: ALTER SEQUENCE  (Don Y <pgsql@DakotaCom.Net>)
Responses Re: ALTER SEQUENCE  (Don Y <pgsql@DakotaCom.Net>)
List pgsql-general
Don Y wrote:
> Bruce Momjian wrote:
> > Don Y wrote:
> >> Hi,
> >>
> >> It doesn't appear that there is a way to rename a sequence
> >> (ideally with a "cascade" action).
> >
> >
> > Uh, the ALTER SEQUENCE manual page says:
>
> Uh, the 8.0.3 man page for ALTER SEQUENCE makes no mention of this.
> Nor does "\h ALTER SEQUENCE" in psql yield any pointers.
>
> >        Some variants of ALTER TABLE can be used with sequences as
> >        well; for example, to rename a sequence  use  ALTER  TABLE
> >        RENAME.
> >
> > Does that help?
>
> Sure!  It appears to allow both the rename and change of ownership.
> Thanks!

I see the documentation mention added August 1, 2005 byt Tom Lane.

> Obviously, the documentation doesn't agree with the code  :-(
>
> But, it still leaves unanswered the question of the risk involved
> in just changing the name/owner in the system tables...

It is best to use ALTER.  The only other sure-safe way to do it is to
look at the ALTER code and do the same things with the system tables.
However, in most cases a system table modification works fine, but I
don't recommend it for production servers.

--
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

pgsql-general by date:

Previous
From: Don Y
Date:
Subject: Re: ALTER SEQUENCE
Next
From: Emi Lu
Date:
Subject: Re: RES: Add column and specify the column position in