From: | ivan <iv(at)psycho(dot)pl> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: arrays |
Date: | 2003-07-28 20:29:14 |
Message-ID: | Pine.LNX.4.56.0307282206170.24554@rex.anfa.pl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sun, 27 Jul 2003, Tom Lane wrote:
> ivan <iv(at)psycho(dot)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(at)postgresql(dot)org
>
From | Date | Subject | |
---|---|---|---|
Next Message | Merlin Moncure | 2003-07-28 21:21:45 | an aggregate array function |
Previous Message | Tom Lane | 2003-07-28 20:13:13 | Re: Regression test failure date. |