[development] Why do we avoid auto-incrementing db columns?
Amr Mostafa
amr.mostafa at gmail.com
Wed Apr 25 15:20:30 UTC 2007
I believe one of the reasons is that many times you want to know the ID of
your new record. For example, you inserted a new file to the 'files' table,
and you would like to store a reference to it in your xyz table.
For mysql there is mysql_insert_id(), but not for others.
On 4/25/07, Syscrusher <syscrusher at 4th.com> wrote:
>
> On Wednesday 25 April 2007 10:29, Ezra B. Gildesgame wrote:
> > I happened to discuss this with Greg Knaddison yesterday.
> > MySQL 4 does not support auto-incrementing columns.
>
> I must respectfully disagree. I happened to have a copy of the MySQL
> reference book from version 3.22 sitting on my bookshelf, and
> AUTO_INCREMENT
> was supported even then. :-) Never mind the question of why I still have
> such
> an old book....
>
> I also checked a PostgreSQL reference book, and they offer a SERIAL
> column type that works very similarly to the AUTO_INCREMENT in MySQL. I
> don't
> know how far back this support goes; my book is for PG version 8.somethingand
> was copyright 2006.
>
> I can't comment on the Microsoft SQL Server implementation of this, if
> any,
> because I don't have any manual for that here.
>
> Scott
>
> --
>
> -------------------------------------------------------------------------------
> Syscrusher (Scott Courtney) Drupal page:
> http://drupal.org/user/9184
> syscrusher at 4th dot com Home page: http://4th.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070425/ba0bd69f/attachment-0001.htm
More information about the development
mailing list