Re: Weird return-value from pg_get_function_identity_arguments() oncertain aggregate functions?

Поиск
Список
Период
Сортировка
Искать
От
David G. Johnston
Тема
Re: Weird return-value from pg_get_function_identity_arguments() oncertain aggregate functions?
Дата
Msg-id
CAKFQuwaMpCy4cmpLriLusw=iawCUB1F0wgjH_dFpu3VXB=Wjug@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Weird return-value from pg_get_function_identity_arguments() oncertain aggregate functions? P O'Toole <P.OToole@uwyo.edu>
Re: Weird return-value from pg_get_function_identity_arguments() oncertain aggregate functions? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Weird return-value from pg_get_function_identity_arguments() oncertain aggregate functions? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Weird return-value from pg_get_function_identity_arguments() on certain aggregate functions? Tom Lane <tgl@sss.pgh.pa.us>
Re: Weird return-value from pg_get_function_identity_arguments() on certain aggregate functions? Tom Lane <tgl@sss.pgh.pa.us>
On Mon, Mar 12, 2018 at 2:19 PM, P O'Toole <P.OToole@uwyo.edu> wrote:


According to the System Information Functions docs, pg_get_function_identity_arguments(OID) should simply "get argument list to identify a function (without default values)", but one example of how it behaves strangely is that:

 

SELECT pg_get_function_identity_arguments('pg_catalog.percentile_disc(DOUBLE PRECISION[], ANYELEMENT)'::REGPROCEDURE)



​FWIW a simple \dfS percentile* will elicit the same description.

I suppose it depends on what you are using the output for - the (percentile*) functions that are decorated with ORDER BY are exclusively aggregate, as opposed to standard, functions.

An ORDER BY is not a "default value" so we aren't really contradicting the docs - though seeing ORDER BY in a function signature is a surprise to me too...but reading the doc for CREATE AGGREGATE the SQL command syntax is:

CREATE AGGREGATE name ( [ [ argmode ] [ argname ] arg_data_type [ , ... ] ]
                        ORDER BY [ argmode ] [ argname ] arg_data_type [ , ... ] )

So I'd have to say this is working correctly.

I seem to recall some recent (last few weeks) discussion regarding aggregates vs functions in the information schema.  That may prove to be enlightening but at the moment I don't have time to go look for and review it.

David J.
В списке pgsql-bugs по дате отправления
От: P O'Toole
Дата:
От: David G. Johnston
Дата:
FAQ