Re: BUG #17720: pg_dump creates a dump with primary key that cannot be restored, when specifying 'using index ...'

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "zedaardv(at)drizzle(dot)com" <zedaardv(at)drizzle(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17720: pg_dump creates a dump with primary key that cannot be restored, when specifying 'using index ...'
Date: 2022-12-15 13:18:05
Message-ID: 9566C00C-6A3B-4CC7-8C7C-1A0477A5C752@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On 15 Dec 2022, at 00:27, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
>> The attached prohibits the use of NULLS NOT DISTINCT for backing primary key
>> constraints but allow them for unique constraints. Is this along the lines of
>> what you had in mind?
>
> Needs more than zero comments in the code, and why bother testing
> is_alter_table in index_check_primary_key? We're disallowing
> this case across-the-board, no matter how you get to it.

That was an, admittedly poor, attempt at self-documenting code. Removed and
comments added in the attached.

--
Daniel Gustafsson https://vmware.com/

Attachment Content-Type Size
v2-0001-Disallow-NULLS-NOT-DISTINCT-indexes-for-primary-k.patch application/octet-stream 4.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Vik Fearing 2022-12-15 15:30:36 Re: BUG #17720: pg_dump creates a dump with primary key that cannot be restored, when specifying 'using index ...'
Previous Message Etsuro Fujita 2022-12-15 12:33:31 Re: BUG #17713: Assert with postgres_fdw in v12