Re: [PHP-DB] Postgres auto increment.
Since it seems you are new to PostgreSQL, you might not know about RULE in PostgreSQL. You can easily log/protect database with RULE. (At database level, of course) If you are interested, I've posted several tips for NEW PostgreSQL users at http://www.zend.com/tips/tips.php?CID=119 Hope this helps. -- Yasuo Ohgaki "John Starkey" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... 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. Thanks, John -- 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] -- 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]
[PHP-DB] Postgres auto increment.
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. Thanks, John -- 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]
Re: [PHP-DB] Postgres auto increment.
Just off the top of my head...so please forgive any typos or blatant mistakes... CREATE SEQUENCE sequencename; CREATE TABLE mytable ( id int DEFAULT NEXTVAL('sequencename'), whatever varchar(32), PRIMARY KEY(id) ); Doug At 11:28 PM 4/13/01 -0600, John Starkey wrote: 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. Thanks, John -- 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]