Inserting values in arrays - Mailing list pgsql-sql

From Robert.Farrugia@go.com.mt
Subject Inserting values in arrays
Date
Msg-id OF96764BBA.060DB4E6-ONC1256FC4.0061C3D4-C1256FC4.00623B75@go.com.mt
Whole thread Raw
Responses Re: Inserting values in arrays
List pgsql-sql
<br /><font face="sans-serif" size="2">I have the following issue.</font><br /><br /><font face="sans-serif"
size="2">Giventhe following tables:</font><br /><br /><font face="sans-serif" size="2">CREATE TABLE test ( details
varchar[]);</font><br/><font face="sans-serif" size="2">CREATE TABLE test2 ( textvalue1 varchar, textvalue2
varchar);</font><br/><font face="sans-serif" size="2">INSERT INTO test2 VALUES ('Hello1', 'World1');</font><br /><font
face="sans-serif"size="2">INSERT INTO test2 VALUES ('hello2', 'World2');</font><br /><br /><font face="sans-serif"
size="2">Iwould like to insert a row in test for each row of the test2 table i.e.</font><br /><font face="sans-serif"
size="2">INSERTINTO test (details) SELECT test2.textvalue1, test2.textvalue2 FROM test2</font><br /><br /><font
face="sans-serif"size="2">and I am expecting the following rows in test</font><br /><font face="sans-serif"
size="2">{'Hello1','World1'}</font><br /><font face="sans-serif" size="2">{'Hello2', 'World2'}</font><br /><br /><font
face="sans-serif"size="2">The above syntax is giving an error.  How can this be done in postgres ?</font><br /><br
/><fontface="sans-serif" size="2">Postgres version I am using is 7.3.4</font><br /><br /><font face="sans-serif"
size="2">Regards<br/> Robert</font> 

pgsql-sql by date:

Previous
From: Lance Peterson
Date:
Subject: Re: How to cast VARCHAR to BYTEA and vice-versa?
Next
From: lucas@presserv.org
Date:
Subject: Generic Function