Consolidate ItemPointer to Datum conversion functions

Started by Peter Eisentrautabout 3 years ago4 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Instead of defining the same set of macros several times, define it once
in an appropriate header file. In passing, convert to inline functions.

Attachments:

0001-Consolidate-ItemPointer-to-Datum-conversion-function.patchtext/plain; charset=UTF-8; name=0001-Consolidate-ItemPointer-to-Datum-conversion-function.patchDownload+17-10
#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Peter Eisentraut (#1)
Re: Consolidate ItemPointer to Datum conversion functions

On 06/02/2023 11:54, Peter Eisentraut wrote:

Instead of defining the same set of macros several times, define it once
in an appropriate header file. In passing, convert to inline functions.

Looks good to me. Did you consider moving PG_GETARG_ITEMPOINTER and
PG_RETURN_ITEMPOINTER, too? They're only used in tid.c, but for most
datatypes, we define the PG_GETARG and PG_RETURN macros in the same
header file as the the Datum conversion functions.

- Heikki

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Heikki Linnakangas (#2)
Re: Consolidate ItemPointer to Datum conversion functions

On 06.02.23 11:11, Heikki Linnakangas wrote:

On 06/02/2023 11:54, Peter Eisentraut wrote:

Instead of defining the same set of macros several times, define it once
in an appropriate header file.  In passing, convert to inline functions.

Looks good to me. Did you consider moving PG_GETARG_ITEMPOINTER and
PG_RETURN_ITEMPOINTER, too? They're only used in tid.c, but for most
datatypes, we define the PG_GETARG and PG_RETURN macros in the same
header file as the the Datum conversion functions.

Yeah that makes sense. Here is an updated patch for that.

Attachments:

v2-0001-Consolidate-ItemPointer-to-Datum-conversion-funct.patchtext/plain; charset=UTF-8; name=v2-0001-Consolidate-ItemPointer-to-Datum-conversion-funct.patchDownload+20-13
#4Peter Eisentraut
peter_e@gmx.net
In reply to: Peter Eisentraut (#3)
Re: Consolidate ItemPointer to Datum conversion functions

On 09.02.23 09:33, Peter Eisentraut wrote:

On 06.02.23 11:11, Heikki Linnakangas wrote:

On 06/02/2023 11:54, Peter Eisentraut wrote:

Instead of defining the same set of macros several times, define it once
in an appropriate header file.  In passing, convert to inline functions.

Looks good to me. Did you consider moving PG_GETARG_ITEMPOINTER and
PG_RETURN_ITEMPOINTER, too? They're only used in tid.c, but for most
datatypes, we define the PG_GETARG and PG_RETURN macros in the same
header file as the the Datum conversion functions.

Yeah that makes sense.  Here is an updated patch for that.

committed