X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 87FE83A4075 for ; Wed, 5 Jan 2005 05:14:02 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62992-03 for ; Wed, 5 Jan 2005 05:13:46 +0000 (GMT) Received: from rigel.lunarpages.com (rigel.lunarpages.com [64.235.230.106]) by svr1.postgresql.org (Postfix) with ESMTP id 9562F3A1A32 for ; Wed, 5 Jan 2005 05:13:46 +0000 (GMT) Received: from granwi2 by rigel.lunarpages.com with local (Exim 4.43) id 1Cm3UQ-0006jF-PP for pgsql-sql@postgresql.org; Tue, 04 Jan 2005 21:13:46 -0800 Received: from 61.11.66.222 ([61.11.66.222]) (SquirrelMail authenticated user deepthi@granwill.com); by www.granwill.com with HTTP; Tue, 4 Jan 2005 21:13:46 -0800 (PST) Message-ID: <43146.61.11.66.222.1104902026.squirrel@61.11.66.222> Date: Tue, 4 Jan 2005 21:13:46 -0800 (PST) Subject: Calling a table residing in another database from Plpgsql From: deepthi@granwill.com To: pgsql-sql@postgresql.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - rigel.lunarpages.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [32041 32003] / [47 12] X-AntiAbuse: Sender Address Domain - granwill.com X-Source: /usr/local/cpanel/3rdparty/bin/php X-Source-Args: /usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/base/3rdparty/squirrelmail/src/compose.php X-Source-Dir: :/base/3rdparty/squirrelmail/src X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.178 tagged_above=0 required=5 tests=NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200501/10 X-Sequence-Number: 19798 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