Re: returning an array as a list fo single-column rows?

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: returning an array as a list fo single-column rows?
Date: 2007-12-23 21:45:01
Message-ID: 162867790712231345w7c01493fv90517ba2dc9a90ff@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
> Yes I thought about it, but would rather have Pg do the array splitting.
> For instance if the separator occurs in an array element there is no
> built-in escaping:
>
> % select array_to_string(array['ee','dd','rr','f|f'],'|');
> array_to_string
> -----------------
> ee|dd|rr|f|f

if you have not some special char, then unpack is one possible solution

theoretically you can use text output

postgres=# select array['aa','aaa,j']::text;
array
-----------------
{aa,"aaa,j"}
(1 row)

but nothing nice parse it :(

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message pgsql 2007-12-23 23:02:45 returning an array as a list of single-column rows... (different approach)
Previous Message Louis-David Mitterrand 2007-12-23 21:33:45 Re: returning an array as a list fo single-column rows?