Loading Array - Mailing list pgsql-general

From Andrew Bartley
Subject Loading Array
Date
Msg-id 000801c1fd2d$784ccfa0$3200a8c0@abartleypc
Whole thread Raw
In response to Re: Assertion constraint replacement?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: Loading Array  (Masaru Sugawara <rk73@sea.plala.or.jp>)
List pgsql-general
Hi all,

I am trying load an array from a text column.

select '''{' || concatkey || '}''' from visitor where user_id = 477373

returns

'{151038144,0,0,0,0,101931,0,0,0,0}'

This looks like the string I need to load the Array.

But...

create temp table test
(
tesrp  int8 [10]
)


insert into test
select '''{' || concatkey || '}''' from visitor where user_id = 477373

returns

Error: ' but expression is of type 'text'
 You will need to rewrite or cast the expression (State:S1000, Native Code:
7)

I'm sure I need to CAST the result...  But to what type..  I have tried lots
of different things but still carn't work it out.

Can someone help...

Thanks

Andrew


pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: [HACKERS] Re : Solaris Performance - 64 bit puzzle
Next
From: Lev Lvovsky
Date:
Subject: foreign key reference on array elements?