Amit Langote <amitlangote09@gmail.com> writes:
> On Tue, Sep 15, 2020 at 10:47 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Ah, right. That seems like a bug but we have not attempted to fix it.
> IIRC, when this behavior was brought up as a bug in past discussions,
> it was decided that it will be fixed when NOT NULL constraints are
> represented using pg_constraint entries.
Yeah, that matches my recollection too.
>> But we could restrict the optimization to partitioned tables, where
>> the assumption does hold, no?
> Yeah, seems safe in their case.
And that's sufficient to cover pg_restore's issue, since it's
only going to be trying to do this for partitioned tables.
I'll wait till tomorrow to push this, since we're still in
freeze mode for the v13 branch.
regards, tom lane