Tuple conversion naming - Mailing list pgsql-hackers

From Andres Freund
Subject Tuple conversion naming
Date
Msg-id 20181002061156.rujqtw73jnskq2qx@alap3.anarazel.de
Whole thread Raw
Responses Re: Tuple conversion naming  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
Hi,

The naming around partition related tuple conversions is imo worthy of
improvement.

For building tuple conversion maps we have:
- convert_tuples_by_name
- convert_tuples_by_name_map
- convert_tuples_by_position
- ExecSetupChildParentMapForLeaf
- TupConvMapForLeaf
- free_conversion_map

I've a bunch of problems with this:
1) convert_tuples_by_name etc sound like they actually perform tuple
   conversion, rather than just prepare for it
2) convert_tuples_by_name_map returns not TupleConversionMap, but an
   array. But convert_tuples_by_name does return TupleConversionMap.
3) The naming is pretty inconsistent. free_conversion_map
   vs. convert_tuples_by_name, but both deal with TupleConversionMap?

For executing them we have:
- do_convert_tuple
- ConvertPartitionTupleSlot

which is two randomly differing spellings of related functionality,
without the name indicating that they, for reasons, don't both use
TupleConversionMap.  I'm also not particularly happy about
"do_convert_tuple", which is a pretty generic name.


A lot of this probably made sense at some time, but we got to clean this
up. We'll grow more partitioning related code, and this IMO makes
reading the code harder - and given the change rate, that's something I
frequently have to do.


Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Transactions involving multiple postgres foreignservers, take 2
Next
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] Transactions involving multiple postgres foreignservers, take 2