Error when deleting record by UUID: "invalid input syntax for type bigint"
See original GitHub issueBug report
Describe the bug
I’m unable to delete a record by its UUID (v4) from the JS SDK.
I call the function as described here
await supabase.from("objectives").delete().eq("id", "7AD4D995-DBE8-4BB6-B40E-02459086A24D");
The URL generated is: https://<...>.supabase.co/rest/v1/objectives?id=eq.7AD4D995-DBE8-4BB6-B40E-02459086A24D
The error is: invalid input syntax for type bigint: "7AD4D995-DBE8-4BB6-B40E-02459086A24D"
I don’t see what this has to do with a bigint, the field is defined as UUID 🤔
I also tried to change the id
field type from uuid
to text
but I get the same error.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create a table with the
id
column configured as UUID - Add a row with a custom UUID (v4)
- Call
supabase.from('your_table').delete().eq('id', 'your_v4_uuid')
- See error
Expected behavior
The item should be deleted without error.
Screenshots
Here is the configuration of the field.
System information
- OS: macOS
- Browser: Latest Edge
- Version of supabase-js: 2.1.3
- Version of Node.js: 16.17.0
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
ERROR: invalid input syntax for type uuid on wrong column ...
Oddly if the first field (the actual uuid ) is not a valid uuid it complains about that field. And I only have...
Read more >Failed to run sql query: invalid input syntax for type uuid - GitHub
I get it while using the UI on the basic plan of Supabase, exactly when I try to "view data" of a foreign...
Read more >Postgres support for UUID [closed]
My understanding is that Postgres supports UUID data type out-of-the-box. I'm running Postgres on Amazon RDS with Engine version 10.6 and am ...
Read more >Getting more with PostgreSQL purpose-built data types - AWS
The following steps delete the row with the invalid UUID and change the ... 'John Smith', now()); ERROR: invalid input syntax for type...
Read more >BUG #17139: Invalid input syntax for uuid (politely this time!)
In my case it was a bad copy/paste of a UUID (missing the first two characters). When I saw there was an error...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It does return “uuid”.
So i made somes tests:
Conclusion: The problem is not the table itself… it’s the table name (at least on my project).
I’ll file a ticket. Thank you for your time.
There’s no assumption of
bigint
(or any type) on the postgREST/postgrest-js side.Seeing that those duplicated names look alike, it could be that you did
select
on an old table that had the id as bigint and didupdate
on a new one.Will close this for now but if you can provide a reproduction(with a sample
CREATE TABLE..
) we’ll reopen.