Re: Statistics from Sequences

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Joÿffffffffffe3o Carvalho <joaocarvalho127(at)yahoo(dot)com(dot)br>
Cc: PG-SQL lista de mail <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Statistics from Sequences
Date: 2005-09-07 03:38:33
Message-ID: 20050907033833.GB31843@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Sep 06, 2005 at 23:43:44 -0300,
Joÿffffffffffe3o Carvalho <joaocarvalho127(at)yahoo(dot)com(dot)br> 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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Paul Ramsey 2005-09-07 03:40:08 Re: uuid type for postgres
Previous Message Michael Fuhr 2005-09-07 03:26:48 Re: Statistics from Sequences