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:[EMAIL PROTECTED]]
Sent: Monday, October 22, 2001 2:36 AM
To: [EMAIL PROT
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
Try using SERIAL:
CREATE TABLE mytable (
MYID SERIAL,
name TEXT
);
It will auto create the sequences for you.
Cory Wright
[EMAIL PROTECTED]
http://www.southcarrollton.net/
On Mon, 22 Oct 2001, Arian Prins wrote:
> On Mon, 22 Oct 2001 12:06:21 +0530, "Mayuresh Kadu"
> <[EMAIL PROTECTED]>
On Mon, 22 Oct 2001 12:06:21 +0530, "Mayuresh Kadu"
<[EMAIL PROTECTED]> wrote:
>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
>
>
Try first creating a sequence and t
Check manual/user for details on 'sequences'.
Good luck.
-Message d'origine-
De : [EMAIL PROTECTED] <[EMAIL PROTECTED]>
À : GANESH KUMAR <[EMAIL PROTECTED]>
Cc : [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date : samedi 10 juin 2000 12:12
Objet : Re: [SQL] AUTO
On Sat, 10 Jun 2000, GANESH KUMAR wrote:
> i am searching for
> autoincrement in table
>
> in table employee
> i want give empno as autoincrement
create table xyz (id serial primary key);
check documentation what it really is:).
Marcin Mazurek
--
administrator
MULTINET SA o/Poznan
http://ww