Re: dblink: add polymorphic functions.

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: dblink: add polymorphic functions.
Дата
Msg-id CAB7nPqTi4jzD_tEXPKC7GHqBN8id92THpsS2YNDFxzvHfod_6Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: dblink: add polymorphic functions.  (Joe Conway <mail@joeconway.com>)
Ответы Re: dblink: add polymorphic functions.  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Mon, Jul 6, 2015 at 10:00 AM, Joe Conway <mail@joeconway.com> wrote:
> I wonder if it isn't better to just loop through all the args with
> get_fn_expr_argtype() every time and then test for the exact signature
> match? Another alternative might be to create a wrapper C function for
> each variant SQL function, but that seems like it could also get
> messy, especially with dblink_record_internal() since we would have to
> deal with every variant of all the external facing callers.
> Thoughts?

Yeah, particularly the use of first_optarg makes things harder to
follow in the code with this patch. A C wrapper has the disadvantage
to decentralize the argument checks to many places making the flow
harder to follow hence using get_fn_expr_argtype() with PG_NARGS would
be the way to go, at least to me. This way, you can easily find how
many arguments there are, and which value is assigned to which
variable before moving on to the real processing.
-- 
Michael



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Marc Mamin
Дата:
Сообщение: 9.5 alpha: some small comments on BRIN and btree_gin
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: dblink: add polymorphic functions.