-
Notifications
You must be signed in to change notification settings - Fork 813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use set returning functions in from clause with ordinality #2731
Comments
SELECT sa.code as menu_code,record.code as resource_code
FROM sys_actions as sa,jsonb_to_recordset(sa.resources) AS record(code VARCHAR,resource VARCHAR)
WHERE record.resource = $1 LIMIT 1; https://play.sqlc.dev/p/029d972cfbb5084f1da6c88c9c30f963cb0e1b24c4c6eaf8b76f8e909fef69d0 |
I found the same error with the next query, trying to make queries in jsonb fields: SELECT id, y.x->>'lang' AS lang, y.x->>'name' AS gender
FROM genders g,
LATERAL (SELECT jsonb_array_elements(g.gender) AS x) AS y
WHERE g.id = $1 AND y.x->>'lang' = $2 LIMIT 1; Table alias "y" does not exist, hope to help... |
Similar to #1322 |
This is fixed in v1.23.0 by enabling the database-backed query analyzer. We added a test case for this issue so it won’t break in the future. You can play around with the working example on the playground |
Version
1.21.0
What happened?
column does not exist
Relevant log output
column "item_object" does not exist
Database schema
No response
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/4b891b0542344db335f87e02995f28a3d2d98a0b6821747938ceecf73fc38a46
What operating system are you using?
No response
What database engines are you using?
No response
What type of code are you generating?
No response
The text was updated successfully, but these errors were encountered: