bigserial coloumn

Поиск
Список
Период
Сортировка
Искать

bigserial coloumn

От:
"Surabhi Ahuja " <surabhi.ahuja@iiitb.ac.in>
Дата:

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

Re: bigserial coloumn

От:
Richard Huxton <dev@archonet.com>
Дата:
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

Re: bigserial coloumn

От:
Scott Marlowe <smarlowe@g2switchworks.com>
Дата:
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);
FAQ