Re: Calling a table in another database from plpgsql

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: deepthi(at)granwill(dot)com
Cc: pgsql-jdbc(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: Re: Calling a table in another database from plpgsql
Date: 2005-01-05 13:48:15
Message-ID: 41DBF01F.3090703@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-sql

Kris is correct, this is a jdbc list, however to satisfy your curiosity,
you can't access data from another database.

Dave

deepthi(at)granwill(dot)com wrote:

>Hi,
>
>I have function called test1() in database 1. I need to input the value from
>this function into another table which is in database2.
>
>How can i achieve this task in plpgsql. I went through some documentation and
>found out that it is possible through dblink.
>
>I infact downloaded the dblink package in contrib folder. But still when i tried
>to use dblink in the following manner:
>
>SELECT * from dblink('host=192.168.0.50 dbname=AK1 user=akteam','Select userid
>from user_reg') as t (userid integer);
>
>I am getting an error as "ERROR: function dblink("unknown", "unknown") does not
>exist"
>
>Is dblink the only way of connecting the databases and if so what is the exact
>step by step procedure to be follwed to download dblink and use it to connect
>databases.
>
>Thanks in advance,
>Regards,
>deepthi
>
>
>
>
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
>
>

--
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2005-01-05 15:37:42 Re: Calling a table in another database from plpgsql
Previous Message Nicolai Tufar 2005-01-05 12:07:32 Update: jdbc-tr.po

Browse pgsql-sql by date

  From Date Subject
Next Message Joe Conway 2005-01-05 14:54:08 Re: Calling a table residing in another database from Plpgsql
Previous Message Stephan Szabo 2005-01-05 13:32:54 Re: foreign key problems