X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 65F7ED1D25D for ; Fri, 13 Feb 2004 08:56:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 97225-08 for ; Fri, 13 Feb 2004 04:56:56 -0400 (AST) Received: from web41408.mail.yahoo.com (web41408.mail.yahoo.com [66.218.93.74]) by svr1.postgresql.org (Postfix) with SMTP id 4D978D1D26D for ; Fri, 13 Feb 2004 04:56:54 -0400 (AST) Message-ID: <20040213085655.67695.qmail@web41408.mail.yahoo.com> Received: from [203.177.72.130] by web41408.mail.yahoo.com via HTTP; Fri, 13 Feb 2004 08:56:55 GMT Date: Fri, 13 Feb 2004 08:56:55 +0000 (GMT) From: =?iso-8859-1?q?Gezeala=20'Eyah'=20Bacu=F1o=20II?= Subject: How To Connect to another Database inside a plpgsql function To: pgsql-php@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1584588277-1076662615=:67415" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.4 tagged_above=0.0 required=5.0 tests=FROM_ENDS_IN_NUMS, HTML_FONTCOLOR_BLUE, HTML_FONTCOLOR_RED, HTML_FONTCOLOR_UNSAFE, HTML_MESSAGE X-Spam-Level: * X-Archive-Number: 200402/29 X-Sequence-Number: 2577 --0-1584588277-1076662615=:67415 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi Guys! I have 2 database namely "DB1" and "DB2". In DB1 I created a plgpsql function fnTest(). My problem is inside fnTest() I need to check some tables in DB2! I've no idea how to do this. Usually when I make a function I only access tables/views/functions in the same database. I really don't know if this is possible. BTW, I googled my problem but did not see any topics on this. Need your expertise on this one guys...TIA! Marie Gezeala M. Bacuņo II IS Department Muramoto Audio-Visual Phils., Inc. MEPZ1, Lapu-Lapu City, Cebu, Philippines 6015 The person with the ultimate cachinnation possesses, thereby, the optimal cachinnation. --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now --0-1584588277-1076662615=:67415 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Hi Guys!
 
I have 2 database namely "DB1" and "DB2".
 
In DB1 I created a plgpsql function fnTest().
 
My problem is inside fnTest() I need to check some tables in DB2! I've no idea how to do this. Usually when I make a function I only access tables/views/functions in the same database. I really don't know if this is possible.
 
BTW, I googled my problem but did not see any topics on this.
 
Need your expertise on this one guys...TIA!


Marie Gezeala M. Bacuņo II
IS Department
Muramoto Audio-Visual Phils., Inc.
MEPZ1, Lapu-Lapu City, Cebu, Philippines 6015

The person with the ultimate cachinnation possesses, thereby, the optimal cachinnation.


Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now --0-1584588277-1076662615=:67415--