supabase-js
supabase-js copied to clipboard
Newly added column doesn't exist on update, but when I fetch, it's visible
Describe the bug
I've added a new column to my users table named "onboarded". But when I try to update the column it says it doesn't exist. When I fetch the user before the update I see the column being FALSE. Updating the user without this column (updating other columns instead) works without an issue..
Expected behavior
The column exists in the database as well as when I fetch the user. I expect to be able to update it.
Screenshots
System information
"supabase": "1.150.0","@supabase/supabase-js": "2.39.8",
Check if these two SQL functions exist:
- extensions.pgrst_ddl_watch
- extensions.pgrst_drop_watch
Some migration tools might somehow drop those functions that are required for the JS client to be up2date with the db.
I think I have a similar issue. I added a column, and console.log(profile.added_column) returns undefined, but console.log(profile) returns properly with added_column in it.
Experiencing the same, inserting to a new column says:
Error updating resume: { code: "PGRST204", details: null, hint: null, message: "Column 'new_url' of relation 'hc_resumes' does not exist", }
but selecting from Table editor works fine.
Check the above comment https://github.com/supabase/supabase-js/issues/989#issuecomment-2037892631
A temporary workaround is to manually do:
NOTIFY pgrst, 'reload schema';
Hi, is there any aupdate on this, I have the same issue, I tried
NOTIFY pgrst, 'reload schema';
but It doesnt work
Running supabase self hosted.
I think I got the related issue but with SELECT
Posted on Supabase Reddit
https://www.reddit.com/r/Supabase/comments/1fnbrvs/adding_a_new_column_to_an_existing_table_leads_to/
Thanks for sharing @k0rean-rand0m. So it appears this is a NextJS caching issue:; https://www.reddit.com/r/Supabase/comments/1fnbrvs/comment/loi3xjd/.
Will close now as it's not related to supabase-js or postgREST.