Re: Sequences

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux