-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow a custom sys_period
to be specified during INSERT
#6
Comments
Hi, thanks for getting in touch and sorry for the late reply. I have three thoughts on this issue:
|
|
I just found this and seem to have a similar requirement. I detailed it in an issue at arkhipov/temporal_tables#41 As to how the c version handles this currently: it ignores any data passed to the (Thanks @MHova for the PR code, I believe I can understand this enough to use as a starting point for a simple hackjob - unlike the c code. 👍 ) |
I'm going to close this, as I'm not convinced about this feature. The use case described can be achieved through populating the tables before adding the versioning trigger (or by temporarily disabling it). On the other side, I'm afraid giving the user this option may result in unexpected errors and inconsistencies in the history table. I'd prefer to keep the (plus, this is super old) I'm open to revisit this decision if a new valid use case arise and/or the original extension also adds this feature. |
First of all, thanks for creating this great project!
The
versioning()
function currently interceptsUPDATE
andINSERT
operations to overwrite thesys_period
column in the main table with[now, NULL)
. This makes perfect sense forUPDATE
s as we want the function to managesys_period
for us. However doing this onINSERT
created some problems for my use case:creation
dates on the existing data and thus would like to initialize thesys_period
to[original_creation_date, NULL)
for all the rows. But of course, my efforts are thwarted by the logic inversioning()
.sys_period
column in the main table schema.I would like to update
versioning()
to only managesys_period
forUPDATE
. ForINSERT
, the client can either specify a custom value or use the default value, which will likely be[now, NULL)
anyway.I have a PR ready for submission if you agree with this change.
The text was updated successfully, but these errors were encountered: