Re: WIP: System Versioned Temporal Table

From: Li Japin <japinli(at)hotmail(dot)com>
To: Surafel Temesgen <surafel3000(at)gmail(dot)com>
Cc: Vik Fearing <vik(at)postgresfriends(dot)org>, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>, Ryan Lambert <ryan(at)rustprooflabs(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Rémi Lapeyre <remi(dot)lapeyre(at)lenstra(dot)fr>, Eli Marmor <eli(at)netmask(dot)it>, David Steele <david(at)pgmasters(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Georgios <gkokolatos(at)protonmail(dot)com>
Subject: Re: WIP: System Versioned Temporal Table
Date: 2021-02-25 10:28:28
Message-ID: 358FBCC9-F788-4ECE-8104-6825F65D1C56@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Jan 27, 2021, at 12:39 AM, Surafel Temesgen <surafel3000(at)gmail(dot)com<mailto:surafel3000(at)gmail(dot)com>> wrote:

On Tue, Jan 26, 2021 at 2:33 PM Vik Fearing <vik(at)postgresfriends(dot)org<mailto:vik(at)postgresfriends(dot)org>> wrote:
I'm still in the weeds of reviewing this patch, but why should this
fail? It should not fail.

Attached is rebased patch that include isolation test

Thanks for updating the patch. However it cannot apply to master (e5d8a9990).

Here are some comments on system-versioning-temporal-table_2021_v13.patch.

+</programlisting>
+ When system versioning is specified two columns are added which
+ record the start timestamp and end timestamp of each row verson.

verson -> version

+ By default, the column names will be StartTime and EndTime, though
+ you can specify different names if you choose.

In fact, it is start_time and end_time, not StartTime and EndTime.
I think it's better to use <literal> label around start_time and end_time.

+ column will be automatically added to the Primary Key of the
+ table.

Should we mention the unique constraints?

+ The system versioning period end column will be added to the
+ Primary Key of the table as a way of ensuring that concurrent
+ INSERTs conflict correctly.

Same as above.

Since the get_row_start_time_col_name() and get_row_end_time_col_name()
are similar, IMO we can pass a flag to get StartTime/EndTime column name,
thought?

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message onlinebusinessindia 2021-02-25 10:50:34 Re: logical decoding of two-phase transactions
Previous Message Peter Eisentraut 2021-02-25 09:49:02 Re: pgsql: pg_collation_actual_version() -> pg_collation_current_version().