Thread: Auto Increment

Auto Increment

From
"Mayuresh Kadu"
Date:
hi all,

could anyone tell me how to make a primary key to AUTO INCREMENT. The
document is not exactly very explainatory about it :)

Thankx in advance ...



Mayuresh




Re: Auto Increment

From
"Josh Berkus"
Date:
Mayuresh,

First, beginner's questions belong on the PGSQL-NOVICE list.

> could anyone tell me how to make a primary key to AUTO INCREMENT. The
> document is not exactly very explainatory about it :)

No, it is quite clear.  See:
http://www.postgresql.org/idocs/index.php?datatype.html
section 3.1.1

I can't imagine how it would be more clear.

-Josh



______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


Re: Auto Increment

From
Joe Barrero
Date:
create table mytable (
myfield serial primary key,
myotherfield integer);

Using the SERIAL data type automatically creates the sequence and default
statements for you.

-----Original Message-----
From: Mayuresh Kadu [mailto:mayureshk@aftek.com]
Sent: Monday, October 22, 2001 2:36 AM
To: pgsql-sql@postgresql.org
Subject: [SQL] Auto Increment

hi all,

could anyone tell me how to make a primary key to AUTO INCREMENT. The
document is not exactly very explainatory about it :)

Thankx in advance ...



Mayuresh



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly