arrays and insert/select - Mailing list pgsql-general

From nolan@celery.tssi.com
Subject arrays and insert/select
Date
Msg-id 20030528234455.2513.qmail@celery.tssi.com
Whole thread Raw
Responses Re: arrays and insert/select
List 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



pgsql-general by date:

Previous
From: "Andy Kriger"
Date:
Subject: how much does a connection cost?
Next
From: Paul Thomas
Date:
Subject: Re: change log 7.3.3