arrays and insert/select

From: nolan(at)celery(dot)tssi(dot)com
To: pgsql-general(at)postgresql(dot)org (pgsql general list)
Subject: arrays and insert/select
Date: 2003-05-28 23:44:55
Message-ID: 20030528234455.2513.qmail@celery.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm loading a table from another (in 7.3.2) and need to build a
varchar array from a varchar column in the source table.

INSERT into X (ArrayCol) select oldval from Y;

gets a type error, but you can't cast to an array.

INSERT into X (ArrayCol[1]) select oldval from Y;

doesn't work either.

INSERT into X (ArrayCol) select '{"' || oldval || '"}' from Y;

also doesn't work.

There doesn't appear to be a to_array function.

Any suggestions?
--
Mike Nolan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Thomas 2003-05-28 23:46:03 Re: change log 7.3.3
Previous Message Andy Kriger 2003-05-28 23:18:45 how much does a connection cost?