Re: Sequences - Mailing list pgsql-admin

From Alex Balashov
Subject Re: Sequences
Date
Msg-id 20181204192650.GM769@tlaquepaque.localdomain
Whole thread Raw
In response to Re: Sequences  (Alex Balashov <abalashov@evaristesys.com>)
List pgsql-admin
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/


pgsql-admin by date:

Previous
From: Alex Balashov
Date:
Subject: Re: Sequences
Next
From: "Campbell, Lance"
Date:
Subject: Re: Sequences