Re: Sequences

From: Andre Rothe <arothe(at)phosco(dot)info>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Sequences
Date: 2009-07-04 20:50:53
Message-ID: h2ofbd$n7g$01$1@news.t-online.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thanks, I have used

SELECT sequence_name FROM information_schema.sequences WHERE
sequence_catalog=? AND sequence_schema=?

and then I can use

select * from <sequence-name>

It seems to work :-)
Andre

Chris Browne wrote:
> Andre Rothe <arothe(at)phosco(dot)info> writes:
>> Where are stored the sequence information? How I can query the
>> properties of a sequence like increment, max/min value, cache?
>> I'm looking for a table like user_sequences in Oracle, where I
>> can query all of my sequences.
>
> cbbrowne=# create sequence foo;
> CREATE SEQUENCE
> cbbrowne=# select * from foo;
> sequence_name | last_value | increment_by | max_value | min_value | cache_value | log_cnt | is_cycled | is_called
> ---------------+------------+--------------+---------------------+-----------+-------------+---------+-----------+-----------
> foo | 1 | 1 | 9223372036854775807 | 1 | 1 | 1 | f | f
> (1 row)
>
> Each sequence is effectively a relation.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Headland 2009-07-07 01:22:50 Best way to simulate Booleans
Previous Message Scott Marlowe 2009-07-04 17:26:39 Re: Sequences