anyelement -> anyrange
От | Jim Nasby |
---|---|
Тема | anyelement -> anyrange |
Дата | |
Msg-id | 787ba701-72dd-9a05-3085-45607159288f@BlueTreble.com обсуждение исходный текст |
Ответы |
Re: anyelement -> anyrange
|
Список | pgsql-hackers |
Any reason why we can create a function that accepts anyelement and returns anyarray, but can't do the same with anyrange? Could we attempt to match each range subtype looking for a match? create function range__create(anyelement,anyelement,text = '[]') RETURNS anyrange LANGUAGE plpgsql AS $body$ BEGIN RETURN int4range($1,$2,$3) END$body$; ERROR: 42P13: cannot determine result data type DETAIL: A function returning "anyrange" must have at least one "anyrange" argument. create function array__create(anyelement,anyelement) RETURNS anyarray LANGUAGE plpgsql AS $body$ BEGIN RETURN array[$1,$2]; END$body$; CREATE FUNCTION -- Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX Experts in Analytics, Data Architecture and PostgreSQL Data in Trouble? Get it in Treble! http://BlueTreble.com 855-TREBLE2 (855-873-2532) mobile: 512-569-9461
В списке pgsql-hackers по дате отправления: