Re: Automatic increment

From: GH <grasshacker(at)over-yonder(dot)net>
To: "Julio Cuz, Jr(dot)" <jcuz(at)rccd(dot)cc(dot)ca(dot)us>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: Automatic increment
Date: 2001-01-12 03:20:08
Message-ID: 20010111212008.A76801@over-yonder.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php pgsql-sql

On Thu, Jan 11, 2001 at 07:09:08PM -0800, some SMTP stream spewed forth:
> Hi--
>
> Some of you guys suggested to use the 'SERIAL' type for a field that needs
> to be AUTOMATICALLY INCREASED BY 1 by PGSQL without user intervention, but
> it doesn't seem to work. What am I doing wrong?

I know obviously not what query you are using, but here is an example:

create table example (col1 serial col2 <whatever>);
insert into example (col2) values ('whatever');
select * from example;

example
col1 | col2
-----+------------
1 | whatever

The initial value of a serial column is "1".

gh

>
> Julio Cuz, Jr.
> Riverside Community College
> jcuz(at)rccd(dot)cc(dot)ca(dot)us
>

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Stephen van Egmond 2001-01-12 03:22:05 Re: Automatic increment
Previous Message Julio Cuz, Jr. 2001-01-12 03:09:08 Automatic increment

Browse pgsql-sql by date

  From Date Subject
Next Message Stephen van Egmond 2001-01-12 03:22:05 Re: Automatic increment
Previous Message Julio Cuz, Jr. 2001-01-12 03:09:08 Automatic increment