Re: cast list of oid

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: salah jubeh <s_jubeh(at)yahoo(dot)com>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: cast list of oid
Date: 2011-04-08 14:23:28
Message-ID: BANLkTi=G7PiZxPHOtvNXxH3XXO2+99f_5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

2011/4/8 salah jubeh <s_jubeh(at)yahoo(dot)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
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2011-04-08 14:26:57 Re: why autocommit mode is slow?
Previous Message Gipsz Jakab 2011-04-08 14:08:28 Re: PostgreSQL + FreeBSD memory configuration, and an issue