pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: SEQUENCES
Date: Mon, 2 Oct 2006 12:49:06 -0400
Message-ID: <20061002164905.GE32410@phlogiston.dyndns.org> (raw)
In-Reply-To: <001801c6e641$6093f5d0$4700a8c0@TREEZANTHUS>
References: <001801c6e641$6093f5d0$4700a8c0@TREEZANTHUS>

On Mon, Oct 02, 2006 at 01:39:38PM -0300, Rodrigo Sakai wrote:
> 
>   I need to get all sequences and their respective current values! Is there
> any catalog table or any other away to get this???

Here's a quick way to do it in a shell script, although it'd be sort
of inefficient:

for name in `psql -c "select relname from pg_class where relkind =
'S'" dbname; do psql -c "select last_value from $name" dbname; done.

A


-- 
Andrew Sullivan  | ajs@crankycanuck.ca
Unfortunately reformatting the Internet is a little more painful 
than reformatting your hard drive when it gets out of whack.
		--Scott Morris



view thread (19+ messages)  latest in thread

Message-ID: <20061002164905.GE32410@phlogiston.dyndns.org>
Permalink:  ../20061002164905.GE32410@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20061002164905.GE32410@phlogiston.dyndns.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: ajs@crankycanuck.ca
  Subject: Re: SEQUENCES
  In-Reply-To: <20061002164905.GE32410@phlogiston.dyndns.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