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

Re: BUG #4582: Renaming sequences and default value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jan-Peter Seifert" <jan-peter(dot)seifert(at)gmx(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4582: Renaming sequences and default value
Date: 2008-12-15 18:52:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
"Jan-Peter Seifert" <jan-peter(dot)seifert(at)gmx(dot)de> writes:
> there's a problem with renaming sequences in our databases.

I don't think there's really a problem here.  You've apparently got some
obsolete syntax in your CREATE commands:

>   id integer NOT NULL DEFAULT nextval(('public.t2_id_seq'::text)::regclass)

This specifically says that 'public.t2_id_seq' is a string (text) constant,
which is not going to change in response to anything.  If you would
like it to track renamings of the sequence then it needs to be a
regclass constant:

    id integer NOT NULL DEFAULT nextval('public.t2_id_seq'::regclass)

Also, neither of these forms will by itself establish an OWNED BY
relationship --- you'll need a separate ALTER SEQUENCE OWNED BY
command if you want that.

If that doesn't help, you'll need to be a lot more specific about the
actions you took.

			regards, tom lane

In response to


pgsql-bugs by date

Next:From: Bruce MomjianDate: 2008-12-16 03:34:41
Subject: Re: BUG #4027: backslash escaping not disabled in plpgsql
Previous:From: Jan-Peter SeifertDate: 2008-12-15 17:14:00
Subject: BUG #4582: Renaming sequences and default value

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