Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tHruW-00AOqJ-R7 for pgsql-general@arkaria.postgresql.org; Sun, 01 Dec 2024 21:55:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tHruU-00BMvb-Am for pgsql-general@arkaria.postgresql.org; Sun, 01 Dec 2024 21:55:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tHruT-00BMvT-Vz for pgsql-general@lists.postgresql.org; Sun, 01 Dec 2024 21:55:23 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tHruS-000XnJ-DW for pgsql-general@postgresql.org; Sun, 01 Dec 2024 21:55:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4B1Lt8LY1475513; Sun, 1 Dec 2024 16:55:08 -0500 From: Tom Lane To: Adrian Klaver cc: PopeRigby , "David G. Johnston" , "pgsql-general@postgresql.org" Subject: Re: Errors when restoring backup created by pg_dumpall In-reply-to: <4ab662d8-57cc-471f-8a58-cfd71d1cea22@aklaver.com> References: <6a6439f1-8039-44e2-8fb9-59028f7f2014@mailbox.org> <9c5ba566-27b8-4e8c-bf7d-2dc561509991@mailbox.org> <41791b6d-aaf5-4fed-9cc3-e89bc49e8637@mailbox.org> <1257068.1733025493@sss.pgh.pa.us> <06425038-e012-4bac-aec1-d9541436f893@mailbox.org> <92405f98-7f0c-4442-8252-697352daefc1@aklaver.com> <1470486.1733087658@sss.pgh.pa.us> <4ab662d8-57cc-471f-8a58-cfd71d1cea22@aklaver.com> Comments: In-reply-to Adrian Klaver message dated "Sun, 01 Dec 2024 13:36:36 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1475511.1733090108.1@sss.pgh.pa.us> Date: Sun, 01 Dec 2024 16:55:08 -0500 Message-ID: <1475512.1733090108@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: > On 12/1/24 13:14, Tom Lane wrote: >> It would be useful to know what is the command at line 4102 >> of all.sql. > It is here: > https://gist.github.com/poperigby/fcb59eb6c22c6051800e06a0ec482b49 > CREATE TABLE public.geodata_places ( > id integer NOT NULL, > name character varying(200) NOT NULL, > longitude double precision NOT NULL, > latitude double precision NOT NULL, > "countryCode" character(2) NOT NULL, > "admin1Code" character varying(20), > "admin2Code" character varying(80), > "modificationDate" date NOT NULL, > "earthCoord" public.earth GENERATED ALWAYS AS > (public.ll_to_earth(latitude, longitude)) STORED, > "admin1Name" character varying, > "admin2Name" character varying, > "alternateNames" character varying > ); Ah! Then the failure occurs because we do a planning pass on the GENERATED expression (I don't remember exactly why that's needed during CREATE TABLE). So maybe messing with the dump script's search_path setting *would* be enough to get you past that. Having said that, the CREATE should have been seeing the new-style definition of ll_to_earth() if the 1.2 version of earthdistance was correctly installed. regards, tom lane