From: Alex Balashov <abalashov@evaristesys.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Sequences
Date: Tue, 4 Dec 2018 14:26:50 -0500
Message-ID: <20181204192650.GM769@tlaquepaque.localdomain> (raw)
In-Reply-To: <20181204191751.GL769@tlaquepaque.localdomain>
References: <87E05184-8087-4225-BBCC-F60B74F18023@illinois.edu>
<20181204191751.GL769@tlaquepaque.localdomain>
If you have no permission or inclination to actually define something in
the database, here is a shell-based alternative:
---
# psql -Aqt -U evaristesys_adm -d evaristesys \
-c "SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = 'public' ORDER BY sequence_name;" \
| while read SEQ;
do
echo -n "$SEQ: ";
psql -Aqt -U evaristesys_adm -d evaristesys -c "SELECT last_value FROM $SEQ;";
done
---
-- Alex
--
Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
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: abalashov@evaristesys.com
Subject: Re: Sequences
In-Reply-To: <20181204192650.GM769@tlaquepaque.localdomain>
References: <87E05184-8087-4225-BBCC-F60B74F18023@illinois.edu> <20181204191751.GL769@tlaquepaque.localdomain> <20181204192650.GM769@tlaquepaque.localdomain>
* 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