Re: SEQUENCES

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: SEQUENCES
Дата
Msg-id 20061002164905.GE32410@phlogiston.dyndns.org
обсуждение исходный текст
Ответ на SEQUENCES  ("Rodrigo Sakai" <rodrigo.sakai@zanthus.com.br>)
Список 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 по дате отправления:

Предыдущее
От: "Rodrigo Sakai"
Дата:
Сообщение: SEQUENCES
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: SEQUENCES