Re: Updated sequence syntax

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Thom Brown <thom(at)linux(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Updated sequence syntax
Date: 2011-07-03 21:40:08
Message-ID: 1309729208.2061.5.camel@laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

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

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Thom Brown 2011-07-03 21:45:08 Re: Updated sequence syntax
Previous Message Jasmin Dizdarevic 2011-07-03 21:39:16 Fwd: Discussion - Search Objects