Re: 1.8-Beta5 Bug: sequence properties dialog produces wrong sql statement order

Поиск
Список
Период
Сортировка
От Horvath Gabor
Тема Re: 1.8-Beta5 Bug: sequence properties dialog produces wrong sql statement order
Дата
Msg-id 7ccab0fb0710170159m12122641ga4fc93312e4eef45@mail.gmail.com
обсуждение исходный текст
Ответ на Re: 1.8-Beta5 Bug: sequence properties dialog produces wrong sql statement order  (Dave Page <dpage@postgresql.org>)
Ответы Re: 1.8-Beta5 Bug: sequence properties dialog produces wrong sql statement order  (Guillaume Lelarge <guillaume@lelarge.info>)
Re: 1.8-Beta5 Bug: sequence properties dialog produces wrong sql statement order  (Dave Page <dpage@postgresql.org>)
Список pgadmin-support
On 9/24/07, Dave Page <dpage@postgresql.org> wrote:
> Horvath Gabor wrote:
> > pgAdminIII v1.8-Beta5
> > Windows XP
> > PostgreSQL 8.1, linux
> >
> > I tried to adjust the Minimum value in the properties dialog of a sequence.
> > I wanted to adjust the range so that the present current value would
> > have fallen out of it, so I changed the current value too.
> > ...In vain, because the SQL batch composed by the dialog shows that
> > the ALTER SEQUENCE ... MINVALUE .... statement comes first, and the
> > SELECT setval(....) comes only after that.
> > As expected, an error message popped up saying the minimum can't be
> > higher than the current value when I pressed OK.
>
> Thanks, fixed in SVN.

Thanks!
I tried it in v1.8.0 RC1. Now the two statements are in reverse order
(setval first, then alter sequence), but it is still not working right
for the cases I sketched as follows:

Minvalue: 1 --> 100
Current value: 5 --> 500
Maxvalue: 10 --> 900

In this case, we need three SQL statements:
alter sequence my_seq maxvalue 900;
select setval('my_schema.my_seq', 500, true);
alter sequence my_seq minvalue 100;

I guess the general ordering of the statements should be as follows:
1 Any ALTER SEQUENCE MIN/MAXVALUE statements that widen the range
2 SETVAL
3 Any ALTER SEQUENCE MIN/MAXVALUE statements that narrow the range.

Regards,

Gábor.


В списке pgadmin-support по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: pgAdmin 1.8RC1 - failed to launch on Mac OS X
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Re: 1.8-Beta5 Bug: sequence properties dialog produces wrong sql statement order