Re: How to schema-qualify "IS DISTINCT FROM" on trigger definition? (I created a db that cannot be dump/restored)

From: Vick Khera <vivek(at)khera(dot)org>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to schema-qualify "IS DISTINCT FROM" on trigger definition? (I created a db that cannot be dump/restored)
Date: 2024-02-22 21:14:27
Message-ID: CALd+dccdvmt+kHor7erfSkZo+8-CKz1XM6OuVcGM8ZORPedrSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 21, 2024 at 4:27 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> For the moment, I think the only feasible solution is for your trigger
> function to set the search path it needs by adding a "SET search_path
> = whatever" clause to the function's CREATE command.

The error is not in the function, it is the WHEN clause of the trigger.
There's no way to set a search path on the trigger as far as I see.

The only option I see is to remove the WHEN clause on the trigger and wrap
my function with an IF with those same conditions. I hope this will not
result in any noticeable difference in speed.

It is rather unfortunate that one can end up with a schema that a backup
with pg_dump cannot be restored. Feel free to keep my example for
regression testing when postgres does grow the ability to schema-qualify
such operators.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2024-02-22 21:23:53 Re: Performance issue debugging
Previous Message Thomas Munro 2024-02-22 21:09:50 Re: How do you optimize the disk IO when you cannot assume a file will start at a boundary then?