Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DFA59475CEF for ; Mon, 26 Aug 2002 21:00:56 -0400 (EDT) Received: from joeconway.com (unknown [63.210.180.150]) by postgresql.org (Postfix) with ESMTP id 53E02475C9C for ; Mon, 26 Aug 2002 21:00:56 -0400 (EDT) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 3.5.9) with ESMTP-TLS id 1313917; Mon, 26 Aug 2002 17:46:59 -0700 Message-ID: <3D6ACF02.4030306@joeconway.com> Date: Mon, 26 Aug 2002 17:59:46 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bhuvan A Cc: pgsql-admin@postgresql.org Subject: Re: Preserving datatypes in dblink. References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/309 X-Sequence-Number: 5423 Bhuvan A wrote: > Yeah, I did try the same earlier but it says > ERROR: Cannot cast type 'text' to 'text[]' > > So how do we cast text to text[](_text)? Is there any alternate way? > Awaiting for your valuable suggestion again, please. Just as an FYI -- as of a few minutes ago, I've gotten the following to work: test3=# create table foo(f1 text[]); CREATE TABLE test3=# insert into foo values('{a,b,c,d}'); INSERT 250715 1 test3=# insert into foo values('{e,f,g,h}'); INSERT 250716 1 test3=# \c test You are now connected to database test. test=# select * from dblink('dbname=test3','select f1 from foo') as t(f1 text[]); f1 ----------- {a,b,c,d} {e,f,g,h} (2 rows) test=# select f1[1] from dblink('dbname=test3','select f1 from foo') as t(f1 text[]); f1 ---- a e (2 rows) So, although I can't help you in 7.2.x, it looks like dblink will do what you need in PostgreSQL 7.3 (which starts beta in a few days). HTH, Joe