Re: pg_restore depending on user functions

From: Дмитрий Иванов <firstdismay(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_restore depending on user functions
Date: 2021-11-14 18:37:19
Message-ID: CAPL5KHrkVKVp22XE4S0ByA94-3OvH+9HC19WFFMePK2_c1VF0g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

Спасибо за ваш отзыв.

вс, 14 нояб. 2021 г. в 22:31, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> =?UTF-8?B?0JTQvNC40YLRgNC40Lkg0JjQstCw0L3QvtCy?= <firstdismay(at)gmail(dot)com>
> writes:
> > 1. I can determine the dependencies of the custom functions when creating
> > the pg_dump? I did not find anything suitable for SUPPORT, probably this
> is
> > not the case?
> > To recreate all of the functionality, I had to run schema recovery twice.
> > (--schema-only)
>
> Usually this is caused by being careless about search_path assumptions
> in your functions ... but with no details, it's impossible to say
> anything with certainty.
>
No, in this case it is not:
Function A using function B.
Сreating function A before function B results in a compilation error.
Function B has no dependencies and is generated without errors. The second
run of the circuit creates function A.
If I could specify a function dependency, it would change the order of
recovery

> > 2. Why is pg_restore trying to set the value of fields of type GENERATED
> > ALWAYS?
>
> Otherwise it couldn't guarantee that the rows were restored with the same
> values of the identity column that they had before. I recall that we
> had some bugs with GENERATED ALWAYS in early v10 versions, but when I try
> it now, dump/restore of a table with an identity column seems to work
> as expected. What minor release are you using?
>
PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled
by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
pg_restote, pg_dump from this build
sudo /usr/lib/postgresql/14/bin/pg_dump --file
"/home/dismay/uchet/Uchet.backup" --host "server" --port "5999" --username
"back" --no-password --verbose --format=c --quote-all-identifiers --blobs
--column-inserts --inserts --clean --create --if-exists --disable-triggers
--encoding="UTF8" "Uchet"
sudo /usr/lib/postgresql/14/bin/pg_restore --host "127.0.0.1" --port "5432"
--username "back" --no-password --dbname "Uchet" --disable-triggers
--schema-only --format=c --verbose "/home/dismay/uchet/Uchet.backup"
sudo /usr/lib/postgresql/14/bin/pg_restore --host "127.0.0.1" --port "5432"
--username "back" --no-password --dbname "Uchet" --disable-triggers
--format=c --verbose "/home/dismay/uchet/Uchet.backup"

>
> regards, tom lane
>
PS: Sorry for my english...

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-11-14 18:46:19 Re: pg_restore depending on user functions
Previous Message Tom Lane 2021-11-14 17:31:09 Re: pg_restore depending on user functions

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2021-11-14 18:46:19 Re: pg_restore depending on user functions
Previous Message Tom Lane 2021-11-14 17:31:09 Re: pg_restore depending on user functions