Loading Array

From: "Andrew Bartley" <abartley(at)evolvosystems(dot)com>
To: "PostgreSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: Loading Array
Date: 2002-05-16 23:00:27
Message-ID: 000801c1fd2d$784ccfa0$3200a8c0@abartleypc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lev Lvovsky 2002-05-16 23:25:22 foreign key reference on array elements?
Previous Message Andrew Sullivan 2002-05-16 19:54:32 Re: [HACKERS] Re : Solaris Performance - 64 bit puzzle