X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D16153A41C6; Wed, 5 Jan 2005 03:30:57 +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 34815-09; Wed, 5 Jan 2005 03:30:41 +0000 (GMT) Received: from rigel.lunarpages.com (rigel.lunarpages.com [64.235.230.106]) by svr1.postgresql.org (Postfix) with ESMTP id 218B53A41AC; Wed, 5 Jan 2005 03:30:44 +0000 (GMT) Received: from cpanel by rigel.lunarpages.com with local (Exim 4.43) id 1Cm1sj-0000xp-1x; Tue, 04 Jan 2005 19:30:45 -0800 Received: from 61.11.66.222 ([61.11.66.222]) by www.granwill.com (IMP) with HTTP for ; Tue, 4 Jan 2005 19:30:45 -0800 Message-ID: <1104895845.41db5f6504e44@www.granwill.com> Date: Tue, 4 Jan 2005 19:30:45 -0800 From: deepthi@granwill.com To: pgsql-jdbc@postgresql.org Cc: pgsql-sql@postgresql.org Subject: Calling a table in another database from plpgsql MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.2 X-Originating-IP: 61.11.66.222 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 - [32001 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/horde/imp/compose.php X-Source-Dir: :/base/horde/imp X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.204 tagged_above=0 required=5 tests=NO_REAL_NAME, RCVD_IN_NJABL_PROXY X-Spam-Level: * X-Archive-Number: 200501/12 X-Sequence-Number: 11892 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