Generate column values in Postgres with Functions, Triggers, default values and RLS

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

КОМЕНТАРІ • 15

  • @dshukertjr
    @dshukertjr 8 місяців тому +9

    I genuinely did not know that you can highlight a statement in the SQL editor to just run certain statements 😂

    • @JonMeyers
      @JonMeyers 8 місяців тому

      So handy! 🎉

  • @remi-avec-un-i
    @remi-avec-un-i 8 місяців тому

    Hey Jon! First of all, thanks a lot, your explanation makes me realise why you need both "USING" & "WITH CHECK" expressions in the UPDATE.
    That being said, I realised that you went very fast on the UPDATE:
    1) A user can update a post that is not his
    2) A user can update the created_at & created_by fields

    • @JonMeyers
      @JonMeyers 7 місяців тому

      Good catch! 🙌

  • @badwolf9090
    @badwolf9090 8 місяців тому +4

    Why are you changing the capitalisation?

    • @JonMeyers
      @JonMeyers 8 місяців тому

      I just prefer lowercase. Upper feels too shouty! 😂

  • @brunocrosier
    @brunocrosier 8 місяців тому +2

    really clear explanation of a tricky concept👏👏

    • @JonMeyers
      @JonMeyers 8 місяців тому

      Thanks! Glad you enjoyed it! 🙌

  • @rembautimes8808
    @rembautimes8808 7 місяців тому

    Thanks for the video and in-depth explanation. Now if only supabase can develop is_dodgy_user() 😂. Next release cycle , perhaps?

  • @spartan_j117
    @spartan_j117 8 місяців тому

    0:56 I read somewhere on the internet, that "bigint primary key generated always as identity" is the right way to set up a primary key. Could you please throw some light on this, why did you change it to "serial", what's the difference? Thank you!

    • @JonMeyers
      @JonMeyers 7 місяців тому

      Good call! Bigserial may have been a better option - will keep this in mind for future videos 👍
      Serial translates to a 4 byte integer behind the scenes, so can still store 2,147,483,647 rows! That's a lot of blog posts! 😆
      Bigserial would take you up to 9,223,372,036,854,775,807 🤯

    • @spartan_j117
      @spartan_j117 7 місяців тому

      @@JonMeyersTy! BTW, you have an article about this in you corporate blog called "Choosing a Postgres Primary Key". And there the author references a nice post on IDENTITY column from the EDB team.

  • @excellencemichel4875
    @excellencemichel4875 7 місяців тому

    Yo have to implemente transaction feature to Supabase

  • @tamsssss6765
    @tamsssss6765 8 місяців тому +2

    Create a CRUD video with emphasis on UPDATE(*UPSERT*)? 🥹😭🙏🏻