On Tue, Jul 16, 2019 at 01:24:54PM +0900, Masahiko Sawada wrote:
> On Sat, Jul 13, 2019 at 12:33 AM Bruce Momjian <bruce@momjian.us> wrote:
> > then each row change gets its own LSN. You are asking if an update that
> > just expires one row and adds it to a new page gets the same LSN. I
> > don't know.
>
> The following scripts can reproduce that different two pages have the same LSN.
>
> =# create table test (a int);
> CREATE TABLE
> =# insert into test select generate_series(1, 226);
> INSERT 0 226
> =# update test set a = a where a = 1;
> UPDATE 1
> =# select lsn from page_header(get_raw_page('test', 0));
> lsn
> -----------
> 0/1690488
> (1 row)
>
> =# select lsn from page_header(get_raw_page('test', 1));
> lsn
> -----------
> 0/1690488
> (1 row)
>
> So I think it's better to use LSN and page number to create IV. If we
> modify different tables by single WAL we also would need OID or
> relfilenode but I don't think currently we have such operations.
OK, good to know, thanks.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +