Re: Regression on pg_restore to 16.0: DOMAIN not available to SQL function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Regression on pg_restore to 16.0: DOMAIN not available to SQL function
Date
Msg-id 4079327.1699290074@sss.pgh.pa.us
Whole thread Raw
In response to Re: Regression on pg_restore to 16.0: DOMAIN not available to SQL function  (Mark Hills <mark@xwax.org>)
List pgsql-hackers
Mark Hills <mark@xwax.org> writes:
> On Fri, 3 Nov 2023, Tom Lane wrote:
>> Right, so the 910eb61b2 fix explains it.  I guess I'd better
>> expand the release note entry, because we'd not foreseen this
>> particular failure mode.

> Indeed, and curiosity got the better of me so I constructed a minimal test 
> case (see below)

I checked this against 16 branch tip (about to become 16.1),
and it works, as expected.

> I assumed I'd need at least one row of data to trigger the bug (to call on 
> a default), but that's not the case and here it is with an empty table.

Right.  The step 16.0 is taking that fails is not evaluating the
default expression, but merely prepping it for execution during COPY
startup.  This error occurs while trying to inline the inline-able
outer() function.

We worked around this by skipping the expression prep step when it's
clear from the COPY arguments that we won't need it, which should
be true for all of pg_dump's uses of COPY.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Wrong security context for deferred triggers?
Next
From: Tomas Vondra
Date:
Subject: Re: PoC: prefetching index leaf pages (for inserts)