The following bug has been logged on the website:
Bug reference: 17144
Logged by: alex kozhemyakin
Email address: a.kozhemyakin@postgrespro.ru
PostgreSQL version: 14beta1
Operating system: ubuntu 20.04
Description:
When trying to upgrade PostgreSQL 13 cluster with the earthdistance
extension installed to PostgreSQL 14, I get the following error:
psql:./update_extensions.sql:2: ERROR: type earth is already a member of
extension "earthdistance"
The reproducing script:
PGBIN_OLD=/home/test/rel13
PGBIN_NEW=/home/test/rel14
PGDATA_OLD=/home/test/data_old
PGDATA_NEW=/home/test/data_new
git clone https://github.com/postgres/postgres.git postgres &&
cd ./postgres &&
git checkout REL_13_STABLE && git reset --hard HEAD && git rebase
./configure --prefix=$PGBIN_OLD
make -j2 > /dev/null && make -j2 -C contrib > /dev/null &&.
make install > /dev/null && make install -C contrib > /dev/null &&
git checkout REL_14_STABLE && rm -rf * && git reset --hard HEAD && git
rebase
./configure --prefix=$PGBIN_NEW
make -j2 > /dev/null && make -j2 -C contrib > /dev/null &&.
make install > /dev/null && make install -C contrib > /dev/null &&
cd ..
$PGBIN_OLD/bin/initdb -D $PGDATA_OLD &&.
$PGBIN_OLD/bin/pg_ctl -w -D $PGDATA_OLD -l logfile_old start &&
$PGBIN_OLD/bin/psql -c 'create extension earthdistance cascade;' postgres
&&
$PGBIN_OLD/bin/pg_ctl -w -D $PGDATA_OLD stop &&
$PGBIN_NEW/bin/initdb -D $PGDATA_NEW &&.
$PGBIN_NEW/bin/pg_upgrade -b $PGBIN_OLD/bin -d $PGDATA_OLD -B $PGBIN_NEW/bin
-D $PGDATA_NEW &&
$PGBIN_NEW/bin/pg_ctl -w -D $PGDATA_NEW -l logfile_new start &&
$PGBIN_NEW/bin/psql -f ./update_extensions.sql postgres
Removing the earthdistance extension in PG 13 before the upgrade resolves
the issue.