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

From Hannu Krosing
Subject Re: Is a SERIAL column a "black box", or not?
Date
Msg-id 1146393757.3785.2.camel@localhost.localdomain
Whole thread Raw
In response to Re: Is a SERIAL column a "black box", or not?  (mark@mark.mielke.cc)
Responses Re: Is a SERIAL column a "black box", or not?  (mark@mark.mielke.cc)
Re: Is a SERIAL column a "black box", or not?  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-hackers
Ühel kenal päeval, L, 2006-04-29 kell 19:41, kirjutas
mark@mark.mielke.cc:
> On Sat, Apr 29, 2006 at 05:54:19PM -0400, Tom Lane wrote:
> > In short, I think there's a reasonably good case to be made for losing the
> > hidden dependency and re-adopting the viewpoint that saying SERIAL is
> > *exactly* the same as making a sequence and then making a default
> > expression that uses the sequence.  Nothing behind the curtain.
> > 
> > Comments, other opinions?
> 
> I find it user-unfriendly that I must grant select/update to the
> SERIAL, separate than from the table. I don't really see anything
> friendly about treating the object as separate.

just define nextval() as SECURITY DEFINER 

> I do see the benefits with regard to simplified implementation, and
> flexibility.
> 
> As a compromise, I could see either choice being correct. I don't
> see either direction as being both user friendly and simple.

You can be user friendly and simple only if the user wants to do simple
things, or if you can exactly predict what a user wants, else you have
to grant some power to the user, and that involves complexity or at
least a learning curve.

-------------
Hannu



pgsql-hackers by date:

Previous
From: Thomas Hallgren
Date:
Subject: Re: Is a SERIAL column a "black box", or not?
Next
From: Thomas Hallgren
Date:
Subject: Finding the correct type