Home > Archive > PostgreSQL Discussion > May 2005 > bigserial coloumn









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author bigserial coloumn
Surabhi Ahuja

2005-05-24, 3:23 am


I have a table in which one attribute "id" is a bigserial

when i say
select setval('table_id_seq
', 0);
it says: values 0 is out of bounds.
what should i do?

Regards
Surabhi Ahuja

Richard Huxton

2005-05-24, 3:23 am

Surabhi Ahuja wrote:
> I have a table in which one attribute "id" is a bigserial
>
> when i say
> select setval('table_id_seq
', 0);
> it says: values 0 is out of bounds.
> what should i do?


Try a "SELECT * FROM table_id_seq" and see what it's min_value is - I'm
guessing it's set to 1.

HTH
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Scott Marlowe

2005-05-24, 9:23 am

On Tue, 2005-05-24 at 00:13, Surabhi Ahuja wrote:
> I have a table in which one attribute "id" is a bigserial
>
> when i say
> select setval('table_id_seq
', 0);
> it says: values 0 is out of bounds.
> what should i do?


IS that what you really want, or do you just want the first assignment
to be a 1?

If so, then just do setval('table_id_seq
', 1, FALSE);

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com