> I've been using mysql too much lately.
> Can anyone tell me how to set up an auto increment in postgres? I need
> to select a row based on a user's menu selection. Requiring them to type
> in a text entry and get it right would obviously be pretty inefficient.

Either user a data type of 'serial' which will do all the thinking for you,
or create your own sequence and use that.
Serial does all the sequence creation for you and sets your primary key
field to have a default value of seq_name.nextval
Or when you insert use seq_name.nextval as the value of your primary key

That should do it, my postgres is a bit rusty tho.


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to