Re: InsertPgAttributeTuple() and attcacheoff

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: InsertPgAttributeTuple() and attcacheoff
Date: 2018-08-17 20:20:53
Message-ID: 5a54a8b6-fdb5-1b80-acd5-1024ef44c747@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14/08/2018 17:52, Robert Haas wrote:
> On Tue, Aug 14, 2018 at 3:50 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)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.

I agree. Committed as presented then.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2018-08-17 20:38:50 Re: [HACKERS] WIP: long transactions on hot standby feedback replica / proof of concept
Previous Message Peter Geoghegan 2018-08-17 19:57:32 Re: Pre-v11 appearances of the word "procedure" in v11 docs