From: | Svenne Krap <svenne(at)krap(dot)dk> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Re: Is a SERIAL column a "black box", or not? |
Date: | 2006-04-30 09:45:14 |
Message-ID: | 4454872A.7030004@krap.dk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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.
>
I speak more as a user than a hacker, but I do still lurk here ;)
The way sequences are handled is imho one of the strongest features. The
possiblity to query nextval is bordering on divine.
I have however stopped using serials for anything else than quick mockup
examples. The work of defining the sequence itself and setting acl's is
imho trivial compared to consistency.
I would actually suggest throwing a warning, that sequences are the
proper way of doing it when people use serials - maybe even mark
serial-types as obsolete in the docs.
I strongly subscribe to the principle of least astonishment, and that
means either pure sequences, a mysqlesqe auto_increment or both - but I
fail to see, how the "macro"thing serial will ever work that way. It
goes without saying, that I dislike auto_increment.
Svenne
From | Date | Subject | |
---|---|---|---|
Next Message | Martijn van Oosterhout | 2006-04-30 10:28:50 | Re: Is a SERIAL column a "black box", or not? |
Previous Message | Magnus Hagander | 2006-04-30 09:06:05 | Re: Is a SERIAL column a "black box", or not? |