pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dirk Lutzebaeck <lutzeb@cs.tu-berlin.de>
To: pgsql-sql@postgreSQL.org
Subject: How to insert columns into an array
Date: Thu, 28 May 1998 17:15:53 +0200 (MEST)
Message-ID: <13677.32264.100233.239282@gate.wadk-berlin.de> (raw)


Hi,

say you have the following two tables

CREATE TABLE t1 (
	a TEXT,
	b TEXT,
	c TEXT);

CREATE TABLE t2 (
	x TEXT[];
);

how can I insert a into x[0], b into x[1] and c into x[2]??? and how
about the other way round?

something like 

insert into t2(x[0], x[1], x[2]) select * from t1;

fails.


Thanks for help,

Dirk

 



Message-ID: <13677.32264.100233.239282@gate.wadk-berlin.de>
Permalink:  ../13677.32264.100233.239282@gate.wadk-berlin.de/
Also on:    postgresql.org/message-id/13677.32264.100233.239282@gate.wadk-berlin.de

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: lutzeb@cs.tu-berlin.de
  Subject: Re: How to insert columns into an array
  In-Reply-To: <13677.32264.100233.239282@gate.wadk-berlin.de>
  References: <13677.32264.100233.239282@gate.wadk-berlin.de>

* 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