pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedCalling a table residing in another database from Plpgsql
5+ messages / 5 participants
[nested] [flat]
* Calling a table residing in another database from Plpgsql
@ 2005-01-05 05:13 deepthi@granwill.com
0 siblings, 4 replies; 5+ messages in thread
From: deepthi@granwill.com @ 2005-01-05 05:13 UTC (permalink / raw)
To: 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] 5+ messages in thread
* Re: Calling a table residing in another database from Plpgsql
@ 2005-01-05 05:38 Kenneth Gonsalves <lawgon@thenilgiris.com>
parent: deepthi@granwill.com
3 siblings, 0 replies; 5+ messages in thread
From: Kenneth Gonsalves @ 2005-01-05 05:38 UTC (permalink / raw)
To: deepthi@granwill.com; pgsql-sql
On Wednesday 05 January 2005 10:43 am, 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.
shouldnt you be using schemas instead?
kg
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Calling a table residing in another database from Plpgsql
@ 2005-01-05 12:50 CoL <col@mportal.hu>
parent: deepthi@granwill.com
3 siblings, 0 replies; 5+ messages in thread
From: CoL @ 2005-01-05 12:50 UTC (permalink / raw)
To: pgsql-sql
hi,
deepthi@granwill.com wrote, On 1/5/2005 06:13:
> 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"
try to set up dblink. Read the README.dblink file, Installation: part.
Use dblink_connect to connect, then you can query with dblink()
read the docs befor you try to use it.
PS: or better use schemas, not different databases.
C.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Calling a table residing in another database from Plpgsql
@ 2005-01-05 14:54 Joe Conway <mail@joeconway.com>
parent: deepthi@granwill.com
3 siblings, 0 replies; 5+ messages in thread
From: Joe Conway @ 2005-01-05 14:54 UTC (permalink / raw)
To: deepthi@granwill.com; +Cc: pgsql-sql
deepthi@granwill.com wrote:
> 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"
Have you installed the dblink functions into your database? See
README.dblink.
Joe
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Calling a table residing in another database from Plpgsql
@ 2005-01-05 16:28 Kretschmer Andreas <andreas_kretschmer@despammed.com>
parent: deepthi@granwill.com
3 siblings, 0 replies; 5+ messages in thread
From: Kretschmer Andreas @ 2005-01-05 16:28 UTC (permalink / raw)
To: pgsql-sql
am Tue, dem 04.01.2005, um 21:13:46 -0800 mailte deepthi@granwill.com folgendes:
> 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:
You must run the dblink.sql, not only download.
Regards, Andreas
--
Diese Message wurde erstellt mit freundlicher Unterstützung eines freilau-
fenden Pinguins aus artgerechter Freilandhaltung. Er ist garantiert frei
von Micro$oft'schen Viren. (#97922 http://counter.li.org) GPG 7F4584DA
Was, Sie wissen nicht, wo Kaufbach ist? Hier: N 51.05082°, E 13.56889° ;-)
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2005-01-05 16:28 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-05 05:13 Calling a table residing in another database from Plpgsql deepthi@granwill.com
2005-01-05 05:38 ` Kenneth Gonsalves <lawgon@thenilgiris.com>
2005-01-05 12:50 ` CoL <col@mportal.hu>
2005-01-05 14:54 ` Joe Conway <mail@joeconway.com>
2005-01-05 16:28 ` Kretschmer Andreas <andreas_kretschmer@despammed.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