Re: serial column - Mailing list pgsql-general

From Bob Pawley
Subject Re: serial column
Date
Msg-id 006201c6e01f$13faf660$8e904618@owner
Whole thread Raw
In response to serial column  (Bob Pawley <rjpawley@shaw.ca>)
Responses Re: serial column
List pgsql-general
Yes

But the only way of insuring that the serial starts at 1 and is sequential
is to recreate the table.

I've tried creating and dropping the table but this generates other issues
which I haven't been able to resolve.

Bob

----- Original Message -----
From: "Gevik Babakhani" <pgdev@xs4all.nl>
To: "Bob Pawley" <rjpawley@shaw.ca>
Cc: "Postgresql" <pgsql-general@postgresql.org>
Sent: Sunday, September 24, 2006 2:00 PM
Subject: Re: [GENERAL] serial column


> On Sun, 2006-09-24 at 13:50 -0700, Bob Pawley wrote:
>> I need to develop a serial column that always starts at 1 and is
>> sequential even after deletes.
>>
>> Any ideas???
>>
>
> Did you try the:
>
> create table tbl
> (
> id SERIAL
> );
>
> or even with primary key...
>
> create table tbl
> (
> id SERIAL primary key
> );
>
>
> --
> Regards,
> Gevik Babakhani
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
>

pgsql-general by date:

Previous
From: "Johan"
Date:
Subject: Re: column names in select don't exists in insert to
Next
From: Ragnar
Date:
Subject: Re: serial column