Sudently relation between tables "does not exist"
See original GitHub issueBug report
Describe the bug
I Have the following query:
id,
user (
first_name,
last_name
),
created_at,
appointments:appointments.specialist (count),
account (
balance
)
It was working since the 17 of september of 2021 until this morning, no changes were made to this code since that date. And the request is responding “column specialists.appointments does not exist”.
Here’s the CURL generated by the frontend:
curl '.../specialists?select=id%2Cuser%28first_name%2Clast_name%29%2Ccreated_at%2Cappointments%3Aappointments.specialist%28count%29%2Caccount%28balance%29&deleted=eq.false&offset=0&limit=5'
Using the supabase-js library:
supabase
.from('specialists')
.select(
`
id,
user (
first_name,
last_name
),
created_at,
appointments:appointments.specialist (count),
account (
balance
)
`).eq('deleted', false)
If this “appointments:appointments.specialist(count)
” is eliminated the query works
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create a table called “specialists” or whatever you want
- Create a second table called “appointments” or whatever you want and add a releation between this table and the first one. It can be “specialist -> specialists.id”
- Fetch the table “specialist” and join with "appointments.
Expected behavior
A success request as it was before
Screenshots
The curl request from insomnia:
The relation in “appointments”:
System information
- macOS and Windows
- chrome, firefox
- Version of supabase-js: ^1.22.4
- Version of Node.js: v14.17.5
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Cannot simply use PostgreSQL table name ("relation does not ...
From what I've read, this error means that you're not referencing the table name correctly. One common reason is that the table is...
Read more >SQL Error: relation "schema.table" does not exist"
This error message can appear when a table no longer exists but still shows in the list of tables for this schema.
Read more >Flow suddenly cannot access Excel table
Hi I have a flow set up which takes Form responses and puts them in an Excel table. This has been running for...
Read more >Postgres : Relation does not exist error
But when I try to fire a select * query, it gave me this error: dump=> select * from Approvals; ERROR: relation "approvals"...
Read more >Solved: Can´t create a relationship between two columns be...
one of that column must have unique product numbers. you can't have Many to Many relation but only One to Many or Many...
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
@steve-chavez it did work!! So the issue was related with the new version of postgrest.
Thank you
@tavoohoh Can you change
appointments.specialist
toappointments!specialist
? As in:Btw, if you only do
appointments(count)
now, this should show a more friendlier error message suggesting the above syntax.