Re: Errors when restoring backup created by pg_dumpall
PopeRigby <poperigby@mailbox.org>
From: PopeRigby <poperigby@mailbox.org>
To: Tom Lane <tgl@sss.pgh.pa.us>,
"David G. Johnston" <david.g.johnston@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>,
"pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
Date: 2024-12-01T20:05:03Z
Lists: pgsql-general
On 11/30/24 19:58, Tom Lane wrote: > "David G. Johnston" <david.g.johnston@gmail.com> writes: >> Ok, so the error is not emanating from your code but rather the body of the >> ll_to_earth function defined in the earthdistance extension. > Yeah. That is > > CREATE FUNCTION ll_to_earth(float8, float8) > RETURNS earth > LANGUAGE SQL > IMMUTABLE STRICT > PARALLEL SAFE > AS 'SELECT cube(cube(cube(earth()*cos(radians($1))*cos(radians($2))),earth()*cos(radians($1))*sin(radians($2))),earth()*sin(radians($1)))::earth'; > > which is problematic: the function calls are not schema-qualified and > there's not a really easy way to fix that. There's work afoot to fix > that [1], but it's not committed yet let alone in any shipping > version. Nonetheless, your best bet for fixing this might be > to install the earthdistance 1.2 files from the latest patchset in > that thread. > > regards, tom lane > > [1] https://www.postgresql.org/message-id/flat/3395418.1618352794@sss.pgh.pa.us I've applied the following patch to postgres: https://www.postgresql.org/message-id/attachment/122092/0002-earthdistance-sql-functions.patch 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
Commits
-
contrib/earthdistance: Use SQL-standard function bodies.
- 969bbd0fafc0 18.0 landed
- 3652de36e432 17.3 landed
- 31daa10facec 16.7 landed