Re: pgsql: Refactor attribute mappings used in logical tupleconversion - Mailing list pgsql-committers

From Michael Paquier
Subject Re: pgsql: Refactor attribute mappings used in logical tupleconversion
Date
Msg-id 20191218101338.GB325369@paquier.xyz
Whole thread Raw
In response to pgsql: Refactor attribute mappings used in logical tuple conversion  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pgsql: Refactor attribute mappings used in logical tuple conversion  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

Attachment

pgsql-committers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: pgsql: Partially deduplicate interrupt handling for background processe
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Refactor attribute mappings used in logical tuple conversion