Re: pg_sequence catalog

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_sequence catalog
Date: 2016-11-11 17:53:33
Message-ID: b08334c0-53a3-b961-ae32-6364da54eb60@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/10/2016 06:27 AM, Andreas Karlsson wrote:
> On 11/10/2016 05:29 AM, Peter Eisentraut wrote:
>> On 11/8/16 6:43 PM, Andreas Karlsson wrote:
>>> - Shouldn't last_value be NULL directly after we have created the
>>> sequence but nobody has called nextval() yet?
>>>
>>> - I noticed that last_value includes the cached values, but that also
>>> seems to me like the correct thing to do.
>>
>> The documentation now emphasizes that this is the value stored on disk.
>> This matches what Oracle does.
>
> We also store is_called on disk, I think that if is_called is false then
> last_value should be NULL. Either that or we should add is_called.
>
> I will give the patch another review some time this week when i can find
> the time.

Other than my comment above about is_called and last_value I think the
patch looks great.

Andreas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2016-11-11 18:12:29 Re: Why PostgreSQL doesn't implement a semi sync replication?
Previous Message Tom Lane 2016-11-11 16:10:23 Re: Do we need use more meaningful variables to replace 0 in catalog head files?