Re: [PATCH] Do not use StdRdOptions in Access Methods
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Nikolay Shaplov <dhyan@nataraj.su>, Dent John <denty@qqdd.eu>, Thomas Munro <thomas.munro@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, "Iwata, Aya" <iwata.aya@jp.fujitsu.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Dmitry Dolgov <9erthalion6@gmail.com>
Date: 2019-10-31T07:49:39Z
Lists: pgsql-hackers
On Thu, Oct 31, 2019 at 04:38:55PM +0900, Amit Langote wrote: > On Wed, Oct 30, 2019 at 12:11 PM Michael Paquier <michael@paquier.xyz> wrote: > This sentence sounds wrong, because the result structure doesn't > contain values in text-array format. Individual values in the struct > would be in their native format (C bool for RELOPT_TYPE_BOOL, options, > etc.). > > Maybe we don't need this sentence, because the first line already says > we return a struct. Let's remove it then. > This breakage seems to have to do with the fact that the definition of > DummyIndexOptions struct and the entries of relopt_parse_elt table > don't agree? > > These are the last two members of DummyIndexOptions struct: > > @@ -126,7 +126,7 @@ create_reloptions_table(void) > NULL, &validate_string_option, > AccessExclusiveLock); > di_relopt_tab[5].optname = "option_string_null"; > - di_relopt_tab[5].opttype = RELOPT_TYPE_STRING; > + di_relopt_tab[5].opttype = RELOPT_TYPE_INT; > di_relopt_tab[5].offset = offsetof(DummyIndexOptions, > option_string_null_offset); > } > > test passes. > > But maybe this Assert isn't all that robust, so I'm happy to take it out. This one should remain a string reloption, and what's stored in the structure is an offset to get the string. See for example around RelationHasCascadedCheckOption before it got switched to an enum in 773df88 regarding the way to get the value. -- Michael
Commits
-
Refactor reloption handling for index AMs in-core
- 4cb658af7002 13.0 landed
-
Cleanup code in reloptions.h regarding reloption handling
- 50d22de9325f 13.0 landed
-
Refactor code building relation options
- 3534fa223328 13.0 landed
-
Add some assertions to view reloption macros
- 396773762425 13.0 cited