Re: pg_restore error on function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Post Gresql <postgresql(at)taljaren(dot)se>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_restore error on function
Date: 2022-11-03 16:32:24
Message-ID: 2135199.1667493144@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Thu, Nov 3, 2022 at 8:39 AM Post Gresql <postgresql(at)taljaren(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2022-11-03 16:34:13 Re: pg_restore error on function
Previous Message Adrian Klaver 2022-11-03 16:01:58 Re: pg_restore error on function