Re: database abstraction layer
| From: | Jochem Maas | Date: | Wed, 03 Feb 2010 04:49:50 +0000 |
| Subject: | Re: database abstraction layer | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-301778@lists.php.net to get a copy of this message | ||
Op 2/3/10 12:19 AM, Ashley Sheridan schreef:
> On Wed, 2010-02-03 at 00:21 +0100, Rene Veerman wrote:
>
>> the auto_increment sytnax is not uniform across servers, is it?
>>
>> On Wed, Feb 3, 2010 at 12:11 AM, Ashley Sheridan
>> <ash@ashleysheridan.co.uk>wrote:
>>
>>> I saw it happen on a site that was getting only about 3000 hits a day. It
>>> just takes the right combination of circumstances and it all goes pear
>>> shaped. You really should get out of the habit of doing it.
>>>
>
>
> It is a MySQL only function. MSSQL has @@IDENTITY, not sure how other
> engines implement it.
firebird does it via what they call 'generators', 2 seconds of searching
shows postgres has this:
CREATE TABLE tableName (
id serial PRIMARY KEY,
name varchar(50) UNIQUE NOT NULL,
dateCreated timestamp DEFAULT current_timestamp
);
you can bet you ass that every other DB out there that's worth it's salt
has atomic id incrementor functionality exposed in some way or other.
@Rene: all that talk of maxId functions and random retries etc, etc, is complete pooh.
don't do it, **please** use the proper tools provided by the DB in question.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>