Setting Next Value in Sequence

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

Setting Next Value in Sequence

От:
"Tim Perdue" <perdue@raccoon.com>
Дата:
Maybe it's due to sleep deprivation, but this is not working. I'm trying to
update a seqence to a higher number, and it won't let me.

db_domain=> update seq_mailid set last_value=1375000;
ERROR:  You can't change sequence relation seq_mailid

My sense of humor has totally faded over the last two days, and I would
appreciate sone input.

Tim

Re: [SQL] Setting Next Value in Sequence

От:
Remigiusz Sokolowski <rems@gdansk.sprint.pl>
Дата:
> Maybe it's due to sleep deprivation, but this is not working. I'm trying to
> update a seqence to a higher number, and it won't let me.
> 
> db_domain=> update seq_mailid set last_value=1375000;
> ERROR:  You can't change sequence relation seq_mailid
> 
> My sense of humor has totally faded over the last two days, and I would
> appreciate sone input.

So, may be just drop sequence and create new one with start 1375000.
	Rem

-------------------------------------------------------------------*------------
Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *		
-----------------------------------------------------------------*****----------

Re: [SQL] Setting Next Value in Sequence

От:
Herouth Maoz <herouth@oumail.openu.ac.il>
Дата:
At 14:37 +0200 on 16/3/99, Tim Perdue wrote:


> Maybe it's due to sleep deprivation, but this is not working. I'm trying to
> update a seqence to a higher number, and it won't let me.
>
> db_domain=> update seq_mailid set last_value=1375000;
> ERROR:  You can't change sequence relation seq_mailid
>
> My sense of humor has totally faded over the last two days, and I would
> appreciate sone input.

Do you (or the user who is trying to do this) own the sequence? Do you have
the right access rights to it?

In any case, I always thought the best is to drop the sequence and create
it with a proper start number.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma


Re: [SQL] Setting Next Value in Sequence

От:
Patrik Kudo <kudo@partitur.se>
Дата:
Hi,

You can't manipulate the sequence that way. You can do the following
though:

select setval('seq_mailid', 1375000);

Hope that helps.

Regards,
Patrik Kudo

Tim Perdue wrote:
> 
> Maybe it's due to sleep deprivation, but this is not working. I'm trying to
> update a seqence to a higher number, and it won't let me.
> 
> db_domain=> update seq_mailid set last_value=1375000;
> ERROR:  You can't change sequence relation seq_mailid
> 
> My sense of humor has totally faded over the last two days, and I would
> appreciate sone input.
> 
> Tim
FAQ