Re: BUG #14545: Unable to retrieve parameter mode 'VARIADIC'

From: Prajval Poojari <ppoojari(at)erwin(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14545: Unable to retrieve parameter mode 'VARIADIC'
Date: 2017-02-14 22:15:33
Message-ID: MWHPR19MB11351740E8884BFE7B1A2AE4C2580@MWHPR19MB1135.namprd19.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

HI David,
Sorry I made typo error while logging the bug.
I executed this test script
CREATE FUNCTION mleast(VARIADIC arr numeric[]) RETURNS numeric AS $$
SELECT min($1[i]) FROM generate_subscripts($1, 1) g(i);
$$ LANGUAGE SQL;

Then
I executed a test retrieve query as
select distinct pa.parameter_mode
from information_schema.parameters as pa
o/p
"OUT"
"IN"

Example 2
I executed a test retrieve query as
select distinct pa.parameter_mode
from information_schema.parameters as pa
where pa.parameter_mode = 'VARIADIC'
o/p
Empty result set

I believed if other parameter modes are getting retrieved in the o.p same way ‘VARIADIC’ should be retrieved which is not the case.
So I believe it to be bug or partial implementation of the parameter_mode feature

Please let me know your comments

Regards,
Prajval Poojari

From: David G. Johnston [mailto:david(dot)g(dot)johnston(at)gmail(dot)com]
Sent: Tuesday, February 14, 2017 4:58 PM
To: Prajval Poojari <ppoojari(at)erwin(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: [BUGS] BUG #14545: Unable to retrieve parameter mode 'VARIADIC'

On Tue, Feb 14, 2017 at 12:11 PM, <ppoojari(at)erwin(dot)com<mailto:ppoojari(at)erwin(dot)com>> wrote:
The following bug has been logged on the website:

Bug reference: 14545
Logged by: Prajval Poojari
Email address: ppoojari(at)erwin(dot)com<mailto:ppoojari(at)erwin(dot)com>
PostgreSQL version: 9.5.6
Operating system: Windows 10 Pro
Description:

Hi
i ran a simple select query as
"select pa.parameter_mode from information_schema as pa where
pa.parameter_mode = 'VARIADIC' "
and the DB returned me a null list.
I had already created a function with the parameter mode as VARIADIC.
Just wondering if there is some other specific way to retrieve this mode.

​I just get an error when I try that - I think you are missing the "parameters" table specification.

​CREATE FUNCTION variadictest(VARIADIC vargs text[])
RETURNS text
AS $$
SELECT 'test'::text;
$$
LANGUAGE sql;

# select data_type from information_schema.parameters WHERE specific_name ~ 'variadictest';
-> "ARRAY"

While imperfect locating any ARRAY data_type argument positioned last would be accurate if potentially imprecise (i.e., possible false positives).

There may be (probably is) a PostgreSQL-specific catalog that will contain the desired level of detail. Information Schema is "least common denominator" in nature which may explain the lack of specificity here.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2017-02-14 22:43:48 Re: BUG #14545: Unable to retrieve parameter mode 'VARIADIC'
Previous Message David G. Johnston 2017-02-14 21:57:51 Re: BUG #14545: Unable to retrieve parameter mode 'VARIADIC'