Re: WIP: System Versioned Temporal Table

2022-02-20 Thread Corey Huinker
> > > The spec does not allow schema changes at all on a a system versioned > table, except to change the system versioning itself. > > That would greatly simplify things!

Re: WIP: System Versioned Temporal Table

2022-02-15 Thread Jean Baro
Would these best practices be applicable by PostgreSQL to help avoid breaking changes for temporal tables? https://blog.datomic.com/2017/01/the-ten-rules-of-schema-growth.html Thanks On Tue, Feb 15, 2022 at 5:08 PM Vik Fearing wrote: > On 1/24/22 00:16, Corey Huinker wrote: > >> - Table schema

Re: WIP: System Versioned Temporal Table

2022-02-08 Thread Vik Fearing
On 1/24/22 00:16, Corey Huinker wrote: - Table schemas change, and all (SV active) AV items would logically need to fit the active schema or be updated to do so. Different story for SV, nothing there should ever need to be changed. Yeah, there's a mess (which you state below) about what happens

Re: WIP: System Versioned Temporal Table

2022-01-23 Thread Corey Huinker
> > > > 2. Putting data in a side table. This makes DROP SYSTEM VERSIONING > > fairly trivial, but it complicates many DDL commands (please make a > > list?) and requires the optimizer to know about this and cater to it, > > possibly complicating plans. Neither issue is insurmountable, but it > > b

Re: WIP: System Versioned Temporal Table

2022-01-23 Thread Trevor Gross
Chiming in as a user, not so much a developer - I've been using system versioned tables in MariaDB for about half a year now, would just like to add some feedback about what they did right and wrong and how PG could learn from their mistakes & successes. > 2. Putting data in a side table. This mak

Re: WIP: System Versioned Temporal Table

2021-11-16 Thread Daniel Gustafsson
> On 15 Nov 2021, at 11:50, Simon Riggs wrote: > I have no plans on taking this patch further, but will give some help > to anyone that wishes to do that. > > I suggest we Return with Feedback. Fair enough, done that way. -- Daniel Gustafsson https://vmware.com/

Re: WIP: System Versioned Temporal Table

2021-11-15 Thread Simon Riggs
On Mon, 15 Nov 2021 at 09:47, Daniel Gustafsson wrote: > > > On 19 Sep 2021, at 20:32, Simon Riggs wrote: > > > My preferred approach would be to do this "for free" in the table > > access method, but we're a long way from this in terms of actual > > implementation. When Corey suggested earlier

Re: WIP: System Versioned Temporal Table

2021-11-15 Thread Vik Fearing
On 11/15/21 10:47 AM, Daniel Gustafsson wrote: >> On 19 Sep 2021, at 20:32, Simon Riggs wrote: > >> My preferred approach would be to do this "for free" in the table >> access method, but we're a long way from this in terms of actual >> implementation. When Corey suggested earlier that we just p

Re: WIP: System Versioned Temporal Table

2021-11-15 Thread Daniel Gustafsson
> On 19 Sep 2021, at 20:32, Simon Riggs wrote: > My preferred approach would be to do this "for free" in the table > access method, but we're a long way from this in terms of actual > implementation. When Corey suggested earlier that we just put the > syntax in there, this was the direction I wa

Re: WIP: System Versioned Temporal Table

2021-09-20 Thread Hannu Krosing
On Mon, Sep 20, 2021 at 7:09 AM Corey Huinker wrote: > > On Sun, Sep 19, 2021 at 3:12 PM Hannu Krosing wrote: >> >> A side table has the nice additional benefit that we can very easily >> version the *table structure* so when we ALTER TABLE and the table >> structure changes we just make a new si

Re: WIP: System Versioned Temporal Table

2021-09-19 Thread Corey Huinker
On Sun, Sep 19, 2021 at 3:12 PM Hannu Krosing wrote: > A side table has the nice additional benefit that we can very easily > version the *table structure* so when we ALTER TABLE and the table > structure changes we just make a new side table with now-currents > structure. > It's true that would

Re: WIP: System Versioned Temporal Table

2021-09-19 Thread Corey Huinker
> > Thanks for giving this a lot of thought. When you asked the question > the first time you hadn't discussed how that might work, but now we > have something to discuss. > My ultimate goal is to unify this effort with the application period effort. Step 1 in that was to understand what each was

Re: WIP: System Versioned Temporal Table

2021-09-19 Thread Hannu Krosing
A side table has the nice additional benefit that we can very easily version the *table structure* so when we ALTER TABLE and the table structure changes we just make a new side table with now-currents structure. Also we may want different set of indexes on historic table(s) for whatever reason A

Re: WIP: System Versioned Temporal Table

2021-09-19 Thread Simon Riggs
On Sun, 19 Sept 2021 at 01:16, Corey Huinker wrote: >> >> 1. Much of what I have read about temporal tables seemed to imply or almost >> assume that system temporal tables would be implemented as two actual >> separate tables. Indeed, SQLServer appears to do it that way [1] with syntax >> like

Re: WIP: System Versioned Temporal Table

2021-09-18 Thread Corey Huinker
> > > > 1. Much of what I have read about temporal tables seemed to imply or > almost assume that system temporal tables would be implemented as two > actual separate tables. Indeed, SQLServer appears to do it that way [1] > with syntax like > > WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE = dbo.Web

Re: WIP: System Versioned Temporal Table

2021-09-12 Thread Corey Huinker
On Sun, Sep 12, 2021 at 12:02 PM Simon Riggs wrote: > On Fri, 10 Sept 2021 at 19:30, Jaime Casanova > wrote: > > > > On Tue, Aug 10, 2021 at 01:20:14PM +0100, Simon Riggs wrote: > > > On Wed, 14 Jul 2021 at 12:48, vignesh C wrote: > > > > > > > The patch does not apply on Head anymore, could yo

Re: WIP: System Versioned Temporal Table

2021-09-12 Thread Simon Riggs
On Fri, 10 Sept 2021 at 19:30, Jaime Casanova wrote: > > On Tue, Aug 10, 2021 at 01:20:14PM +0100, Simon Riggs wrote: > > On Wed, 14 Jul 2021 at 12:48, vignesh C wrote: > > > > > The patch does not apply on Head anymore, could you rebase and post a > > > patch. I'm changing the status to "Waiting

Re: WIP: System Versioned Temporal Table

2021-09-10 Thread Jaime Casanova
On Tue, Aug 10, 2021 at 01:20:14PM +0100, Simon Riggs wrote: > On Wed, 14 Jul 2021 at 12:48, vignesh C wrote: > > > The patch does not apply on Head anymore, could you rebase and post a > > patch. I'm changing the status to "Waiting for Author". > > OK, so I've rebased the patch against current

Re: WIP: System Versioned Temporal Table

2021-09-01 Thread Jaime Casanova
Hi, This doesn't pass tests because of lack of some file. Can we fix that please and send the patch again? On Tue, Aug 10, 2021 at 7:20 AM Simon Riggs wrote: > On Wed, 14 Jul 2021 at 12:48, vignesh C wrote: > > > The patch does not apply on Head anymore, could you rebase and post a > > patch.

Re: WIP: System Versioned Temporal Table

2021-08-24 Thread Daniel Westermann
Hi, quick note: The documentation for this patch mentions: The starttime column +will be automatically added to the Primary Key of the table. A quick tests shows that the endtime column is added instead: postgres=# create table t1 ( a int primary key generated always as identity, b text )

Re: WIP: System Versioned Temporal Table

2021-07-14 Thread vignesh C
On Mon, Mar 8, 2021 at 11:04 PM Ibrar Ahmed wrote: > > > > On Thu, Feb 25, 2021 at 3:28 PM Li Japin wrote: >> >> >> On Jan 27, 2021, at 12:39 AM, Surafel Temesgen wrote: >> >> >> >> On Tue, Jan 26, 2021 at 2:33 PM Vik Fearing wrote: >>> >>> I'm still in the weeds of reviewing this patch, but wh

Re: WIP: System Versioned Temporal Table

2021-03-11 Thread Surafel Temesgen
On Wed, Mar 10, 2021 at 9:02 AM Vik Fearing wrote: > > I have plenty of objection. I'm sorry that I am taking so long with my > review. I am still working on it and it is coming soon, I promise. > > okay take your time regards Surafel

Re: WIP: System Versioned Temporal Table

2021-03-10 Thread Vik Fearing
On 3/10/21 5:49 PM, Surafel Temesgen wrote: > hi Ibrar, > thank you for rebasing > > On Mon, Mar 8, 2021 at 9:34 AM Ibrar Ahmed wrote: > >> >>> 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, >>

Re: WIP: System Versioned Temporal Table

2021-03-10 Thread Surafel Temesgen
hi Ibrar, thank you for rebasing On Mon, Mar 8, 2021 at 9:34 AM Ibrar Ahmed wrote: > >> 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? >> >> For me your option is better. i will cha

Re: WIP: System Versioned Temporal Table

2021-02-25 Thread Li Japin
On Jan 27, 2021, at 12:39 AM, Surafel Temesgen mailto:surafel3...@gmail.com>> wrote: On Tue, Jan 26, 2021 at 2:33 PM Vik Fearing mailto:v...@postgresfriends.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 t

RE: WIP: System Versioned Temporal Table

2021-02-04 Thread easteregg
hi, i tested the temporal patch ( https://commitfest.postgresql.org/26/2316/ ) with the current 14devel applied ontop of ef3d461 without any conflicts. i build with no special options passed to ./configure and noticed, that the postgresql-client-13 from the debian repositories crashes with the \

Re: WIP: System Versioned Temporal Table

2021-01-26 Thread Simon Riggs
On Tue, Jan 26, 2021 at 12:51 PM Vik Fearing wrote: > > On 1/26/21 1:16 PM, Simon Riggs wrote: > > On Tue, Jan 26, 2021 at 11:33 AM Vik Fearing > > wrote: > >> > >> On 1/11/21 3:02 PM, Simon Riggs wrote: > >>> * UPDATE foo SET start_timestamp = DEFAULT should fail but currently > >>> doesn't >

Re: WIP: System Versioned Temporal Table

2021-01-26 Thread Vik Fearing
On 1/26/21 1:16 PM, Simon Riggs wrote: > On Tue, Jan 26, 2021 at 11:33 AM Vik Fearing wrote: >> >> On 1/11/21 3:02 PM, Simon Riggs wrote: >>> * UPDATE foo SET start_timestamp = DEFAULT should fail but currently doesn't >> >> I'm still in the weeds of reviewing this patch, but why should this >> fa

Re: WIP: System Versioned Temporal Table

2021-01-26 Thread Simon Riggs
On Tue, Jan 26, 2021 at 11:33 AM Vik Fearing wrote: > > On 1/11/21 3:02 PM, Simon Riggs wrote: > > * UPDATE foo SET start_timestamp = DEFAULT should fail but currently doesn't > > I'm still in the weeds of reviewing this patch, but why should this > fail? It should not fail. It should not be pos

Re: WIP: System Versioned Temporal Table

2021-01-26 Thread Vik Fearing
On 1/11/21 3:02 PM, Simon Riggs wrote: > * UPDATE foo SET start_timestamp = DEFAULT should fail but currently doesn't I'm still in the weeds of reviewing this patch, but why should this fail? It should not fail. -- Vik Fearing

Re: WIP: System Versioned Temporal Table

2021-01-18 Thread Surafel Temesgen
On Mon, Jan 18, 2021 at 1:43 AM Vik Fearing wrote: > > This is not good, and I see that DROP SYSTEM VERSIONING also removes > these columns which is even worse. Please read the standard that you > are trying to implement! > > The standard states the function of ALTER TABLE ADD SYSTEM VERSIONING

Re: WIP: System Versioned Temporal Table

2021-01-17 Thread Vik Fearing
On 1/17/21 5:46 PM, Surafel Temesgen wrote: > On Sat, Jan 16, 2021 at 10:12 PM Vik Fearing > wrote: > >> >> I haven't looked at this patch in a while, but I hope that ALTER TABLE t >> ADD SYSTEM VERSIONING is not adding any columns. That is a bug if it does. >> >> > Yes, that is how I implement

Re: WIP: System Versioned Temporal Table

2021-01-17 Thread Surafel Temesgen
On Sat, Jan 16, 2021 at 10:12 PM Vik Fearing wrote: > > I haven't looked at this patch in a while, but I hope that ALTER TABLE t > ADD SYSTEM VERSIONING is not adding any columns. That is a bug if it does. > > Yes, that is how I implement it. I don't understand how it became a bug? regards Sura

Re: WIP: System Versioned Temporal Table

2021-01-16 Thread Vik Fearing
On 1/16/21 7:39 PM, Surafel Temesgen wrote: > On Fri, Jan 15, 2021 at 8:02 PM Simon Riggs > wrote: > >> >> There are no existing applications, so for PostgreSQL, it wouldn't be an >> issue. >> >> > Yes we don't have but the main function of ALTER TABLE foo ADD SYSTEM > VERSIONING > is to add syst

Re: WIP: System Versioned Temporal Table

2021-01-16 Thread Surafel Temesgen
On Fri, Jan 15, 2021 at 8:02 PM Simon Riggs wrote: > > There are no existing applications, so for PostgreSQL, it wouldn't be an > issue. > > Yes we don't have but the main function of ALTER TABLE foo ADD SYSTEM VERSIONING is to add system versioning functionality to existing application regards

Re: WIP: System Versioned Temporal Table

2021-01-16 Thread Vik Fearing
On 1/14/21 6:42 PM, Surafel Temesgen wrote: > Hi Simon, > Thank you for all the work you does > > On Mon, Jan 11, 2021 at 5:02 PM Simon Riggs > wrote: > >> >> >> * Anomalies around use of CURRENT_TIMESTAMP are not discussed or resolved. >> Probably need to add a test that end_timestamp > start_t

Re: WIP: System Versioned Temporal Table

2021-01-16 Thread Vik Fearing
On 1/14/21 10:22 PM, Simon Riggs wrote: > On Thu, Jan 14, 2021 at 5:46 PM Surafel Temesgen > wrote: > >> On Fri, Jan 8, 2021 at 7:50 PM Ryan Lambert wrote: >>> >>> I prefer to have them hidden by default. This was mentioned up-thread with >>> no decision, it seems the standard is ambiguous.

Re: WIP: System Versioned Temporal Table

2021-01-15 Thread legrand legrand
Hello, it seems that Oracle (11R2) doesn't add the Start and End timestamp columns and permit statement like select * from tt union select * from tt AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '6' SECOND) minus select * from tt VERSIONS BETWEEN TIMESTAMP (SYSTIMESTAMP - INTERVAL '6' second) and SY

Re: WIP: System Versioned Temporal Table

2021-01-15 Thread Simon Riggs
On Fri, Jan 15, 2021 at 4:56 PM Surafel Temesgen wrote: > > > > On Fri, Jan 15, 2021 at 12:22 AM Simon Riggs > wrote: >> >> SELECT * FROM foo FOR SYSTEM_TIME AS OF ... >> should NOT include the Start and End timestamp columns >> because this acts like a normal query just with a different snapsho

Re: WIP: System Versioned Temporal Table

2021-01-15 Thread Surafel Temesgen
On Fri, Jan 15, 2021 at 12:22 AM Simon Riggs wrote: > SELECT * FROM foo FOR SYSTEM_TIME AS OF ... > should NOT include the Start and End timestamp columns > because this acts like a normal query just with a different snapshot > timestamp > > SELECT * FROM foo FOR SYSTEM_TIME BETWEEN x AND y > SHO

Re: WIP: System Versioned Temporal Table

2021-01-15 Thread Simon Riggs
On Fri, Jan 15, 2021 at 4:46 PM Surafel Temesgen wrote: > > > > On Fri, Jan 15, 2021 at 12:27 AM Simon Riggs > wrote: >> >> >> Yes, I think it can. The current situation is that the Start or End is >> set to the Transaction Start Timestamp. >> So if t2 starts before t1, then if t1 creates a row

Re: WIP: System Versioned Temporal Table

2021-01-15 Thread Surafel Temesgen
On Fri, Jan 15, 2021 at 12:27 AM Simon Riggs wrote: > > Yes, I think it can. The current situation is that the Start or End is > set to the Transaction Start Timestamp. > So if t2 starts before t1, then if t1 creates a row and t2 deletes it > then we will have start=t1 end=t2, but t2 Your tests d

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Ryan Lambert
On Thu, Jan 14, 2021 at 2:22 PM Simon Riggs wrote: > On Thu, Jan 14, 2021 at 5:46 PM Surafel Temesgen > wrote: > > > On Fri, Jan 8, 2021 at 7:50 PM Ryan Lambert > wrote: > >> > >> I prefer to have them hidden by default. This was mentioned up-thread > with no decision, it seems the standard is

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Simon Riggs
On Thu, Jan 14, 2021 at 5:42 PM Surafel Temesgen wrote: > > Hi Simon, > Thank you for all the work you does No problem. > On Mon, Jan 11, 2021 at 5:02 PM Simon Riggs > wrote: >> >> >> >> * Anomalies around use of CURRENT_TIMESTAMP are not discussed or resolved. >> Probably need to add a test t

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Simon Riggs
On Thu, Jan 14, 2021 at 5:46 PM Surafel Temesgen wrote: > On Fri, Jan 8, 2021 at 7:50 PM Ryan Lambert wrote: >> >> I prefer to have them hidden by default. This was mentioned up-thread with >> no decision, it seems the standard is ambiguous. MS SQL appears to have >> flip-flopped on this dec

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Surafel Temesgen
Hi Ryan On Fri, Jan 8, 2021 at 7:50 PM Ryan Lambert wrote: > I prefer to have them hidden by default. This was mentioned up-thread > with no decision, it seems the standard is ambiguous. MS SQL appears to > have flip-flopped on this decision [1]. > > I will change it to hidden by default if th

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Surafel Temesgen
Hi Simon, Thank you for all the work you does On Mon, Jan 11, 2021 at 5:02 PM Simon Riggs wrote: > > > * Anomalies around use of CURRENT_TIMESTAMP are not discussed or resolved. > Probably need to add a test that end_timestamp > start_timestamp or ERROR, > which effectively enforces serializabil

Re: WIP: System Versioned Temporal Table

2021-01-14 Thread Surafel Temesgen
Hi Andrew, On Fri, Jan 8, 2021 at 4:38 PM Andrew Dunstan wrote: > > On 1/8/21 7:33 AM, Simon Riggs wrote: > > > > * What happens if you ask for a future time? > > It will give an inconsistent result as it scans, so we should refuse a > > query for time > current_timestamp. > > > That seems like a

Re: WIP: System Versioned Temporal Table

2021-01-12 Thread Ryan Lambert
On Mon, Jan 11, 2021 at 7:02 AM Simon Riggs wrote: > On Sat, Jan 9, 2021 at 10:39 AM Simon Riggs > wrote: > > > > On Fri, Jan 8, 2021 at 9:19 PM Ryan Lambert > wrote: > > > > >> Updated v11 with additional docs and some rewording of messages/tests > > >> to use "system versioning" correctly. >

Re: WIP: System Versioned Temporal Table

2021-01-09 Thread Simon Riggs
On Fri, Jan 8, 2021 at 9:19 PM Ryan Lambert wrote: >> Updated v11 with additional docs and some rewording of messages/tests >> to use "system versioning" correctly. >> >> No changes on the points previously raised. >> > Thank you! The v11 applies and installs. I tried a simple test, > unfortun

Re: WIP: System Versioned Temporal Table

2021-01-08 Thread Ryan Lambert
On Fri, Jan 8, 2021 at 11:38 AM Simon Riggs wrote: > On Fri, Jan 8, 2021 at 4:50 PM Ryan Lambert > wrote: > > > > On Fri, Jan 8, 2021 at 5:34 AM Simon Riggs > wrote: > >> > >> On Fri, Jan 8, 2021 at 7:34 AM Simon Riggs < > simon.ri...@enterprisedb.com> wrote: > >> > > >> > On Fri, Jan 8, 2021 a

Re: WIP: System Versioned Temporal Table

2021-01-08 Thread Ryan Lambert
On Fri, Jan 8, 2021 at 5:34 AM Simon Riggs wrote: > On Fri, Jan 8, 2021 at 7:34 AM Simon Riggs > wrote: > > > > On Fri, Jan 8, 2021 at 7:13 AM Simon Riggs > wrote: > > > > > I've minimally rebased the patch to current head so that it compiles > > > and passes current make check. > > > > Full ve

Re: WIP: System Versioned Temporal Table

2021-01-08 Thread Andrew Dunstan
On 1/8/21 7:33 AM, Simon Riggs wrote: > > * What happens if you ask for a future time? > It will give an inconsistent result as it scans, so we should refuse a > query for time > current_timestamp. That seems like a significant limitation. Can we fix it instead of refusing the query? cheers

Re: WIP: System Versioned Temporal Table

2021-01-07 Thread Simon Riggs
On Thu, Jan 7, 2021 at 5:59 PM Simon Riggs wrote: > > On Mon, Jan 4, 2021 at 2:24 PM Masahiko Sawada wrote: > > Please also note the v7 patch cannot be applied to the current HEAD. I'm > > switching the patch as Waiting on Author. > > Surafel, please say whether you are working on this or not. I

Re: WIP: System Versioned Temporal Table

2021-01-07 Thread Simon Riggs
On Mon, Jan 4, 2021 at 2:24 PM Masahiko Sawada wrote: > Please also note the v7 patch cannot be applied to the current HEAD. I'm > switching the patch as Waiting on Author. Surafel, please say whether you are working on this or not. If you need help, let us know. On Tue, 7 Jan 2020 at 10:33, Ky

Re: WIP: System Versioned Temporal Table

2021-01-04 Thread Masahiko Sawada
Hi Surafel, On Tue, Dec 22, 2020 at 3:01 AM Surafel Temesgen wrote: > > Hi Ryan, > > On Fri, Dec 18, 2020 at 10:28 PM Ryan Lambert wrote: >> >> On Thu, Nov 19, 2020 at 11:04 AM Surafel Temesgen >> wrote: >> >> The docs have two instances of "EndtTime" that should be "EndTime". > > > Since my f

Re: WIP: System Versioned Temporal Table

2020-12-21 Thread Surafel Temesgen
Hi Ryan, On Fri, Dec 18, 2020 at 10:28 PM Ryan Lambert wrote: > On Thu, Nov 19, 2020 at 11:04 AM Surafel Temesgen > wrote: > > The docs have two instances of "EndtTime" that should be "EndTime". > Since my first language is not english i'm glad you find only this error on doc. I will send reba

Re: WIP: System Versioned Temporal Table

2020-12-18 Thread Ryan Lambert
On Thu, Nov 19, 2020 at 11:04 AM Surafel Temesgen wrote: > > Attached is a rebased one. > regards > Surafel > Thank you for your work on this! The v7 patch fails on the current master branch. Error from make: gram.y:16695:1: error: static declaration of ‘makeAndExpr’ follows non-static declar

Re: WIP: System Versioned Temporal Table

2020-11-10 Thread Georgios Kokolatos
Hi, just a quick comment that this patch fails on the cfbot. Cheers, //Georgios

Re: WIP: System Versioned Temporal Table

2020-09-28 Thread Michael Paquier
On Tue, Jul 21, 2020 at 05:32:44PM +0300, Surafel Temesgen wrote: > Thank you for looking at it The patch is failing to apply. Could you send a rebase please? -- Michael signature.asc Description: PGP signature

Re: WIP: System Versioned Temporal Table

2020-07-18 Thread Rémi Lapeyre
Hi, thanks for working on this. I had planned to work on it and I’m looking forward to this natively in Postgres. The patch builds with the following warnings: plancat.c:2368:18: warning: variable 'name' is used uninitialized whenever 'for' loop exits because its condition is false [-Wsometimes

Re: WIP: System Versioned Temporal Table

2020-03-31 Thread Eli Marmor
Hi Surafel and the rest, I'm the owner of the Israeli meetup group of PostgreSQL, and I'm interested in Temporality and have been trying for several years a few ways to add it to PostgreSQL (all of them through extensions and external ways). I'm happy that this is done by you internally (and a lit

Re: WIP: System Versioned Temporal Table

2020-03-10 Thread David Steele
On 3/10/20 9:00 AM, Surafel Temesgen wrote: On Tue, Mar 3, 2020 at 9:33 PM David Steele > wrote: The patch is not exactly new for this CF but since the first version was posted 2020-01-01 and there have been no updates (except a rebase) since then

Re: WIP: System Versioned Temporal Table

2020-03-10 Thread Surafel Temesgen
Hi, On Tue, Mar 3, 2020 at 9:33 PM David Steele wrote: > Hi Surafel, > > On 1/3/20 5:57 AM, Surafel Temesgen wrote: > > Rebased and conflict resolved i hope it build clean this time > > This patch no longer applies according to cfbot and there are a number > of review comments that don't seem to

Re: WIP: System Versioned Temporal Table

2020-03-03 Thread Vik Fearing
On 03/03/2020 19:33, David Steele wrote: > Hi Surafel, > > On 1/3/20 5:57 AM, Surafel Temesgen wrote: >> Rebased and conflict resolved i hope it build clean this time > > This patch no longer applies according to cfbot and there are a number > of review comments that don't seem to have been addre

Re: WIP: System Versioned Temporal Table

2020-03-03 Thread David Steele
Hi Surafel, On 1/3/20 5:57 AM, Surafel Temesgen wrote: Rebased and conflict resolved i hope it build clean this time This patch no longer applies according to cfbot and there are a number of review comments that don't seem to have been addressed yet. The patch is not exactly new for this CF

Re: WIP: System Versioned Temporal Table

2020-01-08 Thread Vik Fearing
On 05/01/2020 13:50, Vik Fearing wrote: > Okay, now that I see your tests, I understand why everything is broken.  > You only test FROM-TO and with a really wide interval.  There are no > tests for AS OF and no tests for BETWEEN-AND. I have started working on some better test cases for you.  The

Re: WIP: System Versioned Temporal Table

2020-01-07 Thread Kyotaro Horiguchi
Hello. Isn't this patch somehow broken? At Mon, 28 Oct 2019 16:36:09 +0100, Vik Fearing wrote in > On 28/10/2019 13:48, Surafel Temesgen wrote: > > > > > > On Fri, Oct 25, 2019 at 10:45 PM Vik Fearing > > mailto:vik.fear...@2ndquadrant.com>> wrote: > > > > > > > >     I don't understan

Re: WIP: System Versioned Temporal Table

2020-01-05 Thread legrand legrand
Vik Fearing-4 wrote > On 05/01/2020 16:01, legrand legrand wrote: > > > No, that is incorrect.  The standard syntax is: > > >     FROM tablename FOR SYSTEM_TIME AS OF '...' > >     FROM tablename FOR SYSTEM_TIME BETWEEN '...' AND '...' > >     FROM tablename FOR SYSTEM_TIME FROM '...' TO '...

Re: WIP: System Versioned Temporal Table

2020-01-05 Thread Vik Fearing
On 05/01/2020 16:01, legrand legrand wrote: > >> As for the syntax, you have: >> >> >> select a from for stest0 system_time from '2000-01-01 00:00:00.0' to >> 'infinity' ORDER BY a; >> >> >> when you should have: >> >> >> select a from stest0 for system_time from '2000-01-01 00:00:00.0' to

Re: WIP: System Versioned Temporal Table

2020-01-05 Thread legrand legrand
Vik Fearing-4 wrote > On 05/01/2020 11:16, Surafel Temesgen wrote: >> >> >> On Fri, Jan 3, 2020 at 4:22 PM Vik Fearing >> < > vik.fearing@ > vik.fearing@ > >> wrote: >> > > [...] > > You only test FROM-TO and with a really wide interval.  There are no > tests for AS OF and no test

Re: WIP: System Versioned Temporal Table

2020-01-05 Thread Vik Fearing
On 05/01/2020 11:16, Surafel Temesgen wrote: > > > On Fri, Jan 3, 2020 at 4:22 PM Vik Fearing > mailto:vik.fear...@2ndquadrant.com>> wrote: > > > > > Rebased and conflict resolved i hope it build clean this time > > > > It does but you haven't included your tests file so `make check

Re: WIP: System Versioned Temporal Table

2020-01-05 Thread Surafel Temesgen
On Mon, Oct 28, 2019 at 6:36 PM Vik Fearing wrote: > On 28/10/2019 13:48, Surafel Temesgen wrote: > > > > > > On Fri, Oct 25, 2019 at 10:45 PM Vik Fearing > > mailto:vik.fear...@2ndquadrant.com>> > wrote: > > > > > > > > I don't understand what you mean by this. > > > > > > >

Re: WIP: System Versioned Temporal Table

2020-01-05 Thread Surafel Temesgen
On Fri, Jan 3, 2020 at 4:22 PM Vik Fearing wrote: > > > > Rebased and conflict resolved i hope it build clean this time > > > > It does but you haven't included your tests file so `make check` fails. > > > what tests file? i add system_versioned_table.sql and system_versioned_table.out test files

Re: WIP: System Versioned Temporal Table

2020-01-03 Thread Vik Fearing
On 03/01/2020 11:57, Surafel Temesgen wrote: > > > On Thu, Jan 2, 2020 at 12:12 AM Vik Fearing > mailto:vik.fear...@2ndquadrant.com>> wrote: > > This does not compile against current head (0ce38730ac). > > > gram.y: error: shift/reduce conflicts: 6 found, 0 expected > > > Rebased and confli

Re: WIP: System Versioned Temporal Table

2020-01-03 Thread Surafel Temesgen
On Thu, Jan 2, 2020 at 12:12 AM Vik Fearing wrote: > This does not compile against current head (0ce38730ac). > > > gram.y: error: shift/reduce conflicts: 6 found, 0 expected > > Rebased and conflict resolved i hope it build clean this time regards Surafel From 640f8fc466acc90f0e46d65f21077f6526

Re: WIP: System Versioned Temporal Table

2020-01-01 Thread Vik Fearing
On 01/01/2020 11:50, Surafel Temesgen wrote: > > > Hi, > Attached is a complete patch and also contain a fix for your comments > This does not compile against current head (0ce38730ac). gram.y: error: shift/reduce conflicts: 6 found, 0 expected -- Vik Fearing

Re: WIP: System Versioned Temporal Table

2020-01-01 Thread Surafel Temesgen
Hi, Attached is a complete patch and also contain a fix for your comments regards Surafel From 0a1e51b6fcce03014e3ee355d42443add4da7a28 Mon Sep 17 00:00:00 2001 From: Surafel Temesgen Date: Wed, 1 Jan 2020 13:27:25 +0300 Subject: [PATCH] system versioned temporal table --- doc/src/sgml/ref/alte

Re: WIP: System Versioned Temporal Table

2019-10-28 Thread Vik Fearing
On 28/10/2019 13:48, Surafel Temesgen wrote: > > > On Fri, Oct 25, 2019 at 10:45 PM Vik Fearing > mailto:vik.fear...@2ndquadrant.com>> wrote: > > > > >     I don't understand what you mean by this. > > > > > > > > The primary purpose of adding row end time to primary key is

Re: WIP: System Versioned Temporal Table

2019-10-28 Thread Surafel Temesgen
On Fri, Oct 25, 2019 at 10:45 PM Vik Fearing wrote: > > > > I don't understand what you mean by this. > > > > > > > > The primary purpose of adding row end time to primary key is to allow > > duplicate value to be inserted into a table with keeping constraint in > > current data but it can be

Re: WIP: System Versioned Temporal Table

2019-10-25 Thread Vik Fearing
On 25/10/2019 11:56, Surafel Temesgen wrote: > > > On Thu, Oct 24, 2019 at 6:49 PM Vik Fearing > mailto:vik.fear...@2ndquadrant.com>> wrote: > > On 24/10/2019 16:54, Surafel Temesgen wrote: > > > > hi Vik, > > On Wed, Oct 23, 2019 at 9:02 PM Vik Fearing > >

Re: WIP: System Versioned Temporal Table

2019-10-25 Thread Surafel Temesgen
On Thu, Oct 24, 2019 at 6:49 PM Vik Fearing wrote: > On 24/10/2019 16:54, Surafel Temesgen wrote: > > > > hi Vik, > > On Wed, Oct 23, 2019 at 9:02 PM Vik Fearing > > mailto:vik.fear...@2ndquadrant.com>> > wrote: > > > > > > > > If we're going to be implicitly adding stuff to the PK, we also >

Re: WIP: System Versioned Temporal Table

2019-10-24 Thread Vik Fearing
On 24/10/2019 16:54, Surafel Temesgen wrote: > > hi Vik, > On Wed, Oct 23, 2019 at 9:02 PM Vik Fearing > mailto:vik.fear...@2ndquadrant.com>> wrote: >   > > > If we're going to be implicitly adding stuff to the PK, we also > need to > add that stuff to the other unique constraints, no? 

Re: WIP: System Versioned Temporal Table

2019-10-24 Thread Surafel Temesgen
hi Vik, On Wed, Oct 23, 2019 at 9:02 PM Vik Fearing wrote: > > If we're going to be implicitly adding stuff to the PK, we also need to > add that stuff to the other unique constraints, no? And I think it > would be better to add both the start and the end column to these keys. > Most of the tem

Re: WIP: System Versioned Temporal Table

2019-10-23 Thread Vik Fearing
On 23/10/2019 17:56, Surafel Temesgen wrote: > > Hi all , > > Temporal table is one of the main new features added in sql standard > 2011. From that I will like to implement system versioned temporal > table which allows to keep past and present data so old data can be > queried. > Excellent!  I'v