Re: Preserving datatypes in dblink.

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Preserving datatypes in dblink.
Дата
Msg-id 3D6ACF02.4030306@joeconway.com
обсуждение исходный текст
Ответ на Re: Preserving datatypes in dblink.  (Bhuvan A <bhuvansql@linuxfreemail.com>)
Список pgsql-admin
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


В списке pgsql-admin по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Deleting large amount of data.
Следующее
От: "Vilson farias"
Дата:
Сообщение: Re: Deleting large amount of data.