Re: Updated sequence syntax

From: Thom Brown <thom(at)linux(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Updated sequence syntax
Date: 2011-07-03 21:45:08
Message-ID: CAA-aLv7Pf3JQK_LC=72oxh-GaBEORfswdVg+ij+uPo9geYKWeQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On 3 July 2011 22:40, Guillaume Lelarge <guillaume(at)lelarge(dot)info> wrote:
> 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 :)

The moment you mentioned there being a distinction between OWNED BY
and OWNER to, I immediately knew what you meant. Thanks. :)

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2011-07-04 07:10:36 Re: Fwd: Discussion - Search Objects
Previous Message Guillaume Lelarge 2011-07-03 21:40:08 Re: Updated sequence syntax