We are working on series of Postgres videos on this channel right now! What other Postgres concepts would you like us to cover? Let us know in the comments blow 👇
Yup, that is another awesome use case. You could extract certain values from jsonb columns as a generated column, or you could construct jsonb columns using other columns.
Geberated columns are only able to access data from the current row. So you can't use them for rollup fields or to reference another table. If you need data from another table, you're back to triggers, functions, and views
Amazing presenters of Supabase very informative videos! Would you PLEASE make a video explaining best practices for handling time + timezones in & out of Supabase ? If you could add some specifics regarding Flutterflow and how it handles the issue - and how the two could come together - apart from helping my particular non coder situation could be the ONE video on the internet that shows best practices and rules to handle the "time" issue once and for all. PLEASE! 🤞 😅 🤕
hey these new videos of yours are pretty good. keep up the good work. Oh also imo you should add your name + any other person that worked in the video in description.
I only had 1000 rows in this particular example, but yes, I should have prepared enough sample data so that I could demonstrate the execution time difference. Trust me though, querying millions of rows with this formula in the query will take a very long time without using a generated column!
Is this new or has it always been there? I think computed columns might have always been a postgres thing, but this allows me to generate unique compound ids, which i can use in conflict upsert type queries. Glad i clicked
If your use case can be done using generated column, you probably should use generated columns, but triggers have more capabilities than generated column such as reaching out to other tables. So the answer is "it depends"!
We are working on series of Postgres videos on this channel right now! What other Postgres concepts would you like us to cover? Let us know in the comments blow 👇
More computing actions scenarios data oriented so we can take advantage of backend all-in-one 🙏
I think people should explore more on postgres powers not just storing data, thanks for this
Great. Does it work with jsonb column?
Yup, that is another awesome use case. You could extract certain values from jsonb columns as a generated column, or you could construct jsonb columns using other columns.
Awesome, thank you for the quality content and great service you provide.❤
Thanks very much for this!!!!❤❤
Glad you liked it!
Geberated columns are only able to access data from the current row. So you can't use them for rollup fields or to reference another table. If you need data from another table, you're back to triggers, functions, and views
Yup, views are awesome!
Amazing presenters of Supabase very informative videos!
Would you PLEASE make a video explaining best practices for handling time + timezones in & out of Supabase ?
If you could add some specifics regarding Flutterflow and how it handles the issue - and how the two could come together - apart from helping my particular non coder situation could be the ONE video on the internet that shows best practices and rules to handle the "time" issue once and for all.
PLEASE! 🤞 😅 🤕
persistant computed columns are awesome.
hey these new videos of yours are pretty good. keep up the good work. Oh also imo you should add your name + any other person that worked in the video in description.
Great suggestion! Let me add it in!
This was very useful. Thank you very much
This was very useful, thanks!!
Awesome feature 👏🏿🙌🏿
Can you create a generated column using the supabase ui column editor
It's not quite yet supported, but hopefully in the future!
i wasted so much time with triggers and functions for small tasks like this
I have been there 😂
Same here !!!!
Same
Thanks very much.
Glad to hear you liked it!
I wish you had shown the execution time of the before and after.
I only had 1000 rows in this particular example, but yes, I should have prepared enough sample data so that I could demonstrate the execution time difference. Trust me though, querying millions of rows with this formula in the query will take a very long time without using a generated column!
@@dshukertjr Using formula took me very long time to run query and very hard to maintain. I wish i knew this 3 years ago
Is this new or has it always been there? I think computed columns might have always been a postgres thing, but this allows me to generate unique compound ids, which i can use in conflict upsert type queries. Glad i clicked
It's relatively new as it was only introduced in Posgres 12, which was released in 2019.
is there a difference, performance-wise, between this method and making functions with triggers?
Performance-wise probably not. At least nothing significant.
So not trigger or functions anymore? 😅
If your use case can be done using generated column, you probably should use generated columns, but triggers have more capabilities than generated column such as reaching out to other tables. So the answer is "it depends"!
@@dshukertjr always on point, great example u made here 🙏
do one on different type of indexes and approximate string / natural language search
Awesome suggestion! Will definitely cover the topic in the future!
How can we alter that column formula?
You can drop the existing column and add a new one with the same name in a transaction!