Re: Is a SERIAL column a "black box", or not? - Mailing list pgsql-hackers

From mark@mark.mielke.cc
Subject Re: Is a SERIAL column a "black box", or not?
Date
Msg-id 20060430132130.GB15373@mark.mielke.cc
Whole thread Raw
In response to Re: Is a SERIAL column a "black box", or not?  ("Magnus Hagander" <mha@sollentuna.net>)
List pgsql-hackers
On Sun, Apr 30, 2006 at 11:06:05AM +0200, Magnus Hagander wrote:
> If it's not obvious yet :-P, I'd be in favour of having SERIAL as
> black-box as possible, and then just use manual CREATE SEQUENCE and
> DEFAULT nextval() for when you need a more advanced case. But that's as
> seen from a user perspective, without regard for backend complexity.

That's where I sit as well.

SERIAL as a macro has no value to me. I'd rather write it out in full,
and make it obvious to the caller, what I'm doing. This way, I get to
choose the sequence name instead of having it generated for me, and
the GRANT expression makes more sense.

If SERIAL generated an 'anonymous' SEQUENCE, that was a real black
box, that had the same permissions as the table, I'd be tempted to use
it again.

I also see the db_dump example as proving more that the box isn't
black enough, than proving that the black box approach is wrong.

Cheers,
mark

-- 
mark@mielke.cc / markm@ncf.ca / markm@nortel.com     __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada
 One ring to rule them all, one ring to find them, one ring to bring them all                      and in the darkness
bindthem...
 
                          http://mark.mielke.cc/



pgsql-hackers by date:

Previous
From: mark@mark.mielke.cc
Date:
Subject: Re: Is a SERIAL column a "black box", or not?
Next
From: Heikki Linnakangas
Date:
Subject: Re: Constraint Exclusion + Joins?