Re: GenBKI emits useless open;close for catalogs without rows - Mailing list pgsql-hackers

From Matthias van de Meent
Subject Re: GenBKI emits useless open;close for catalogs without rows
Date
Msg-id CAEze2Wg=fce=3cw7QUF6Aa7WEZLi1DD3D3PW_4XaKRmzRuK+Og@mail.gmail.com
Whole thread Raw
In response to Re: GenBKI emits useless open;close for catalogs without rows  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On Fri, 1 Sept 2023 at 19:43, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> On 2023-Sep-01, Matthias van de Meent wrote:
>
> > A potential addition to the patch would to stop manually closing
> > relations: initdb and check-world succeed without manual 'close'
> > operations because the 'open' command auto-closes the previous open
> > relation (in boot_openrel). Testing also suggests that the last opened
> > relation apparently doesn't need closing - check-world succeeds
> > without issues (incl. with TAP enabled). That is therefore implemented
> > in attached patch 2 - it removes the 'close' syntax in its entirety.
>
> Hmm, what happens with the last relation in the bootstrap process?  Is
> closerel() called via some other path for that one?

There is a final cleanup() call that closes the last open boot_reldesc
relation (if any) at the end of BootstrapModeMain, after boot_yyparse
has completed and its changes have been committed.

- Matthias



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: GenBKI emits useless open;close for catalogs without rows
Next
From: Nathan Bossart
Date:
Subject: Re: Inefficiency in parallel pg_restore with many tables