Re: pgsql: Refactor attribute mappings used in logical tuple conversion

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Refactor attribute mappings used in logical tuple conversion
Date: 2019-12-18 10:13:38
Message-ID: 20191218101338.GB325369@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Wed, Dec 18, 2019 at 07:25:49AM +0000, Michael Paquier wrote:
> Refactor attribute mappings used in logical tuple conversion
>
> Tuple conversion support in tupconvert.c is able to convert rowtypes
> between two relations, inner and outer, which are logically equivalent
> but have a different ordering or even dropped columns (used mainly for
> inheritance tree and partitions). This makes use of attribute mappings,
> which are simple arrays made of AttrNumber elements with a length
> matching the number of attributes of the outer relation. The length of
> the attribute mapping has been treated as completely independent of the
> mapping itself until now, making it easy to pass down an incorrect
> mapping length.

Hmm. All buildfarm members are happy with this change, except
prairiedog which is picky about the part in rewriteManip.h (dory is
failing now but it passed once before with this commit, longfin is
happy as well as my Mac laptop):
In file included from index.c:66:
../../../src/include/rewrite/rewriteManip.h:20: error: redefinition of
typedef 'AttrMap'
../../../src/include/access/attmap.h:38: error: previous declaration
of 'AttrMap' was here

An obvious fix would be to remove the declaration of AttrMap in
rewriteManip.h to have an inclusion of attnum.h so as rewriteManip.h
is still self-compilable, but I thought that we only wanted a
dependency to parsenodes.h there. Any thoughts?
--
Michael

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-12-18 14:37:33 Re: pgsql: Refactor attribute mappings used in logical tuple conversion
Previous Message Thomas Munro 2019-12-18 08:16:43 Re: pgsql: Partially deduplicate interrupt handling for background processe