We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi
I get the invalid reference to FROM-clause entry for table error just searching an entity by ID:
invalid reference to FROM-clause entry for table
conn.WithContext(ctx).Q().Find(&row, id)
I've made some investigations and found that pop incorrectly formats query for Postgres schema tables.
pop
It uses table alias while formatting SELECT clause, but forgets about that in WHERE.
SELECT
WHERE
Pop should execute: SELECT schema_table.xxx FROM schema.table AS schema_table WHERE schema_table.id = $1 LIMIT 1
SELECT schema_table.xxx FROM schema.table AS schema_table WHERE schema_table.id = $1 LIMIT 1
Pop tries to execute: SELECT schema_table.xxx FROM schema.table AS schema_table WHERE schema.table.id = $1 LIMIT 1
SELECT schema_table.xxx FROM schema.table AS schema_table WHERE schema.table.id = $1 LIMIT 1
Ubuntu 20.04, Pop v5.2.4, PSQL
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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 inWHERE
.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
The text was updated successfully, but these errors were encountered: