Page 1 of 1

[SOLVED] ADOBD : creating a database : sequence or auto-increment ?

Posted: Tue May 11, 2010 12:55 pm
by redwarp
Should I rather use :

Code: Select all

$flds = "
	ipwatch_id I AUTOINCREMENT PRIMARY,
	(...)
";
OR

Code: Select all

$flds = "
	ipwatch_id I KEY,
	(...)
";
(...)
$db->CreateSequence(cms_db_prefix().'module_iplock_watch_seq');
The first one looks easier to use to me, so what's the catch ?

Thanks in advance.
--
Redwarp

Re: ADOBD : creating a database : sequence or auto-increment ?

Posted: Tue May 11, 2010 1:23 pm
by redwarp
PS : I read that squences were important because of certain db that don't support auto increment, but I also heard that cms made simple didn't support them anymore, so... I'm basically lost !

Re: ADOBD : creating a database : sequence or auto-increment ?

Posted: Tue May 11, 2010 2:09 pm
by calguy1000
Sequence tables were used because common versions of postgres didn't support auto increment fields back in the day when CMSMS was started.

We're not using sequence tables on any new development now.

Re: ADOBD : creating a database : sequence or auto-increment ?

Posted: Tue May 11, 2010 2:11 pm
by redwarp
Thanks !
Then I'll modify my code. It's gonna be a lot easier !