Re: search_path for replica-mode

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: search_path for replica-mode
Дата
Msg-id CAKFQuwZtTwMrus2+8_5J-ReLckyH4LSnwtHCcLR1UrRK8YxNOg@mail.gmail.com
обсуждение исходный текст
Ответ на search_path for replica-mode  (André Kutepow <a.kutepow@prodat-sql.de>)
Ответы Re: search_path for replica-mode  (André Kutepow <a.kutepow@prodat-sql.de>)
Список pgsql-general
On Monday, July 10, 2023, André Kutepow <a.kutepow@prodat-sql.de> wrote:
There is a trigger in the database
SET search_path TO "$user", public;

CREATE OR REPLACE FUNCTION art__a_iu_func()
BEGIN
  INSERT INTO table_z...   --»table_z« is in schema public
END;

CREATE OR REPLACE TRIGGER art__a_iu
    AFTER INSERT OR UPDATE OF ak_nr
    ON art
    FOR EACH ROW
    EXECUTE FUNCTION art__a_iu_func();
In a regular trigger, it works great!
But, if I announce it, as:
ALTER TABLE art ENABLE REPLICA TRIGGER art__a_iu;
then I get an error:
FEHLER:  Relation »table_z« existiert nicht bei Zeichen xxx
ANFRAGE:  INSERT INTO table_z...

why does'nt work the search_path for replica-mode?
is it made specifically or is it a bug?
How else can I set the search_path for replica-mode?


Relying on external search_path for system executed objects is problematic.  Don’t do it. Either attach a SET to the function or schema-qualify references.

David J.

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

Предыдущее
От: André Kutepow
Дата:
Сообщение: search_path for replica-mode
Следующее
От: Ted Toth
Дата:
Сообщение: what causes new temp schemas to be created