Re: system table/view and sequence

From: Olivier Baheux <olivierbaheux(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: system table/view and sequence
Date: 2010-04-08 06:36:09
Message-ID: c810a731-91e5-4e23-b33b-845061fdeb74@w42g2000yqm.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 7 avr, 17:44, nicolas(dot)barb(dot)(dot)(dot)(at)gmail(dot)com (Nicolas Barbier) wrote:
> 2010/4/7 Olivier Baheux <olivierbah(dot)(dot)(dot)(at)gmail(dot)com>:
>
> > i'm trying to find where are stored sequence definition
> > (increment,minvalue,maxvalue,start,cache) in system tables. Atm I
> > found everything exept sequence.
>
> It's in the sequence itself (which can be accessed like a table). The
> fact that this "table" is in fact a sequence is stored in pg_class:
>
> --------8<--------
> itsme=# CREATE TABLE a (i serial);
> HINWEIS:  CREATE TABLE erstellt implizit eine Sequenz »a_i_seq« für
> die »serial«-Spalte »a.i«
> CREATE TABLE
> itsme=# SELECT * FROM a_i_seq;
>  sequence_name | last_value | increment_by |      max_value      |
> min_value | cache_value | log_cnt | is_cycled | is_called
> ---------------+------------+--------------+---------------------+-----------+-------------+---------+-----------+-----------
>  a_i_seq       |          1 |            1 | 9223372036854775807 |
>     1 |           1 |       1 | f         | f
> (1 Zeile)
>
> itsme=# SELECT relkind FROM pg_class WHERE relname = 'a_i_seq';
>  relkind
> ---------
>  S
> (1 Zeile)
> -------->8--------
>
> Nicolas
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hack(dot)(dot)(dot)(at)postgresql(dot)org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-hackers

it work, thanx so much

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2010-04-08 06:54:14 Re: Remaining Streaming Replication Open Items
Previous Message Fujii Masao 2010-04-08 06:33:51 Re: Streaming replication and a disk full in primary