On Sun, 27 Jul 2003, Tom Lane wrote:
> ivan <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] > ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])