Re: generating bootstrap entries for array types

From: ilmari(at)ilmari(dot)org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=)
To: John Naylor <jcnaylor(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: generating bootstrap entries for array types
Date: 2018-07-12 15:58:58
Message-ID: d8jo9fc1m4d.fsf@dalvik.ping.uio.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi John,

John Naylor <jcnaylor(at)gmail(dot)com> writes:

>> On 4/26/18, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> if I counted correctly. (Array entries should be ignored for this
>>> purpose; maybe we'll autogenerate them someday.)
>>
>> Hmm, that wouldn't be too hard. Add a new metadata field called
>> 'array_type_oid', then if it finds such an OID, teach genbki.pl to
>> construct a tuple for the corresponding array type by consulting
>> something like
>>
>> char typcategory BKI_ARRAY(A);
>> char typstorage BKI_ARRAY(x);
>> ...etc
>>
>> in the header file, plus copying typalign from the element type. I'll
>> whip this up sometime and add it to the next commitfest.
>
> This turned out to be slightly more complicated than that, but still
> pretty straightforward.

Doing this in genbki.pl makes DBD::Pg lose its array type information,
since it uses Catalog::ParseData() to get it
(https://github.com/bucardo/dbdpg/blob/master/types.c#L439). May I
suggest moving gen_array_types() to Catalog.pm and calling it from
ParseData() if the input file is pg_type.dat, so that it always returns
complete data?

Thanks,

- ilmari
--
"A disappointingly low fraction of the human race is,
at any given time, on fire." - Stig Sandbeck Mathisen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2018-07-12 16:00:14 Re: [HACKERS] Re: [COMMITTERS] pgsql: Remove pgbench "progress" test pending solution of its timing is (fwd)
Previous Message Teodor Sigaev 2018-07-12 15:53:18 Re: [PATCH] btree_gist: fix union implementation for variable length columns