X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7637FD7377 for ; Wed, 7 Sep 2005 00:38:35 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 73265-09 for ; Wed, 7 Sep 2005 03:38:33 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.197.194]) by svr1.postgresql.org (Postfix) with SMTP id 50FF5D6F38 for ; Wed, 7 Sep 2005 00:38:32 -0300 (ADT) Received: (qmail 2086 invoked by uid 500); 7 Sep 2005 03:38:33 -0000 Date: Tue, 6 Sep 2005 22:38:33 -0500 From: Bruno Wolff III To: =?iso-8859-1?Q?Jo=FFffffffffffe3o?= Carvalho Cc: PG-SQL lista de mail Subject: Re: Statistics from Sequences Message-ID: <20050907033833.GB31843@wolff.to> Mail-Followup-To: Bruno Wolff III , =?iso-8859-1?Q?Jo=FFffffffffffe3o?= Carvalho , PG-SQL lista de mail References: <20050907024344.19853.qmail@web50606.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20050907024344.19853.qmail@web50606.mail.yahoo.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200509/66 X-Sequence-Number: 22613 On Tue, Sep 06, 2005 at 23:43:44 -0300, Jo˙ffffffffffe3o Carvalho wrote: > Is it possible to get from a sequence: > > The sequence owner > The min value > The max value > The increment value > The last used number Yes. Associated with each sequence is a one row table with the name of the sequence. Note that numbers can be allocated and not used, so the last_value may not be exactly what you want. To get the owner you can combine pg_class with pg_user to get the table owner. I didn't see this information in the information schema.