Re: InsertPgAttributeTuple() and attcacheoff - Mailing list pgsql-hackers

From Robert Haas
Subject Re: InsertPgAttributeTuple() and attcacheoff
Date
Msg-id CA+Tgmob3ALDbQD0j+F9Y6Du72LCJXzjWutog8tq8dLzjXWZ=HQ@mail.gmail.com
Whole thread Raw
In response to Re: InsertPgAttributeTuple() and attcacheoff  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: InsertPgAttributeTuple() and attcacheoff
List pgsql-hackers
On Tue, Aug 14, 2018 at 3:50 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>> It seems to me that it would make sense if InsertPgAttributeTuple() were
>> to set attcacheoff to -1 instead of taking it from the caller.
>
> Looked this over, no objections.
>
> I wonder whether we should set that field to -1 when we *read*
> pg_attribute rows from disk, and be less fussed about what gets written
> out.  The only real advantage is that this'd protect us from foolish
> manual changes to pg_attribute.attcacheoff entries, but that doesn't
> seem negligible.

I wouldn't object to forcibly writing in -1 when we read the data, but
I don't think it's a good idea to let values other than -1 get written
to the disk.  User-visible random nonsense in system catalogs seems
like too much of a foot-gun to me.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Expression errors with "FOR UPDATE" and postgres_fdw withpartition wise join enabled.
Next
From: Michael Paquier
Date:
Subject: Re: Improve behavior of concurrent ANALYZE/VACUUM