Re: [PATCH] Do not use StdRdOptions in Access Methods

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Nikolay Shaplov <dhyan(at)nataraj(dot)su>, Dent John <denty(at)qqdd(dot)eu>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "Iwata, Aya" <iwata(dot)aya(at)jp(dot)fujitsu(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Subject: Re: [PATCH] Do not use StdRdOptions in Access Methods
Date: 2019-10-26 02:45:46
Message-ID: 20191026024546.GB2084@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 25, 2019 at 04:42:24PM +0900, Amit Langote wrote:
> Hmm, if we're inventing a new API to replace the old one, why not use
> that opportunity to be consistent with our general style, which
> predominantly seems to be either words_separated_by_underscore() or
> UpperCamelCase(). Thoughts?

Not wrong. Using small-case characters separated with underscores
would be more consistent with the rest perhaps? We use that for the
initialization of custom variables and for all the relkind-related
interfaces.

> You might know already, but in short, the values in the passed-in
> relopt_parse_elts array (relopt_elems) must fit within
> relopt_struct_size. Writing an Assert turned out to be tricky given
> that alignment must be considered, but I have tried to add one. Pleas
> check, it very well might be wrong. ;)

Hmm. I didn't expect it to be this confusing with relopt_type_size[].
I'll try to think about something :(

+ * Parses reloptions provided by the caller in text array format and
+ * fills and returns a struct containing the parsed option values
The sentence structure is weird, perhaps:
This routine parses "reloptions" provided by the caller in text-array
format. The parsing is done with a table describing the allowed
options, defined by "relopt_elems" of length "num_relopt_elems". The
returned result is a structure containing all the parsed option
values.

> Attached updated patch. It would be nice to hear whether this patch
> is really what Nikolay intended to eventually do with this code.

Okay, let's check if Nikolay likes this idea.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-10-26 03:21:14 Re: define bool in pgtypeslib_extern.h
Previous Message PG Bug reporting form 2019-10-25 23:16:25 BUG #16079: Question Regarding the BUG #16064