pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Stehule <pavel.stehule@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: returning an array as a list fo single-column rows?
Date: Sun, 23 Dec 2007 22:45:01 +0100
Message-ID: <162867790712231345w7c01493fv90517ba2dc9a90ff@mail.gmail.com> (raw)
In-Reply-To: <20071223213345.GA15623@apartia.fr>
References: <20071223205557.GA14403@apartia.fr>
	<162867790712231327g774b8c5ld488113a3a8252e9@mail.gmail.com>
	<20071223213345.GA15623@apartia.fr>

>
> 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 :(



view thread (6+ messages)

Message-ID: <162867790712231345w7c01493fv90517ba2dc9a90ff@mail.gmail.com>
Permalink:  ../162867790712231345w7c01493fv90517ba2dc9a90ff@mail.gmail.com/
Also on:    postgresql.org/message-id/162867790712231345w7c01493fv90517ba2dc9a90ff@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pavel.stehule@gmail.com
  Subject: Re: returning an array as a list fo single-column rows?
  In-Reply-To: <162867790712231345w7c01493fv90517ba2dc9a90ff@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox