"Postgres can manage this data rule easily" "Nah - let the programmer write dozens of lines of code and redo the basic logic. Sure they might get it wrong, but it's why we pay them"
Interesting, I've not worked with PostgreSQL before. That range datatype looks very useful. Would that check on the slot column need a couple of additional predicates to also make sure the upper and lower times did not also have a non-zero second or fraction of a second components? Something like "date_trunc('minute', upper(slot)) = upper(slot) and date_trunc('minute', lower(slot)) = lower(slot)"?
Good question! I think there would be some integer rounding in there but I didn't think about checking the exact time stamp (seconds and millies). Hmm...
Really interesting video. The first thing that crossed my mind is to relegate responsibility to the backend, it blows my mind that you could have that kind of logic in postgres.
This is the BEST tutorial I've seen on the internet for Postgres constraints!
Wow, love having this type of domain logic at the db layer
"Postgres can manage this data rule easily"
"Nah - let the programmer write dozens of lines of code and redo the basic logic. Sure they might get it wrong, but it's why we pay them"
Your channel is underrated, but im glad that i found this
Interesting problem and equally an interesting solution using Postgres. You are awesome Rob!
Had no idea this was possible, very impressive
Interesting, I've not worked with PostgreSQL before. That range datatype looks very useful. Would that check on the slot column need a couple of additional predicates to also make sure the upper and lower times did not also have a non-zero second or fraction of a second components? Something like "date_trunc('minute', upper(slot)) = upper(slot) and date_trunc('minute', lower(slot)) = lower(slot)"?
Good question! I think there would be some integer rounding in there but I didn't think about checking the exact time stamp (seconds and millies). Hmm...
PostgreSQL is Awesome 🤯
Super video! "exclude" is pure magic.
Suggestion: fade out the music quicker - it was a bit distracting.
great video I just wish the music was a bit lower volume
Really interesting video. The first thing that crossed my mind is to relegate responsibility to the backend, it blows my mind that you could have that kind of logic in postgres.
Whats the software you are using for run queries?
Postico - I think I mentioned at some point in there...
@@rconery found it
Nice trick.