Subject: Re: Errors when restoring backup created by pg_dumpall

From: Tom Lane <[email-masked]>
Date: Sun, 01 Dec 2024 15:15:09 -0500

PopeRigby <[email-masked]> writes:
> I've applied the following patch to postgres:
> https://www.postgresql.org/message-id/attachment/122092/0002-earthdistance-sql-functions.patch

Cool.  You did actually install the new scripts into your target
installation, right?

> I'm still getting this error:
> psql:all.sql:4102: ERROR:  type "earth" does not exist
> LINE 1: ...ians($1))*sin(radians($2))),earth()*sin(radians($1)))::earth

Hmmm ... a pg_dumpall output script shouldn't really contain that
function body directly; it should just say "CREATE EXTENSION
earthdistance".  Is it possible that this database is so old that
it contains a pre-extension (pre-9.1) version of earthdistance?

			regards, tom lane

---

From: PopeRigby <[email-masked]>
Date: Mon, 2 Dec 2024 15:21:04 -0800

> Cool.  You did actually install the new scripts into your target

Oh, is applying the patch and rebuilding PostgreSQL not enough?

---

From: Tom Lane <[email-masked]>
Date: Mon, 02 Dec 2024 20:17:21 -0500

> Oh, is applying the patch and rebuilding PostgreSQL not enough?

Not unless you did "make install" in the contrib/earthdistance
directory (or something wider-scope that would invoke that).

			regards, tom lane

---

From: PopeRigby <[email-masked]>
Date: Tue, 3 Dec 2024 21:13:42 -0800

> directory (or something wider-scope that would invoke that).

Well, I did actually compile PostgreSQL after applying the patch.