pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Edipo E. F. Melo <edipoelder@ig.com.br>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Where is the sequence value?
Date: Sat, 19 Apr 2003 08:50:06 -0300
Message-ID: <20030419114606.564CD4758C9@postgresql.org> (raw)

Hi all,

   In my system, I use a sequence to enumerate a proccess list, and this sequence must be reseted each 
year. I don't remember how it was created, but when I try to "setval('seq', 0)" I get a "out of bounds 
(1, ...) error.

   So, I set i to 1 ("setval('seq', 1)"), but in my system, when I try to insert a process, the nextval
() returns 2, not 1. 

   I was thinking to fix this dropping, e creating the sequence, but in my system, a lot o users have 
permission to update the sequence (to use a nextval() on it), and I couldn't revoke they rights when I 
drop it.

   Insted, I search the docs about where sequence is definited, its min, max and current value, to 
change the min value, setting it to 0, but I didn't found something.

   (After a lot of text), my question is: how can I change the min value of a sequence without dropping 
it?

   Thanks for all,



    []'s

    Edipo Elder F. de Melo
    [edipoelder@ig.com.br]
    [    ICQ#: 4546070   ]




view thread (2+ messages)  latest in thread

Message-ID: <20030419114606.564CD4758C9@postgresql.org>
Permalink:  ../20030419114606.564CD4758C9@postgresql.org/
Also on:    postgresql.org/message-id/20030419114606.564CD4758C9@postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: edipoelder@ig.com.br, pgsql-admin@postgresql.org
  Subject: Re: Where is the sequence value?
  In-Reply-To: <20030419114606.564CD4758C9@postgresql.org>

* 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