pg_restore error on function

Поиск
Список
Период
Сортировка
От Post Gresql
Тема pg_restore error on function
Дата
Msg-id 32b7cafd-e649-5478-017d-766036a2afbd@taljaren.se
обсуждение исходный текст
Ответы Re: pg_restore error on function  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: pg_restore error on function  (Ron <ronljohnsonjr@gmail.com>)
Список pgsql-general
Hello

I first successfully ran

pg_dump -U postgres -b -E UTF8 -f my_dump --format=custom -n my_schema --no-owner -v my_db

but then

pg_restore --single-transaction -v -U postgres -O -e -d my_other_db my_dump

failed with

pg_restore: connecting to database for restore
pg_restore: creating FUNCTION "my_schema.update_b()"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 7142; 1255 8618854 FUNCTION update_b() previous_owner
pg_restore: [archiver (db)] could not execute query: ERROR:  schema my_schema" does not exist
     Command was: CREATE FUNCTION "my_schema".update_b() RETURNS void
     LANGUAGE plpgsql
     AS $$
             BEGIN
             PERFORM pg_advisory_xact_lock(1);

             INSERT INTO ...;
             END;
             $$;


This is PG version 10.19

Is there a solution for this (apart from upgrading to a newer PG version)?

The only workaround I can think of is to dump in plain text and then edit the dump file.



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

Предыдущее
От: Ron
Дата:
Сообщение: Re: unable to install postgreql 13.4
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_restore error on function