Re: Issues for named/mixed function notation patch

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bernd Helmle <mailings(at)oopsware(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Issues for named/mixed function notation patch
Date: 2009-09-29 17:06:27
Message-ID: 162867790909291006s7eef2420o83754fd6f910aa73@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/9/28 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
> 2009/9/28 Jeff Davis <pgsql(at)j-davis(dot)com>:
>> On Mon, 2009-09-28 at 18:23 +0200, Pavel Stehule wrote:
>>> when I though about control, I found so syntax with mandatory VARIADIC
>>> is difficult implementable. So probably the most feasible solution for
>>> this moment is to discard a variadic functions from set of functions
>>> that are callable with named notation. So I thing we are in tune, and
>>> I am going to update patch.
>>
>> Sounds good. I am looking at the code, and there's a part I don't
>> understand:
>>
>> In FuncnameGetCandidates():
>>  /*
>>   * Wait with apply proargidxs on args. Detection ambigouos needs
>>   * consistent args (based on proargs). Store proargidxs for later
>>   * use.
>>   */
>>   newResult->proargidxs = proargidxs;

proargidxs is used more times in func_get_detail function

a) for reordering pgproc->args to actual params order
b) for numbering (filling) NamedArgExpr->position based on known best candidate

>
>>
>> But after calling FuncnameGetCandidates (the only place where fargnames
>> is non-NIL), you immediately re-assign to best_candidate->args. What
>> happens between those two places, and why can't it happen in
>> FuncnameGetCandidates?
>

> I am not sure - I have to look to code, but if I remember well, there
> are same arrays, with same values, but the field are different order.
> One is related to pgproc and second to real params. But I have to
> check code again.
>>
>> Also, you should consistently pass NIL when you mean an empty list, but
>> sometimes you pass NULL to FuncnameGetCandidates().
>
> It's bug, where is it?

I fixed it

So I dropped variadic functions from mixed/named notation and little
bit modified documentation. Please, can some native English speaker
look on documentation?

Patch attached

Pavel

>
> Regards
> Pavel
>
>>
>> Regards,
>>        Jeff Davis
>>
>>
>>
>

Attachment Content-Type Size
plpgsql-move-fix090928a.diff text/x-patch 76.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Roger Leigh 2009-09-29 17:13:07 Re: Unicode UTF-8 table formatting for psql text output
Previous Message Josh Berkus 2009-09-29 16:54:24 Re: Rejecting weak passwords