Re: arrays
От | ivan |
---|---|
Тема | Re: arrays |
Дата | |
Msg-id | Pine.LNX.4.56.0307282206170.24554@rex.anfa.pl обсуждение исходный текст |
Ответ на | Re: arrays (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
On Sun, 27 Jul 2003, Tom Lane wrote: > ivan <iv@psycho.pl> writes: > > declaration is setof record array_to_setof ( anyarray); > > > i trayed created it like "any" array_to_setof( anyarray) but i had problem > > with select. i also trying write setof_to_array as aggregate, but i have > > problem with returns type , because aggregate cat have 'anyarray' as > > result ;( > > I think you want to declare it like this: > > create function array_to_setof(anyarray) returns setof anyelement as ... in this way i declared it : create function array_to_setof(anyarray) returns setof record as ' .. and its working because function create new type of record (as type of this anyarray) and then return each elem. In way back from typles to array , i have problem , because i need to create aggregate function . I think the function to arrays like this and function from contrib (array by Massimo Dal Zotto) should be in pg_catalog as std. and function to checking exists. i wrote function like : create function iv_exists (text, char) returns boolean, this function as 1 arg bring relation name, 2 arg is a type of this relation (is could be 'r' => table , 'c' => compose , 'f' function, 'C' => CASE , S s i etc like in pg_class.relkind, and i reserved 'M' to module and 'K' to class. But my way is very simple , but i did not find any function like this :/ > > Joe Conway may already have written something like this --- look in his > contrib modules. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >
В списке pgsql-hackers по дате отправления: