Page 1 of 1

Use of GenID() function

Posted: Thu Nov 18, 2010 5:57 pm
by nervino
Hi All,
I've noticed for a long time that modules use the GenID() function to pick up a new ID for a new item to be inserted in db.
Why? An auto-increment db field wouldn't be better?

Thanks for clarification

Re: Use of GenID() function

Posted: Thu Nov 18, 2010 6:04 pm
by calguy1000
This is a historical thing.

Back when these modules were originally written, postgres did not support auto-increment fields.  Therefore a 'sequence' table had to be used.

But that problem is now solved, and most new development uses auto increment fields.

However, for compatibility reasons, and because 'if it aint broke don't fix it'.  we aren't going back to remove this stuff from existing code.

Re: Use of GenID() function

Posted: Thu Nov 18, 2010 6:08 pm
by nervino
I see.

Thank you!