New columns aren't propagating to schema cache (PGRST204)
Insert calls to my table is failing when a new column is included.
- i added column in dashboard
- the ts type def generated does include that column
- made an insert call using service role including a field for that column
- that call fails with
PGRST204
- tried to reload schema cache NOTIFY pgrst, 'reload schema';
- hit the supabase /rest/v1/
endpoint directly and got the same error
- opted out of cache when initiating supabase sdk; no luck either30 Replies
Is this more than one column? More than one table?
Check the case of the column name is an exact match with the UI column name. Make sure there is not a space at the end.
Restart the instance.
Do you have more than one instance with the same tables?
@garyaustin thx for speedy reply as always
yes triple checked the column name. exact match
wdym by restart instance? we're using hosted
On the general settings tab you can restart the instance (reboot).
Check the API Gateway log to make sure the request is getting there.
- POST call is hitting the API gateway
- can't sustain the downtime right now. will need to schedule a maintenance period
Can you post the entire message.
I'm skeptical a restart will do more than the notify would. But you should not need to do the notify anyways if you just add a column. It is mainly if you change a column name already in use.
I meant the error message back at the client. I don't see the 204 error detail in the log you posted, but it is very verbose.
You also did not say if more than one table or another column also does this.
another eng reported as well but not as detailed so i suspect more than one table.
getting you that error message now
error message
Also should probably plan on a support request. We have seen this 2 or 3 times. With the normal debug we can do not finding anything, but if I recall the OPs in those cases just never responded to last questions like they resolved it or moved on. Searched on pgrst204.
yeah i saw those. already opened support ticket
So the column name is not reserved and not in double sets of quotes like one of the other cases...
No space at end here (not sure on actual column name) and not casing issues Unless your column had an upper case in the DB.
here's the curl for that error message. used service key here
actual column name is
contact_uses_imessage
new tables use snake case & no capitalized column namesCheck the definition of the table in the UI (bottom right) to make sure name is not in quotes with a space. It is hard to tell in the UI if so.
Usually only comes up if created in the UI.
Otherwise restart/support are all I've got.

no quotes
Yeah, all looks good.
so i'm out of luck until support? will schedule a restart soon
given this is a postgrest issue, would support be able to ssh into instance and restart that service only?
No idea.
thank you anyways
tried to reload schema cache NOTIFY pgrst, 'reload schema';
When you say tried to.... do you mean that ran without error and had no affect or you got an error running it?yes ran successfully. no impact on error
You might run it again and check the PostgREST and Postgres logs for error. The notify itself would not get any error the process had. Seems like the cache is not being reset by that or the UI when it makes a column change.
oooo this is interesting
postgrest:
Make sure you add that to your support request.
I suspect a restart will mask whatever caused this.
noted. i'm on this
Can you post your ticket number here. I reached out to a dev as we have seen something like this a couple of times with no clear answer.
SU-244507
thank you so much!Seems like restart...

Note it is Postgres that has the notify bug and that has to restart not PostgREST.
ah ok thank you