Re: dblink for 8.4 should work without user-mappings

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: dblink for 8.4 should work without user-mappings
Date: 2010-02-24 19:35:14
Message-ID: 201002241935.o1OJZEm10249@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


What happened to this patch?

---------------------------------------------------------------------------

Itagaki Takahiro wrote:
> contrib/dblink in 8.4 supports a server name by CREATE SERVER for connection
> string, but it always requires an user-mapping (by CREATE USER MAPPING).
> However, I think it should work user-mappings because it works when
> the connection string is passed directly.
>
> =# SELECT * FROM dblink('dbname=postgres', 'SELECT current_user') AS t(i name);
> (ok)
>
> =# CREATE FOREIGN DATA WRAPPER postgresql VALIDATOR postgresql_fdw_validator;
> =# CREATE SERVER server1 FOREIGN DATA WRAPPER postgresql OPTIONS (dbname 'postgres');
> =# SELECT * FROM dblink('server1', 'SELECT 1') AS t(i integer);
> ERROR: user mapping not found for "postgres"
>
> The attached patch adds 'missing_ok' parameter to GetUserMapping() and
> made dblink to use it. There should be no additional security issues here
> because dblink's original security check works even for server name mode.
>
> Regards,
> ---
> ITAGAKI Takahiro
> NTT Open Source Software Center

[ Attachment, skipping... ]

>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2010-02-24 19:40:14 testing cvs HEAD - HS/SR - xlog timeline 0 pg_xlogfile_name_offset
Previous Message Bruce Momjian 2010-02-24 19:33:37 Re: query cancel issues in contrib/dblink