Re: pg_restore error on function - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_restore error on function
Date
Msg-id 2135199.1667493144@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_restore error on function  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Thu, Nov 3, 2022 at 8:39 AM Post Gresql <postgresql@taljaren.se> wrote:
>> Could it be that the
>> create function  <schema>.<function name>
>> in the dump file does not implicitly create the schema as a
>> create table <schema>.<table name>
>> would?

> I don't know where you got the idea that a schema is implicitly created via
> create table...a schema is never implicitly created.

Indeed.

> It is unlikely, though possible (casts were just fixed in 10.20), that
> you've discovered a dependency tracking bug.  At this point you would need
> to produce and show a self-contained test case to provide further help.
> The information you have shown so far indeed looks problematic but
> insufficient to diagnose further.

Yeah.  The explanation would seem to be that pg_dump didn't dump
"CREATE SCHEMA my_schema", or that pg_restore chose to skip that
object, or that one of them mistakenly thought that the CREATE
FUNCTION should be issued first.  None of those things should happen
AFAICS, and none of them does happen in a simple test case, so
there's something going on here that we've not been shown.

            regards, tom lane



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pg_restore error on function
Next
From: Ron
Date:
Subject: Re: pg_restore error on function