Re: BUG #17134: pg_restore ERROR: operator does not exist: util.ltree = util.ltree

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: vnykmr36(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17134: pg_restore ERROR: operator does not exist: util.ltree = util.ltree
Date: 2021-08-05 15:34:23
Message-ID: CAKFQuwZsArqyJbcL5+H56hAV9nhHNxV2vFVeWq9H2NmVxq2XJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Aug 5, 2021 at 1:49 AM PG Bug reporting form <noreply(at)postgresql(dot)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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dave Cramer 2021-08-05 15:42:43 Re: Can not cancel a call to a function that has opened a refcursor
Previous Message Tom Lane 2021-08-05 15:19:09 Re: Can not cancel a call to a function that has opened a refcursor