Refactor construct_array() and deconstruct_array() for built-in types - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Refactor construct_array() and deconstruct_array() for built-in types
Date
Msg-id 2914356f-9e5f-8c59-2995-5997fc48bcba@enterprisedb.com
Whole thread Raw
Responses Re: Refactor construct_array() and deconstruct_array() for built-in types  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
[for PG16]

There are many calls to construct_array() and deconstruct_array() for 
built-in types, for example, when dealing with system catalog columns. 
These all hardcode the type attributes necessary to pass to these functions.

To simplify this a bit, add construct_array_builtin(), 
deconstruct_array_builtin() as wrappers that centralize this hardcoded 
knowledge.  This simplifies many call sites and reduces the amount of 
hardcoded stuff that is spread around.

I also considered having genbki.pl generate lookup tables for these 
hardcoded values, similar to schemapg.h, but that ultimately seemed 
excessive.

Thoughts?

Attachment

pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit
Next
From: Pavel Stehule
Date:
Subject: strange slow query - lost lot of time somewhere