Re: BUG #17134: pg_restore ERROR: operator does not exist: util.ltree = util.ltree - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #17134: pg_restore ERROR: operator does not exist: util.ltree = util.ltree
Date
Msg-id CAKFQuwZsArqyJbcL5+H56hAV9nhHNxV2vFVeWq9H2NmVxq2XJQ@mail.gmail.com
Whole thread Raw
In response to BUG #17134: pg_restore ERROR: operator does not exist: util.ltree = util.ltree  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #17134: pg_restore ERROR: operator does not exist: util.ltree = util.ltree  (vinay kumar <vnykmr36@gmail.com>)
List pgsql-bugs
On Thu, Aug 5, 2021 at 1:49 AM PG Bug reporting form <noreply@postgresql.org> wrote:
Any other easy method available to fix this issue with search_path?

The direct solution here is to rewrite the expression, avoiding "IS DISTINCT FROM":

not("new"."path" operator("util".=) "old"."path") and (coalesce("new"."path", "old"."path") is not null)

This is needed because you need to schema-qualify the location of the = operator which requires using the "operator(...)" syntax.

That said, it might be easier, if less performant, to remove the WHEN condition and place an equivalent expression within the trigger function itself.  If the function is defined with a "SET search_path" clause that should ensure that the function body is evaluated with the "util" schema in the search_path and thus the "util".= operator will be found.

David J.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Can not cancel a call to a function that has opened a refcursor
Next
From: Dave Cramer
Date:
Subject: Re: Can not cancel a call to a function that has opened a refcursor