pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
To: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [ADMIN] how to alter sequence.
Date: Wed, 04 Dec 2002 21:21:24 +0530
Message-ID: <3DEE71D4.21116.1940487@localhost> (raw)
In-Reply-To: <1039016518.2281.17.camel@rh72.home.ee>
References: <1039010812.11433.75.camel@linda.lfix.co.uk>

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?

Bye
 Shridhar

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




view thread (23+ messages)  latest in thread

Message-ID: <3DEE71D4.21116.1940487@localhost>
Permalink:  ../3DEE71D4.21116.1940487@localhost/
Also on:    postgresql.org/message-id/3DEE71D4.21116.1940487@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: shridhar_daithankar@persistent.co.in, pgsql-hackers@postgresql.org
  Subject: Re: [ADMIN] how to alter sequence.
  In-Reply-To: <3DEE71D4.21116.1940487@localhost>
  References: <1039010812.11433.75.camel@linda.lfix.co.uk> <3DEE71D4.21116.1940487@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox