Re: Postgres auto increment.
| From: | Doug Semig | Date: | Sat, 14 Apr 2001 06:17:08 +0000 |
| Subject: | Re: Postgres auto increment. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8557@lists.php.net to get a copy of this message | ||
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