El 19/9/19 a las 15:57, Tom Lane
escribió:
Ekaterina Amez <ekaterina.amez@xxxxxxxxxxx> writes:
El 19/9/19 a las 10:07, Achilleas Mantzios escribió:
On 19/9/19 10:49 π.μ., Ekaterina Amez wrote:
2019-09-19 08:53:50.345 CEST [2283] postgres@template1 ERROR: could not load library "/usr/lib/postgresql/8.4/lib/plpgsql.so": /usr/lib/postgresql/8.4/lib/plpgsql.so: undefined symbol: SPI_push
This error is clearly due to trying to load the 8.4 version of plpgsql.so
into the v10 server.
Before posting here, my investigation lead me to think this was
the problem as every post I found with similar errors were all
related to newer PG trying to use old libs. But didn't know
what/how to search for this (nor how to resolve). After your
comment I suppose it can be seen in the last block of
pg_upgrade_server.log:
2019-09-19 08:53:50.345 CEST [2283] postgres@template1 ERROR: could not load library "/usr/lib/postgresql/8.4/lib/plpgsql.so": /usr/lib/postgresql/8.4/lib/plpgsql.so: undefined symbol: SPI_push
2019-09-19 08:53:50.345 CEST [2283] postgres@template1 STATEMENT: LOAD '/usr/lib/postgresql/8.4/lib/plpgsql.so'
command: "/usr/lib/postgresql/10/bin/pg_ctl" -w -D "/var/lib/postgresql/10/main" -o "-c config_file=/etc/postgresql/10/main/postgresql.conf" -m fast stop >> "pg_upgrade_server.log" 2>&1
2019-09-19 08:53:50.354 CEST [2272] LOG: received fast shutdown request
waiting for server to shut down....2019-09-19 08:53:50.358 CEST [2272] LOG: aborting any active transactions
2019-09-19 08:53:50.363 CEST [2272] LOG: worker process: logical replication launcher (PID 2278) exited with exit code 1
2019-09-19 08:53:50.364 CEST [2274] LOG: shutting down
2019-09-19 08:53:50.377 CEST [2272] LOG: database system is shut down
done
server stopped
It's running command
"/usr/lib/postgresql/10/bin/pg_ctl"
When complains with
could not load library "/usr/lib/postgresql/8.4/lib/plpgsql.so"
Right?
What seems like the likely cause is that the
pg_proc.probin entries for the plpgsql support functions were literally
"/usr/lib/postgresql/8.4/lib/plpgsql.so", rather than something that
would adapt to the new version. The preferred way to declare such
functions, for a long time, has been with probin = "$libdir/plpgsql",
relying on the server to subsitute an appropriate path for $libdir.
I've looked in pg_proc catalog and plpgsql_call_handler is
declared with probin = "$libdir/plpgsql" (only in PG10). Is the
substitution of $libdir what's wrong? Don't know how to look for
this (I've been working with Linux/Postgres for 3 months only,
so still limited ability/knowledge)
Just tested in my 11 and 10 :