Re: Reducing connection overhead in pg_upgrade compat check phase

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Reducing connection overhead in pg_upgrade compat check phase
Date: 2023-03-13 14:10:58
Message-ID: 89A64E5D-D3DC-4806-B038-CD493F5F5510@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 23 Feb 2023, at 15:12, Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
>
>> On 22 Feb 2023, at 20:20, Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>
>> One thing I noticed is that the
>> "failed check" log is only printed once, even if multiple data type checks
>> failed. I believe this is because this message uses PG_STATUS. If I
>> change it to PG_REPORT, all of the "failed check" messages appear. TBH I'm
>> not sure we need this message at all since a more detailed explanation will
>> be printed afterwards. If we do keep it around, I think it should be
>> indented so that it looks more like this:
>>
>> Checking for data type usage checking all databases
>> failed check: incompatible aclitem data type in user tables
>> failed check: reg* data types in user tables
>
> Thats a good point, that's better. I think it makes sense to keep it around.
>
>>> One change this brings is that check.c contains version specific checks in the
>>> struct. Previously these were mostly contained in version.c (some, like the
>>> 9.4 jsonb check was in check.c) which maintained some level of separation.
>>> Splitting the array init is of course one option but it also seems a tad messy.
>>> Not sure what's best, but for now I've documented it in the array comment at
>>> least.
>>
>> Hm. We could move check_for_aclitem_data_type_usage() and
>> check_for_jsonb_9_4_usage() to version.c since those are only used for
>> determining whether the check applies now. Otherwise, IMO things are in
>> roughly the right place. I don't think it's necessary to split the array.
>
> Will do, thanks.

The attached v3 is a rebase to handle conflicts and with the above comments
adressed.

--
Daniel Gustafsson

Attachment Content-Type Size
v3-0001-pg_upgrade-run-all-data-type-checks-per-connectio.patch application/octet-stream 36.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2023-03-13 14:15:38 Re: Add support for DEFAULT specification in COPY FROM
Previous Message Alexander Lakhin 2023-03-13 14:00:00 Re: windows CI failing PMSignalState->PMChildFlags[slot] == PM_CHILD_ASSIGNED