Re: Errors when restoring backup created by pg_dumpall - Mailing list pgsql-general

From David G. Johnston
Subject Re: Errors when restoring backup created by pg_dumpall
Date
Msg-id CAKFQuwbe4TSU_LxsrGxgcv4DfQq2x-UNoyKx-ABy36PhvbGCdg@mail.gmail.com
Whole thread Raw
In response to Re: Errors when restoring backup created by pg_dumpall  (PopeRigby <poperigby@mailbox.org>)
Responses Re: Errors when restoring backup created by pg_dumpall
Re: Errors when restoring backup created by pg_dumpall
List pgsql-general
On Saturday, November 30, 2024, PopeRigby <poperigby@mailbox.org> wrote:
On 11/30/24 18:41, David G. Johnston wrote:
On Saturday, November 30, 2024, PopeRigby <poperigby@mailbox.org> wrote:
On 11/30/24 17:27, David G. Johnston wrote:
On Saturday, November 30, 2024, PopeRigby <poperigby@mailbox.org> wrote:
On 11/29/24 17:47, Adrian Klaver wrote:
On 11/29/24 17:34, PopeRigby wrote:

psql:all.sql:4104: ERROR:  type "earth" does not exist
LINE 1: ...ians($1))*sin(radians($2))),earth()*sin(radians($1)))::earth

QUERY:  SELECT cube(cube(cube(earth()*cos(radians($1))*cos(radians($2))),earth()*cos(radians($1))*sin(radians($2))),earth()*sin(radians($1)))::earth
CONTEXT:  SQL function "ll_to_earth" during inlining
 The earthdistance module is even getting added between the table with the earth type is added, so shouldn't there be no problem?

The fact that “earth” is not schema qualified leads me to suspect you are getting bit by safe search_path environment rules.

David J. 

Ah. How can I fix that?

Since you are past the point of fixing the source to produce valid dumps…that leaves finding the places in the text the lack the schema qualification and manually adding them in.

David J.

Oh also, it's the schema is specified as public on this line: https://gist.github.com/poperigby/fcb59eb6c22c6051800e06a0ec482b49#file-redacted_all-sql-L4111

Why is it not finding it? I queried public and earth was in there.


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.

David J.

pgsql-general by date:

Previous
From: Marco Torres
Date:
Subject: Re: Errors when restoring backup created by pg_dumpall
Next
From: PopeRigby
Date:
Subject: Re: Errors when restoring backup created by pg_dumpall