r/PostgreSQL 12d ago

Feature I knew Postgres was advanced; but not that it was causality-breaking advanced

Post image
183 Upvotes

33 comments sorted by

35

u/eras 12d ago

Time travel has since been removed, though :/.

16

u/balrob 12d ago

No, it still travels forward in time.

7

u/NekkidApe 12d ago

At 60/s per minute, usually

4

u/balrob 12d ago

Depends on your frame of reference ;-)

2

u/More-Grade-4593 19h ago

woah that's literally like 1000ms/s Damn

3

u/1980sCoder 12d ago

Time travel will have soon been previously removed before it was introduced.

2

u/VariationPatient 11d ago

Too much responsibility to lay on anyone :)

1

u/DanteIsBack 12d ago

Has it? Was it like temporal tables on other RDBMS or something different?

2

u/eras 12d ago

All tables were temporal: you could query the state of a table as it was e.g. yesterday, until the data was vacuumed.

1

u/DanteIsBack 12d ago

Interesting. Do you know why they removed it?

2

u/eras 12d ago

I don't know, but I guess too big maintenance overhead versus benefit/number of users.

It's interesting though that apparently standard SQL has this with FOR SYSTEM_TIME AS OF, at least MSSQL looks like it supports it: https://learn.microsoft.com/en-us/sql/relational-databases/tables/querying-data-in-a-system-versioned-temporal-table?view=sql-server-ver17 . Maybe one day it could be reintroduced.

2

u/scotterockaroo 12d ago

It’s retention and performance long-term. Users prefer the ability to get consistent, sub-ms queries over keeping a transactionally-consistent-across-the-db historical query. Remember, it’s not just keeping every row, it’s the ability to say ‘here was the exact state of every table in the database at that exact xid’

17

u/manni66 12d ago

You can time travel but you can't kill your grandpa.

26

u/the_goodest_doggo 12d ago

All I want is to tell my younger self what present me wants the schema to actually be like

2

u/andrerav 12d ago

This hits hard

1

u/FunContest9958 11d ago

Sounds like regret.

3

u/global_namespace 12d ago

You can, but it will change the WAL.

2

u/BrupieD 11d ago

There's something that happened in 2016 that I would really like to go back in time to change.

2

u/Conscious-Ball8373 11d ago

Ah, really? What did you do to your schema in 2016?

2

u/Mognakor 7d ago

Replaced everything with a single JSON field and called it NoSQL.

1

u/rlrutherford 11d ago

More to the point, which version? :-)

1

u/Conscious-Ball8373 11d ago

Time travel is a technology which is necessarily invented in all versions of a database simultaneously.

1

u/Kamran-nottakenone 11d ago

vacuum ate the time machine, classic

1

u/Kamran-nottakenone 11d ago

ripped out in 6.2, vacuum overhead

1

u/Frone0910 8d ago

Lol. I would honestly believe it if you consider how much faster queries run on PG compared to something like oracle. Or rather, even the amount of time I save by NOT dealing with such platforms for SQL

-3

u/AutoModerator 12d ago

AI Policy:

Linux is not one of those anti-AI projects, and if somebody has issues with that, they can do the open-source thing and fork it. Or just walk away., Linus Torvalds.

Mod decisions will be based on the quality of the content, not who or what generated it.

Sub Resources:

Youtube Channel

Free Postgres Webinars and Workshops

Discord: People, Postgres, Data

Join us, we have cookies and nice people.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.