Skip to content

Supporting temporal data with WITHOUT OVERLAPS and PERIOD #2097

Closed
3 of 3 issues completed
Closed

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added this to the 7.0.0 milestone on Nov 12, 2021
  2. evman182 commented on Jul 1, 2022

    @evman182

    Is this still on your radar for 7.0? Temporal tables is a possible solution for something I'm working on, and frankly, I'd love to avoid needing to justify the financial and development time costs of trying to migrate from PG to SQL Server

  3. roji commented on Jul 2, 2022

    @roji
    MemberAuthor

    It's unfortunately unlikely that I'll be able to do this for 7.0... One reason I'm a bit hesitant about doing this, is that it's unclear to what extent the above extension is up-to-date and the "final" temporal table support for PG; see notably this about possible movement for PG15. So it may be worth holding back on implementation until something more official makes it in.

    However, it's probably possible to implement some scenarios with the temporal extension even without EF support - you may not actually need EF Core itself to know about temporal tables. Table creation can be managed with raw SQL in migrations (to add the temporal component), and as long as EF Core itself is used to query up-to-date date only, it doesn't need to be aware of the temporality. In other words, if the idea is for the application to access up-to-date data and use the temporal table as a manually-accessed audit or log, then things should be possible without any EF Core support.

  4. modified the milestones: 7.0.0, Backlog on Jul 2, 2022
  5. evman182 commented on Jul 3, 2022

    @evman182

    I was reading the email thread about the PG patch a few days ago. Unfortunately it doesn't seem to be anywhere near getting merged.

    Unfortunately the use case for which I'm looking to use temporal tables requires accessing them as part of the regular functions of the application.

  6. roji commented on Jul 3, 2022

    @roji
    MemberAuthor

    @evman182 I understand, and I'm sorry there aren't better news on this at the moment. You should hopefully be able to get by with raw SQL in EF Core for the temporal syntax - remember you can use that for the basic temporal query and then compose other LINQ query operators on top.

  7. ps-nk commented on Apr 20, 2023

    @ps-nk
  8. roji commented on Apr 20, 2023

    @roji
    MemberAuthor

    @nk-cmd thanks. It's good to know that there's progress there, but I'm still reluctant to do the substantial work needed to support temporal tables on an unofficial extension etc.

  9. domagojmedo commented on Apr 20, 2023

    @domagojmedo

    Is there any issue to track for this becoming an official feature of postgre?

  10. roji commented on Apr 20, 2023

    @roji
    MemberAuthor

    @domagojmedo are you referring to the temporal_tables extension linked to above? If so, I have no idea (and that isn't really related to this repo in any way).

  11. domagojmedo commented on Apr 20, 2023

    @domagojmedo

    Yes, I understand it's not related to this repo. I was just following up on your comment that you won't do any work for unofficial extension (which is completely understandable).
    I was just wondering if you maybe know if this feature is even in consideration to be implemented as official postgre feature

  12. BenjamynWilliams-IconGroup commented on Jun 16, 2023

    @BenjamynWilliams-IconGroup

    This hasn't seen an update in a few years, what's the update on this?

  13. roji commented on Jun 16, 2023

    @roji
    MemberAuthor

    @BenjamynWilliams-IconGroup the situation hasn't really changed on the PG side - AFAIK there's no official temporal tables feature; see the comments above, they're all still valid.

  14. 12 remaining items

  15. changed the issue type fromtoon Jan 23, 2026
  16. changed the title [-]Look into supporting temporal data[/-] [+]Supporting temporal data with WITHOUT OVERLAPS and PERIOD[/+] on Jan 24, 2026
  17. self-assigned this
    on Jan 24, 2026
  18. roji commented on Jan 25, 2026

    @roji
    MemberAuthor

    Support for WITHOUT OVERLAPS and PERIOD has been implemented for version 11 - you'll be able to use it once the first 11 preview comes out, which should be quite soon; but if you want to try it out, please use the daily build (really simple to set up and very safe).

    The support has been documented here, take a look and definitely comment if you have any feedback.

    For now, I think that this "low level support" concludes the support in the EF provider. As written above, we could consider a high-level experience more akin to what SQL Server provides, but that would be a very different kind of feature, possibly beyond what an EF provider is supposed to provide (an extension could probably built on top of the low-level support introduced here to do that). FWIW I believe that the PG "first principles" approach of providing the lower-level primitives rather than a specific higher-level experience is the better way to build things like this, but it's clear that the full SQL Server-like "temporal table" (where applications just query/delete with the temporal stuff happening behind the scenes) is also very valuable.

  19. andrewbabbittdev commented on Jan 26, 2026

    @andrewbabbittdev

    Id assume some of the future expansions could be utilities like SQL Servers TemporalAll, TemporalBetween, and TemporalAsOf? Though this should be simpler to do in Postgres

  20. roji commented on Jan 27, 2026

    @roji
    MemberAuthor

    @andrewbabbittdev PostgreSQL doesn't exactly have these concepts, but you should already be able to express the same things via regular range operations (which were already supported before this feature). For example, TemporalAsOf in SQL Server is the same as range.Contains(i) on the range column (see docs). It may make sense to explore a general cross-provider abstraction here, but it's most likely too early for that.

  21. andrewbabbittdev commented on Jan 27, 2026

    @andrewbabbittdev

    Yeah no I knew we had ways to do it, but yes I was thinking more along the lines of what this looks like at a cross provider level :)

    This is a fantastic start though and much earlier than I was expecting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions