How to insert columns into an array

Поиск
Список
Период
Сортировка
Искать

How to insert columns into an array

От:
Dirk Lutzebaeck <lutzeb@cs.tu-berlin.de>
Дата:

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

 
FAQ