Re: [PATCH] Do not use StdRdOptions in Access Methods
От | Amit Langote |
---|---|
Тема | Re: [PATCH] Do not use StdRdOptions in Access Methods |
Дата | |
Msg-id | CA+HiwqF5Mx55bGkpQPzdre9FvSsHFSF8OHDyvDc+gCArsGhBOg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [PATCH] Do not use StdRdOptions in Access Methods (Nikolay Shaplov <dhyan@nataraj.su>) |
Ответы |
Re: [PATCH] Do not use StdRdOptions in Access Methods
|
Список | pgsql-hackers |
Hello Nikolay, I read comments that Tomas left at: https://www.postgresql.org/message-id/20190727173841.7ypzo4xuzizvijge%40development I'd like to join Michael in reiterating one point from Tomas' review. I think the patch can go further in trying to make the code in this area more maintainable. For example, even without this patch, the following stanza is repeated in many places: options = parseRelOptions(reloptions, validate, foo_relopt_kind, &numoptions); rdopts = allocateReloptStruct(sizeof(FooOptions), options, numoptions); fillRelOptions((void *) rdopts, sizeof(FooOptions), options, numoptions, validate, foo_relopt_tab, lengthof(foo_relopt_tab)); return (bytea *) rdopts; and this patch adds few more instances as it's adding more Options structs. I think it wouldn't be hard to encapsulate the above stanza in a new public function in reloptions.c and call it from the various places that now have the above code. Thanks, Amit
В списке pgsql-hackers по дате отправления: