Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4A44E1337B5D for ; Mon, 29 Nov 2010 19:55:15 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 25761-09 for ; Mon, 29 Nov 2010 23:55:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id EB0E81337B50 for ; Mon, 29 Nov 2010 19:55:07 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oATNt6CO007600; Mon, 29 Nov 2010 18:55:06 -0500 (EST) To: "David Quinn-Jacobs" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #5775: DBLINK Connection String Truncation In-reply-to: <201011291911.oATJBJ1o071307@wwwmaster.postgresql.org> References: <201011291911.oATJBJ1o071307@wwwmaster.postgresql.org> Comments: In-reply-to "David Quinn-Jacobs" message dated "Mon, 29 Nov 2010 19:11:19 +0000" Date: Mon, 29 Nov 2010 18:55:06 -0500 Message-ID: <7599.1291074906@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/219 X-Sequence-Number: 28799 "David Quinn-Jacobs" writes: > Causes connection failure. To re-create: > CREATE TABLE Local ( foo TEXT ); > CREATE TABLE Remote ( bar TEXT ); > CREATE VIEW DblinkBugView AS > SELECT * FROM Local L > LEFT OUTER JOIN dblink( 'hostname=123.456.789.012 > dbname=a_longish_database_name user=my_user_name password=my_password', > 'SELECT bar FROM Remote' ) AS R ( bar TEXT ) ON (L.foo=R.bar); > The sample case can have both tables located on the same server to simplify. > The error message is not just generated. The string is actually truncated, > as demonstrated in the psql command result: > mydb=# SELECT * FROM DblinkBugView; > NOTICE: identifier "host=123.456.789.012 dbname=a_longish_database_name > user=my_user_name password=my_password" will be truncated to > "host=123.456.789.012 dbname=a_longish_database_name user=my_user_name p" > ERROR: could not establish connection > DETAIL: FATAL: no pg_hba.conf entry for host "123.456.789.012", user > "my_user_name", database "a_longish_database_name", SSL off Well, it works for me, as nearly as I can replicate this test case. I get the bogus NOTICE but the connection goes through anyway: contrib_regression=# SELECT * FROM DblinkBugView; NOTICE: identifier "host=127.0.0.1 dbname=contrib_regression user=postgres" will be truncated to "host=127.0.0.1 dbname=contrib_regression user=po" foo | bar -----+----- (0 rows) Please notice that the connection error you are getting is *not* about a bad password. It looks like you've neglected to provide a pg_hba.conf entry that will allow dblink connections. regards, tom lane