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

Unresolvable unqualified warnings #87

Open
RekGRpth opened this issue May 3, 2023 · 1 comment
Open

Unresolvable unqualified warnings #87

RekGRpth opened this issue May 3, 2023 · 1 comment

Comments

@RekGRpth
Copy link

RekGRpth commented May 3, 2023

How can I resolve these warnings?

WITH s AS (
    SELECT "id" FROM public.task AS t LEFT JOIN "pg_catalog"."pg_locks" AS l ON "locktype" OPERATOR(pg_catalog.=) 'userlock' AND "mode" OPERATOR(pg_catalog.=) 'AccessExclusiveLock' AND "granted" AND "objsubid" OPERATOR(pg_catalog.=) 4 AND "database" OPERATOR(pg_catalog.=) 1 AND "classid" OPERATOR(pg_catalog.=) ("id" OPERATOR(pg_catalog.>>) 32) AND "objid" OPERATOR(pg_catalog.=) ("id" OPERATOR(pg_catalog.<<) 32 OPERATOR(pg_catalog.>>) 32)
    WHERE "state" IN ('TAKE', 'WORK') AND l.pid IS NULL FOR UPDATE OF t skip locked
) UPDATE public.task AS t SET "state" = 'PLAN', "start" = NULL, "stop" = NULL, "pid" = NULL FROM s WHERE t.id OPERATOR(pg_catalog.=) s.id RETURNING t.id;
PS001: Unqualified operator: '=' in state IN ('TAKE', 'WORK') at line 1
PS017: Unqualified object reference: t at line 1
@svenklemm
Copy link
Member

You can fix the first issue by locking down your search_path like so: SET search_path TO pg_temp, pg_catalog;
Since the = is implicit there is no other way to explicitly specify the schema for the operator.
The 2nd seems to be a bug, since t is an alias and the actual table is fully schema-qualified it shouldnt complain here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants