Re: missing toast table for pg_policy - Mailing list pgsql-hackers

From John Naylor
Subject Re: missing toast table for pg_policy
Date
Msg-id CAJVSVGW4gP57oOC=52q=vjspGoM7C_TEXEJG6R2r1OESpsACvQ@mail.gmail.com
Whole thread Raw
In response to Re: missing toast table for pg_policy  (Joe Conway <mail@joeconway.com>)
Responses Re: missing toast table for pg_policy
List pgsql-hackers
On 2/19/18, Joe Conway <mail@joeconway.com> wrote:
> The attached does exactly this. Gives all system tables toast tables
> except pg_class, pg_attribute, and pg_index, and includes cat version
> bump and regression test in misc_sanity.
>
> Any further discussion, comments, complaints?

Hi Joe,
There's been a little bit-rot with duplicate OIDs and the regression
test. The first attached patch fixes that (applies on top of yours).

It occurred to be that we could go further and create most toast
tables automatically by taking advantage of the fact that the toast
creation function is a no-op if there are no varlena attributes. The
second patch (applies on top of the first) demonstrates a setup where
only shared and bootstrap catalogs need to have toast declarations
specified manually with fixed OIDs. It's possible this way is more
fragile, though.

I also did some non-scientific performance testing. On my machine,
initdb takes at least:
HEAD ~1040 ms
patch ~1070 ms
with my addenda ~1075 ms

A little slower, but within the noise of variation.

-John Naylor

> Joe
>
> --
> Crunchy Data - http://crunchydata.com
> PostgreSQL Support for Secure Enterprises
> Consulting, Training, & Open Source Development
>

Attachment

pgsql-hackers by date:

Previous
From: Amit Khandekar
Date:
Subject: Re: AtEOXact_ApplyLauncher() and subtransactions
Next
From: Andrew Gierth
Date:
Subject: Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression"