Calling a table in another database from plpgsql

From: deepthi(at)granwill(dot)com
To: pgsql-jdbc(at)postgresql(dot)org
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Calling a table in another database from plpgsql
Date: 2005-01-05 03:30:45
Message-ID: 1104895845.41db5f6504e44@www.granwill.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-sql

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

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-01-05 04:03:28 Re: JDBC and Latin1 Database problem
Previous Message David Gagnon 2005-01-05 03:27:48 Re: JDBC and Latin1 Database problem

Browse pgsql-sql by date

  From Date Subject
Next Message Kris Jurka 2005-01-05 04:45:54 Re: Calling a table in another database from plpgsql
Previous Message Stephan Szabo 2005-01-04 14:56:22 Re: foreign key problems