pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas <maps.on@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Re: insert into table from list or array ?
Date: Tue, 19 Oct 2010 01:05:02 +0200
Message-ID: <4CBCD29E.3000304@gmx.net> (raw)
In-Reply-To: <AANLkTimxaYzBmm9PyLXgf9okbLmM0eYTMQmgU1kpTZNr@mail.gmail.com>
References: <4CBC8B3B.7060708@gmx.net>
	<AANLkTimxaYzBmm9PyLXgf9okbLmM0eYTMQmgU1kpTZNr@mail.gmail.com>

  Am 18.10.2010 20:14, schrieb Pavel Stehule:
> 2010/10/18 Andreas:
>> is it possible to insert into a table from list or an array ?
> yes, it's possible
>
> INSERT INTO tmptab
>     SELECT v
>       FROM unnest(string_to_array('1,2,4,2,1',',')) g(v)
>

Thanks Pavel,
though I'm just not yet 100% aware how it works but it works.   :)



view thread (4+ messages)

Message-ID: <4CBCD29E.3000304@gmx.net>
Permalink:  ../4CBCD29E.3000304@gmx.net/
Also on:    postgresql.org/message-id/4CBCD29E.3000304@gmx.net

 · 

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: maps.on@gmx.net
  Subject: Re: insert into table from list or array ?
  In-Reply-To: <4CBCD29E.3000304@gmx.net>

* 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