Search Postgresql Archives

Re: serial

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 4, 2008 at 7:47 AM, Gregory Williamson
<Gregory.Williamson@xxxxxxxxxxxxxxxx> wrote:
> The esteemed Scott Marlowe said:
>
>>
>> On Thu, Dec 4, 2008 at 7:42 AM, Gustavo Rosso <grosso@xxxxxxxxxxxxx>
>> wrote:
>> > I created this table:
>> >
> <...>
>>
>> Because MySQL taught you bad habits?  You told the db to insert a 0,
>> so it inserted a 0.
>
> With respect, sir, let me point out that Informix usage says to insert a
> zero to trigger a serial column, so don't be indicting Gustavo on MySQL use
> -- he might be coming from a real database where usage is different.

I really shoulda had a smiley up there with my comment.  However, mea
cupla, mea maxima culpa.

Note that it is quite possible to learn bad habits from many
commercial databases, not just MySQL.  Like an Oracle DBA who told me
pgsql was broken because the output of group by wasn't properly
ordered like it was on Oracle 9.  Admittedly, MySQL has a much larger
set of bad habits to teach the average user than any other DB, but it
ain't the only one.

> Those of us who came to postgres from Informix-land made [perhaps] the same
> mistakes. Not a bad *habit* unless you can prove to me that the spec says
> otherwise.

I'm pretty sure that if you say to insert a value, the spec says that
the value should be inserted unaltered.  0 is a value.  DEFAULT, or
leaving it out of the column list is a different thing entirely.

> (Maybe you can -- the SQL formal definitions seem to be
> deliberately opaque and often do not define _how_ a given behavior should be
> implemented). Just a matter of indoctrination into the local ways of doing
> serials.

True++.  The sql spec is usually quite simple, but in some areas it's
worse than the tax code.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux