N
Neon2y ago
passive-yellow

Error SQLSTATE 42703

I created a table from a django project and can successfully load data using thunder client but when I try to insert new data directly on neon.tech website I keep receiving the following error (SQLSTATE 42703). Any suggestions on what I may be doing to cause this?
5 Replies
fair-rose
fair-rose2y ago
Is any other information provided with SQLSTATE 42703? Usually this error means you're trying to update an undefined column or parameter. Could it be that your table or column name has special characters and you need to wrap them in quotes? e.g INSERT INTO Orders would fail due to the uppercase O character. You'd need to change it to INSERT INTO "Orders"
passive-yellow
passive-yellowOP2y ago
The error is saying: "column" of relation "table" does not exist. Both the table and some of the columns have "_" in the names. The fields have leading capital letters but the table is all lower case. I tried using quotes on both the table and the field names but neither seem to have made a difference.
fair-rose
fair-rose2y ago
The fields have leading capital letters but the table is all lower case.
This is likely the culprit. You need to double quote those too. Otherwise, make sure you're running the queries against the correct database branch, since it's possible you could have a branch that has a different schema.
passive-yellow
passive-yellowOP2y ago
Thank you! Double quotes on table and field names did the trick.
fair-rose
fair-rose2y ago
You’re welcome!

Did you find this page helpful?