Re: SEQUENCES - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: SEQUENCES
Date
Msg-id 20061002164905.GE32410@phlogiston.dyndns.org
Whole thread Raw
In response to SEQUENCES  ("Rodrigo Sakai" <rodrigo.sakai@zanthus.com.br>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: "Rodrigo Sakai"
Date:
Subject: SEQUENCES
Next
From: Thomas Kellerer
Date:
Subject: Re: SEQUENCES