Giter Club home page Giter Club logo

Comments (6)

df7cb avatar df7cb commented on May 30, 2024 1

I'll just drop that here without comment. :)

https://www.postgresql.org/docs/6.3/c0503.htm

from periods.

xocolatl avatar xocolatl commented on May 30, 2024

That would be a really nice feature to have in core PostgreSQL. I don't see how this extension can do it without hindering more than helping. Also, what should happen if the view uses an AS OF clause in its query? Should the AS OF on the view override it, or somehow combine them, or what?

The standard does not allow system versioning on anything but regular persistent base tables.

If you have any workable ideas on how it could be done, I'll be happy to review your patch or write one myself.

from periods.

knutwannheden avatar knutwannheden commented on May 30, 2024

I was just looking for a way to define a point in time in a single place using which all temporal tables will be queried. Oracle's flashback technology provides some mechanism like this, IIRC (but I may well be wrong about this, since it is quite some time ago I worked with Oracle flashback). Then I stumbled across this SQL Server feature, which looks really nice and thought that this would be nice for PostgreSQL and I couldn't find a better place to report this than here.

I could of course try out how SQL Server behaves if it already has an AS OF clause on some of the tables it selects from and report my results back here. But that on its own isn't very valuable, I guess...

from periods.

knutwannheden avatar knutwannheden commented on May 30, 2024

FWIW: I did perform the test now and there is an error reported when I execute the query if the view contains an AS OF clause already: SQL Error [13590] [S0001]: Temporal FOR SYSTEM_TIME clause can only be set once per temporal table. 'example' has more than one temporal FOR SYSTEM_TIME clause.

from periods.

knutwannheden avatar knutwannheden commented on May 30, 2024

The Oracle feature I was referring to is the DBMS_FLASHBACK PL/SQL package (see https://docs.oracle.com/cd/E11882_01/appdev.112/e41502/adfns_flashback.htm#ADFNS01009). It provides procedures like ENABLE_AT_TIME.

from periods.

knutwannheden avatar knutwannheden commented on May 30, 2024

MariaDB also appears to allow querying views with the AS OF clause: https://mariadb.com/kb/en/system-versioned-tables/#views-and-subqueries

Also it offers a system variable offering a feature equivalent to that of Oracle's stored procedure: https://mariadb.com/kb/en/system-versioned-tables/#views-and-subqueries

from periods.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.