From joaocarvalho127@yahoo.com.br Wed Sep 7 02:43:52 2005 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 4E3E2D6E2C for ; Tue, 6 Sep 2005 23:43:52 -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 56944-06 for ; Wed, 7 Sep 2005 02:43:38 +0000 (GMT) Received: from web50606.mail.yahoo.com (web50606.mail.yahoo.com [206.190.38.93]) by svr1.postgresql.org (Postfix) with SMTP id 01674D79AB for ; Tue, 6 Sep 2005 23:43:39 -0300 (ADT) Received: (qmail 19855 invoked by uid 60001); 7 Sep 2005 02:43:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=maXtNLv6fxWLgA2xNsnsGXiVpFdy1B+eKDwkrWnMKwVxK83p59HMOPuxrLXg+kZDWW9qRl7T75jgnA2jsfE/MYf+TrVMjMvWGgzpAROn9nWJvkf71Rfp4u079mMHvqMdBQFCDvpdHCXs3BmtXt8P6nJ/bNc9cULez2GHKoktWJw= ; Message-ID: <20050907024344.19853.qmail@web50606.mail.yahoo.com> Received: from [62.48.215.118] by web50606.mail.yahoo.com via HTTP; Tue, 06 Sep 2005 23:43:44 ART Date: Tue, 6 Sep 2005 23:43:44 -0300 (ART) From: =?iso-8859-1?q?Jo=FFffffffffffe3o=20Carvalho?= Subject: Statistics from Sequences To: PG-SQL lista de mail MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1703049417-1126061024=:18592" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.184 required=5 tests=[DNS_FROM_RFC_ABUSE=0.374, FROM_ENDS_IN_NUMS=0.516, HTML_40_50=0.086, HTML_MESSAGE=0.001, UPPERCASE_25_50=0.207] X-Spam-Level: * X-Archive-Number: 200509/64 X-Sequence-Number: 22611 --0-1703049417-1126061024=:18592 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Is it possible to get from a sequence: The sequence owner The min value The max value The increment value The last used number ??? Regards --------------------------------- Yahoo! Messenger com voz: PROMOÇÃO VOCÊ PODE LEVAR UMA VIAGEM NA CONVERSA. Participe! --0-1703049417-1126061024=:18592 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Is it possible to get from a sequence:
  • The sequence owner
  • The min value
  • The max value
  • The increment value
  • The last used number

???

Regards


Yahoo! Messenger com voz: PROMOÇÃO VOCÊ PODE LEVAR UMA VIAGEM NA CONVERSA. Participe! --0-1703049417-1126061024=:18592-- From mike@fuhr.org Wed Sep 7 03:27:00 2005 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 80958D7377 for ; Wed, 7 Sep 2005 00:27:00 -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 74472-04 for ; Wed, 7 Sep 2005 03:26:55 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id B13B6D7C41 for ; Wed, 7 Sep 2005 00:26:53 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j873Qmf6035374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Sep 2005 21:26:51 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j873QmdB010097; Tue, 6 Sep 2005 21:26:48 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j873Qmel010096; Tue, 6 Sep 2005 21:26:48 -0600 (MDT) (envelope-from mfuhr) Date: Tue, 6 Sep 2005 21:26:48 -0600 From: Michael Fuhr To: =?iso-8859-1?Q?Jo=FFffffffffffe3o?= Carvalho Cc: PG-SQL lista de mail Subject: Re: Statistics from Sequences Message-ID: <20050907032648.GA10037@winnie.fuhr.org> 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> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200509/65 X-Sequence-Number: 22612 On Tue, Sep 06, 2005 at 11:43:44PM -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 See the output from the following example: CREATE SEQUENCE fooseq; SELECT u.usename FROM pg_class AS c JOIN pg_user AS u ON u.usesysid = c.relowner WHERE c.relname = 'fooseq'; SELECT * FROM fooseq; -- Michael Fuhr From bruno@wolff.to Wed Sep 7 03:38:35 2005 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. From mike@fuhr.org Thu Sep 8 20:08:07 2005 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 3D9FED8A65 for ; Thu, 8 Sep 2005 17:08:07 -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 14239-03 for ; Thu, 8 Sep 2005 20:08:04 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id D53A4D89C3 for ; Thu, 8 Sep 2005 17:08:03 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j88K82Yx037841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 8 Sep 2005 14:08:04 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j88K82tm084254; Thu, 8 Sep 2005 14:08:02 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j88K821t084253; Thu, 8 Sep 2005 14:08:02 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 8 Sep 2005 14:08:02 -0600 From: Michael Fuhr To: =?iso-8859-1?Q?Jo=FFffffffffffe3o?= Carvalho Cc: pgsql-sql@postgresql.org Subject: Re: Statistics from Sequences Message-ID: <20050908200801.GA84186@winnie.fuhr.org> Reply-To: pgsql-sql@postgresql.org References: <20050907032648.GA10037@winnie.fuhr.org> <20050908173212.26018.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: <20050908173212.26018.qmail@web50606.mail.yahoo.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200509/87 X-Sequence-Number: 22634 [Please copy the mailing list on replies so others can participate in and learn from the discussion.] On Thu, Sep 08, 2005 at 02:32:12PM -0300, Joÿffffffffffe3o Carvalho wrote: > Can you give me a help about: > > > The min value > > The max value > > The increment value > > The last used number The example I posted shows how to obtain those values: CREATE SEQUENCE fooseq; SELECT * FROM fooseq; If you want only particular columns then specify them: SELECT min_value, max_value, increment_by, last_value FROM fooseq; -- Michael Fuhr From joaocarvalho127@yahoo.com.br Thu Sep 8 20:53:29 2005 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 AABBDD8ABE for ; Thu, 8 Sep 2005 17:53:29 -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 23035-06 for ; Thu, 8 Sep 2005 20:53:26 +0000 (GMT) Received: from web50602.mail.yahoo.com (web50602.mail.yahoo.com [206.190.38.89]) by svr1.postgresql.org (Postfix) with SMTP id B837DD8AB9 for ; Thu, 8 Sep 2005 17:53:25 -0300 (ADT) Received: (qmail 15634 invoked by uid 60001); 8 Sep 2005 20:53:27 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=TqYTWcdIoxi2I+fIZ3Mvsi8dZt6j7YnxlhuAagJAkyhh75jnCISPVUUjfJdHltHjTbBmAwX92S2RQPZNXGp5XABuP+1dL4BC/wPZG38srcbkYkovoP/ruUAtWrqaE6E6HqnPp7vOYu1kFVqeLgpxitjZz/3iENhfHN9VgUcRnX4= ; Message-ID: <20050908205327.15632.qmail@web50602.mail.yahoo.com> Received: from [62.48.215.253] by web50602.mail.yahoo.com via HTTP; Thu, 08 Sep 2005 17:53:27 ART Date: Thu, 8 Sep 2005 17:53:27 -0300 (ART) From: =?iso-8859-1?q?Jo=FFffffffffffe3o=20Carvalho?= Subject: Re: Statistics from Sequences To: pgsql-sql@postgresql.org In-Reply-To: <20050908200801.GA84186@winnie.fuhr.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1208037186-1126212807=:15087" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.196 required=5 tests=[AWL=-0.199, DNS_FROM_RFC_ABUSE=0.374, FROM_ENDS_IN_NUMS=0.516, HTML_20_30=0.504, HTML_MESSAGE=0.001] X-Spam-Level: * X-Archive-Number: 200509/89 X-Sequence-Number: 22636 --0-1208037186-1126212807=:15087 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Michael Fuhr escreveu: [Please copy the mailing list on replies so others can participate in and learn from the discussion.] On Thu, Sep 08, 2005 at 02:32:12PM -0300, Joÿffffffffffe3o Carvalho wrote: > Can you give me a help about: > > > The min value > > The max value > > The increment value > > The last used number The example I posted shows how to obtain those values: CREATE SEQUENCE fooseq; SELECT * FROM fooseq; If you want only particular columns then specify them: SELECT min_value, max_value, increment_by, last_value FROM fooseq; -- Michael Fuhr ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly Thank you very much, you've been a great help. Regards --------------------------------- Yahoo! Messenger com voz: PROMOÇÃO VOCÊ PODE LEVAR UMA VIAGEM NA CONVERSA. Participe! --0-1208037186-1126212807=:15087 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit


Michael Fuhr <mike@fuhr.org> escreveu:

[Please copy the mailing list on replies so others can participate
in and learn from the discussion.]

On Thu, Sep 08, 2005 at 02:32:12PM -0300, Joÿffffffffffe3o Carvalho wrote:
> Can you give me a help about:
>
> > The min value
> > The max value
> > The increment value
> > The last used number

The example I posted shows how to obtain those values:

CREATE SEQUENCE fooseq;
SELECT * FROM fooseq;

If you want only particular columns then specify them:

SELECT min_value, max_value, increment_by, last_value FROM fooseq;

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Thank you very much, you've been a great help.

Regards


Yahoo! Messenger com voz: PROMOÇÃO VOCÊ PODE LEVAR UMA VIAGEM NA CONVERSA. Participe! --0-1208037186-1126212807=:15087-- From mike@fuhr.org Thu Sep 8 22:04:32 2005 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 7253CD8AF0 for ; Thu, 8 Sep 2005 19:04:32 -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 38217-10 for ; Thu, 8 Sep 2005 22:04:29 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 87917D8A73 for ; Thu, 8 Sep 2005 19:04:29 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j88M4SKK037927 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 8 Sep 2005 16:04:30 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j88M4S2O054921; Thu, 8 Sep 2005 16:04:28 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j88M4RI4054920; Thu, 8 Sep 2005 16:04:27 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 8 Sep 2005 16:04:27 -0600 From: Michael Fuhr To: =?iso-8859-1?Q?Jo=FFffffffffffe3o?= Carvalho Cc: pgsql-sql@postgresql.org Subject: Re: Statistics from Sequences Message-ID: <20050908220427.GA54848@winnie.fuhr.org> Reply-To: psql-sql@fuhr.org References: <20050907032648.GA10037@winnie.fuhr.org> <20050908212533.34273.qmail@web50601.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: <20050908212533.34273.qmail@web50601.mail.yahoo.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200509/94 X-Sequence-Number: 22641 [Again, please copy the mailing list on replies so others can participate in and learn from the discussion.] On Thu, Sep 08, 2005 at 06:25:33PM -0300, Joÿffffffffffe3o Carvalho wrote: > There's one thing. If the sequence name was fooseq in uppercase > (FOOSEQ) it does not work. In that case it returns the error: ERROR: > relation "fooseq" does not exist. This isn't a sequence issue, it's an identifier issue. See "Why are my table and column names not recognized in my query?" in the FAQ and "Identifiers and Key Words" in the documentation: http://www.postgresql.org/docs/faqs.FAQ.html#4.20 http://www.postgresql.org/docs/8.0/static/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS -- Michael Fuhr