Using PostgreSQL to Handle Calendar Data Like a Freak

Поділитися
Вставка
  • Опубліковано 6 вер 2024

КОМЕНТАРІ • 16

  • @SaadKhanAhmed
    @SaadKhanAhmed 4 місяці тому +1

    This is the BEST tutorial I've seen on the internet for Postgres constraints!

  • @davidmccrea1232
    @davidmccrea1232 Рік тому +2

    Wow, love having this type of domain logic at the db layer

    • @big-machine
      @big-machine  Рік тому +1

      "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"

  • @kasvith
    @kasvith Рік тому

    Your channel is underrated, but im glad that i found this

  • @BabuAnnamalai
    @BabuAnnamalai Рік тому

    Interesting problem and equally an interesting solution using Postgres. You are awesome Rob!

  • @matteac_rs
    @matteac_rs 10 місяців тому +2

    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.

  • @ahmeddakir5000
    @ahmeddakir5000 Рік тому

    great video I just wish the music was a bit lower volume

  • @cackscrew
    @cackscrew Рік тому

    Had no idea this was possible, very impressive

  • @LifeSizeTeddyBear
    @LifeSizeTeddyBear Рік тому +1

    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)"?

    • @big-machine
      @big-machine  Рік тому

      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...

  • @byaruhaf
    @byaruhaf Рік тому

    PostgreSQL is Awesome 🤯

  • @CashCatz
    @CashCatz Рік тому

    Super video! "exclude" is pure magic.
    Suggestion: fade out the music quicker - it was a bit distracting.

  • @kasvith
    @kasvith Рік тому

    Whats the software you are using for run queries?

    • @big-machine
      @big-machine  Рік тому +1

      Postico - I think I mentioned at some point in there...

    • @kasvith
      @kasvith Рік тому

      @@big-machine found it

  • @jamesbrown68yt
    @jamesbrown68yt Рік тому

    Nice trick.