Re: cast list of oid - Mailing list pgsql-general

From Pavel Stehule
Subject Re: cast list of oid
Date
Msg-id BANLkTi=G7PiZxPHOtvNXxH3XXO2+99f_5g@mail.gmail.com
Whole thread Raw
In response to cast list of oid  (salah jubeh <s_jubeh@yahoo.com>)
List pgsql-general
Hello

2011/4/8 salah jubeh <s_jubeh@yahoo.com>:
> is it possible to cast a list of  oids  . i.e something like below. Or I
> need to write a procedure
>
> SELECT groname, grolist::regclass::text FROM pg_group;
>

what is list? Is it a array?

you can use a unnest and array()

postgres=# select array(select unnest(array[25,26,27]::oid[])::regtype);
    ?column?
────────────────
 {text,oid,tid}
(1 row)


Regards

Pavel Stehule

>
>  Regards
>
> Best Regard
>
> Eng. Salah Al Jubeh
> Palestine Polytechnic University
> College of Applied Science
> Computer Science
> P.O. Box 198
> Mobile:++97259369122
> Tel:++97222254680
>
>
>

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: PostgreSQL backend process high memory usage issue
Next
From: Simon Riggs
Date:
Subject: Re: why autocommit mode is slow?