Re: [ADMIN] how to alter sequence. - Mailing list pgsql-hackers

From Shridhar Daithankar
Subject Re: [ADMIN] how to alter sequence.
Date
Msg-id 3DEE71D4.21116.1940487@localhost
Whole thread Raw
In response to Re: [ADMIN] how to alter sequence.  (Hannu Krosing <hannu@tm.ee>)
Responses Re: [ADMIN] how to alter sequence.
List pgsql-hackers
On 4 Dec 2002 at 20:41, Hannu Krosing wrote:
> hannu=# update seq set max_value = 99;
> ERROR:  You can't change sequence relation seq
> hannu=# update pg_class set relkind = 'r' where relname = 'seq';
> UPDATE 1
> hannu=# update seq set max_value = 99;
> UPDATE 1
> hannu=# update pg_class set relkind = 'S' where relname = 'seq';
> UPDATE 1
> hannu=# select * from seq;
>  sequence_name | last_value | increment_by | max_value | min_value |
> cache_value | log_cnt | is_cycled | is_called 
> ---------------+------------+--------------+-----------+-----------+-------------+---------+-----------+-----------
>  seq           |          1 |            1 |        99 |         1
> |           1 |       1 | f         | f

That makes me wonder. If sequense is treated like a single column single row 
table and it's value is guarenteed to be increasing even in case of aborted 
transaction, is it correct to say that postgresql already has nested 
transactions, albeit dormant?

ByeShridhar

--
Zero Defects, n.:    The result of shutting down a production line.



pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: [ADMIN] how to alter sequence.
Next
From: Hannu Krosing
Date:
Subject: Re: [ADMIN] how to alter sequence.