Quantcast

feature request - allow to set option is_called for setval

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

feature request - allow to set option is_called for setval

Bartosz Dmytrak
Hi,
I just noticed pgAdmin cannot set value of sequence to start with 1 because generates SQL like this:
SELECT setval('"MySchema"."MySequence"', 1, true);

it is not possible to set "is_called" option of setval to false. 
 "If it is set to false, the next nextval will return exactly the specified value, and sequence advancement commences with the following nextval"

so, please add checkbox in sequence properties to allow to modify this switch.

thanks & regards,
Bartek
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: feature request - allow to set option is_called for setval

Guillaume Lelarge-3
On Tue, 2012-03-27 at 08:58 +0200, Bartosz Dmytrak wrote:

> Hi,
> I just noticed pgAdmin cannot set value of sequence to start with 1 because
> generates SQL like this:
> SELECT setval('"MySchema"."MySequence"', 1, true);
>
> it is not possible to set "is_called" option of setval to false.
> According to doc (
> http://www.postgresql.org/docs/9.1/static/functions-sequence.html):
> * "If it is set to false, the next nextval will return exactly the
> specified value, and sequence advancement commences with the following
> nextval"*
>
> so, please add checkbox in sequence properties to allow to modify this
> switch.
>

I thought you would be able to set it to zero, but 0 is out of bounds as
a start value of a sequence. Kinda weird. Anyway, yes, we should add
that kind of checkbox.

I added a ticket to work on that later
(http://code.pgadmin.org/trac/ticket/358).


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com


--
Sent via pgadmin-support mailing list ([hidden email])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

Loading...