Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 4BC041337C35 for ; Mon, 29 Nov 2010 15:11:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 26628-01-4 for ; Mon, 29 Nov 2010 19:11:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 88CA11337B77 for ; Mon, 29 Nov 2010 15:11:20 -0400 (AST) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id oATJBJk0071308 for ; Mon, 29 Nov 2010 19:11:19 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id oATJBJ1o071307; Mon, 29 Nov 2010 19:11:19 GMT (envelope-from www) Date: Mon, 29 Nov 2010 19:11:19 GMT Message-Id: <201011291911.oATJBJ1o071307@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #5775: DBLINK Connection String Truncation From: "David Quinn-Jacobs" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201011/218 X-Sequence-Number: 28798 The following bug has been logged online: Bug reference: 5775 Logged by: David Quinn-Jacobs Email address: dqj@ecornell.com PostgreSQL version: 9.0.1 Operating system: Cent OS 5 Description: DBLINK Connection String Truncation Details: 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 Note: I replaced the actual connection strings with equivalents, so the position of truncation differed slightly. The password was cut off, so the connection failed. The message is a bit incongruous with the actual problem. Note also that the code works fine in 8.4, but not 9.0.1. Thank you! -dqj