Re: Preserving datatypes in dblink.
От | Joe Conway |
---|---|
Тема | Re: Preserving datatypes in dblink. |
Дата | |
Msg-id | 3D699D8A.6090500@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. Hmmm. I see what you mean. I'm afraid there may be no way to return an array via dblink currently :( I am just starting the next upgrade to dblink to support table functions in PostgreSQL 7.3 (which starts beta testing around September 1). Table functions should make dblink work much more naturally, something like (not yet working, but hopefully should be by next weekend on 7.3devel): select d.f1, d.f2 from dblink('dbname=mydb', 'select f1, f2 from remotetbl') as d(f1 int, f2 text); This would return f1 as an int, and f2 as text without the need to cast them in the target list. I would think that arrays would return fine this way, but I'll check as I'm working on it. Joe
В списке pgsql-admin по дате отправления: