Skip to content
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

invalid reference to FROM-clause entry for table #588

Open
SladeThe opened this issue Sep 3, 2020 · 0 comments
Open

invalid reference to FROM-clause entry for table #588

SladeThe opened this issue Sep 3, 2020 · 0 comments
Labels
s: triage Some tests need to be run to confirm the issue
Milestone

Comments

@SladeThe
Copy link

SladeThe commented Sep 3, 2020

Hi

I get the invalid reference to FROM-clause entry for table error just searching an entity by ID:

conn.WithContext(ctx).Q().Find(&row, id)

I've made some investigations and found that pop incorrectly formats query for Postgres schema tables.

It uses table alias while formatting SELECT clause, but forgets about that in WHERE.

Expected Behavior

Pop should execute: SELECT schema_table.xxx FROM schema.table AS schema_table WHERE schema_table.id = $1 LIMIT 1

Actual Behavior

Pop tries to execute: SELECT schema_table.xxx FROM schema.table AS schema_table WHERE schema.table.id = $1 LIMIT 1

Info

Ubuntu 20.04, Pop v5.2.4, PSQL

@sio4 sio4 added the s: triage Some tests need to be run to confirm the issue label Sep 20, 2022
@sio4 sio4 added this to the Backlog milestone Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: triage Some tests need to be run to confirm the issue
Projects
None yet
Development

No branches or pull requests

2 participants