On Sun, 2011-07-03 at 19:23 +0100, Thom Brown wrote:
> [...]
> I noticed that altering sequences still uses the old ALTER TABLE
> syntax. While that's required for older versions, it's not anymore.
> Attached a patch to use most up-to-date syntax for each version. This
> is based on the previous newline patch having already been applied.
>
> Obviously this won't enable anything to work that didn't previously,
> but just thought it would be nice to use more suitable syntax.
>
Sure. But there is one big misunderstanding in your patch: OWNED BY and
OWNER TO are quite different beasts. The "OWNER TO" changes the
ownership of the sequence. IOW, a user is affected as owner of the
object. "OWNED BY" creates a link between a sequence and a table's
column. This is automatically done when you use the serial datatype.
It's quite important because it tells PostgreSQL to drop the sequence
when you want to drop the table.
Anyway, the patch in itself is interesting. I wasn't willing to write
it, but as you gave it to us, I commited it with some changes :)
Thanks again.
--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com