pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedCalling a table in another database from plpgsql
4+ messages / 3 participants
[nested] [flat]
* Calling a table in another database from plpgsql
@ 2005-01-05 03:30 deepthi@granwill.com
2005-01-05 04:45 ` Re: Calling a table in another database from plpgsql Kris Jurka <books@ejurka.com>
2005-01-05 13:48 ` Re: Calling a table in another database from plpgsql Dave Cramer <pg@fastcrypt.com>
0 siblings, 2 replies; 4+ messages in thread
From: deepthi@granwill.com @ 2005-01-05 03:30 UTC (permalink / raw)
To: pgsql-jdbc@postgresql.org; +Cc: 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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Calling a table in another database from plpgsql
2005-01-05 03:30 Calling a table in another database from plpgsql deepthi@granwill.com
@ 2005-01-05 04:45 ` Kris Jurka <books@ejurka.com>
1 sibling, 0 replies; 4+ messages in thread
From: Kris Jurka @ 2005-01-05 04:45 UTC (permalink / raw)
To: deepthi@granwill.com; +Cc: pgsql-jdbc@postgresql.org
On Tue, 4 Jan 2005 deepthi@granwill.com wrote:
> I have function called test1() in database 1. I need to input the value from
> this function into another table which is in database2.
>
This question has nothing to do with Java or JDBC. It is not appropriate
for this list. Please post only relevent questions here.
Kris Jurka
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Calling a table in another database from plpgsql
2005-01-05 03:30 Calling a table in another database from plpgsql deepthi@granwill.com
@ 2005-01-05 13:48 ` Dave Cramer <pg@fastcrypt.com>
2005-01-05 15:37 ` Re: Calling a table in another database from plpgsql Kris Jurka <books@ejurka.com>
1 sibling, 1 reply; 4+ messages in thread
From: Dave Cramer @ 2005-01-05 13:48 UTC (permalink / raw)
To: deepthi@granwill.com; +Cc: pgsql-jdbc@postgresql.org; 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@granwill.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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Calling a table in another database from plpgsql
2005-01-05 03:30 Calling a table in another database from plpgsql deepthi@granwill.com
2005-01-05 13:48 ` Re: Calling a table in another database from plpgsql Dave Cramer <pg@fastcrypt.com>
@ 2005-01-05 15:37 ` Kris Jurka <books@ejurka.com>
0 siblings, 0 replies; 4+ messages in thread
From: Kris Jurka @ 2005-01-05 15:37 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: deepthi@granwill.com; pgsql-jdbc@postgresql.org; pgsql-sql
On Wed, 5 Jan 2005, Dave Cramer wrote:
> Kris is correct, this is a jdbc list, however to satisfy your curiosity,
> you can't access data from another database.
>
You certainly can with dblink which is what his question was about. I
didn't answer him because I remembered a recent off-topic question from
him which I responded to with an answer and a suggestion of the
appropriate list. As long as answers keep coming the hint will not be
picked up.
Kris Jurka
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-01-05 15:37 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-05 03:30 Calling a table in another database from plpgsql deepthi@granwill.com
2005-01-05 04:45 ` Kris Jurka <books@ejurka.com>
2005-01-05 13:48 ` Dave Cramer <pg@fastcrypt.com>
2005-01-05 15:37 ` Kris Jurka <books@ejurka.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox