Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUGLQ-0007Sw-OG for pgsql-admin@arkaria.postgresql.org; Tue, 04 Dec 2018 19:26:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUGLP-0002Ad-6c for pgsql-admin@arkaria.postgresql.org; Tue, 04 Dec 2018 19:26:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUGLO-0002AW-S7 for pgsql-admin@lists.postgresql.org; Tue, 04 Dec 2018 19:26:55 +0000 Received: from allegro-1.evaristesys.com ([209.51.167.66] helo=evaristesys.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUGLM-0006ic-4V for pgsql-admin@lists.postgresql.org; Tue, 04 Dec 2018 19:26:53 +0000 Received: from [208.71.233.170] (helo=tlaquepaque.localdomain) by evaristesys.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1gUGLL-0004DS-MQ for pgsql-admin@lists.postgresql.org; Tue, 04 Dec 2018 14:26:51 -0500 Date: Tue, 4 Dec 2018 14:26:50 -0500 From: Alex Balashov To: pgsql-admin@lists.postgresql.org Subject: Re: Sequences Message-ID: <20181204192650.GM769@tlaquepaque.localdomain> References: <87E05184-8087-4225-BBCC-F60B74F18023@illinois.edu> <20181204191751.GL769@tlaquepaque.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181204191751.GL769@tlaquepaque.localdomain> Organization: Evariste Systems User-Agent: Mutt/1.11.1 (2018-12-01) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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/