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

Поиск
Список
Период
Сортировка
От Erik Wienhold
Тема Re: How to schema-qualify "IS DISTINCT FROM" on trigger definition? (I created a db that cannot be dump/restored)
Дата
Msg-id rmwdrltozklpx6aqjef6cdces3f4pcebuilx45wp3xyur3qonj@slgnxj3a6y34
обсуждение исходный текст
Ответ на Re: How to schema-qualify "IS DISTINCT FROM" on trigger definition? (I created a db that cannot be dump/restored)  (Vick Khera <vivek@khera.org>)
Ответы Re: How to schema-qualify "IS DISTINCT FROM" on trigger definition? (I created a db that cannot be dump/restored)
Список pgsql-general
On 2024-02-22 22:14 +0100, Vick Khera wrote:
> On Wed, Feb 21, 2024 at 4:27 PM Tom Lane <tgl@sss.pgh.pa.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.

You may also try the equivalent CASE expression in the WHEN clause.

https://wiki.postgresql.org/wiki/Is_distinct_from#Writing_with_CASE_statements

-- 
Erik



В списке pgsql-general по дате отправления:

Предыдущее
От: Tamal Saha
Дата:
Сообщение: Postgres 16 missing from apt repo?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Postgres 16 missing from apt repo?