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

ALTER TABLE .. OWNER TO and sequences

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: ALTER TABLE .. OWNER TO and sequences
Date: 2004-09-22 19:14:27
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches

Here is a patch regarding ALTER TABLE ... OWNER and the sequences that
were created by a SERIAL column.

It uses pg_depend to find SERIAL sequences, and recurses the ChangeOwner
to them.  Additionally, it forbids directly changing the owner of a
SERIAL sequence (the error message of this last action needs to be

I also added some regression tests for ALTER TABLE ... OWNER, because
previously there wasn't any.

According to my testing, this fixes the issue with pg_dump not restoring
the ownership of SERIAL sequences and the annoyance of having to alter
the sequence manually (the principle of least surprise indicates that
the sequence should be altered automatically).

Please review.

Alvaro Herrera (<alvherre[a]>)
"Now I have my system running, not a byte was off the shelf;
It rarely breaks and when it does I fix the code myself.
It's stable, clean and elegant, and lightning fast as well,
And it doesn't cost a nickel, so Bill Gates can go to hell."


pgsql-patches by date

Next:From: Andrew DunstanDate: 2004-09-22 21:38:48
Subject: Re: pg_hba.conf additional comment re local line
Previous:From: Tom LaneDate: 2004-09-22 19:00:35
Subject: Re: [PERFORM] 7.4 vs 7.3 ( hash join issue )

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