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
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!
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 🤯
@@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.
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
Good catch! 🙌
really clear explanation of a tricky concept👏👏
Thanks! Glad you enjoyed it! 🙌
I genuinely did not know that you can highlight a statement in the SQL editor to just run certain statements 😂
So handy! 🎉
Why are you changing the capitalisation?
I just prefer lowercase. Upper feels too shouty! 😂
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!
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 🤯
@@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.
Thanks for the video and in-depth explanation. Now if only supabase can develop is_dodgy_user() 😂. Next release cycle , perhaps?
Yo have to implemente transaction feature to Supabase
Create a CRUD video with emphasis on UPDATE(*UPSERT*)? 🥹😭🙏🏻
On it! 🚀