summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/html/contrib-dblink-connect-u.html
blob: 76b22bf393cc8f0a7b2530dde55e5fdad91f4b23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>dblink_connect_u</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="contrib-dblink-connect.html" title="dblink_connect" /><link rel="next" href="contrib-dblink-disconnect.html" title="dblink_disconnect" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">dblink_connect_u</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="contrib-dblink-connect.html" title="dblink_connect">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="dblink.html" title="F.12. dblink">Up</a></td><th width="60%" align="center">F.12. dblink</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 15.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="contrib-dblink-disconnect.html" title="dblink_disconnect">Next</a></td></tr></table><hr /></div><div class="refentry" id="CONTRIB-DBLINK-CONNECT-U"><div class="titlepage"></div><a id="id-1.11.7.21.6.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle">dblink_connect_u</span></h2><p>dblink_connect_u — opens a persistent connection to a remote database, insecurely</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
dblink_connect_u(text connstr) returns text
dblink_connect_u(text connname, text connstr) returns text
</pre></div><div class="refsect1" id="id-1.11.7.21.6.5"><h2>Description</h2><p>
    <code class="function">dblink_connect_u()</code> is identical to
    <code class="function">dblink_connect()</code>, except that it will allow non-superusers
    to connect using any authentication method.
   </p><p>
    If the remote server selects an authentication method that does not
    involve a password, then impersonation and subsequent escalation of
    privileges can occur, because the session will appear to have
    originated from the user as which the local <span class="productname">PostgreSQL</span>
    server runs.  Also, even if the remote server does demand a password,
    it is possible for the password to be supplied from the server
    environment, such as a <code class="filename">~/.pgpass</code> file belonging to the
    server's user.  This opens not only a risk of impersonation, but the
    possibility of exposing a password to an untrustworthy remote server.
    Therefore, <code class="function">dblink_connect_u()</code> is initially
    installed with all privileges revoked from <code class="literal">PUBLIC</code>,
    making it un-callable except by superusers.  In some situations
    it may be appropriate to grant <code class="literal">EXECUTE</code> permission for
    <code class="function">dblink_connect_u()</code> to specific users who are considered
    trustworthy, but this should be done with care.  It is also recommended
    that any <code class="filename">~/.pgpass</code> file belonging to the server's user
    <span class="emphasis"><em>not</em></span> contain any records specifying a wildcard host name.
   </p><p>
    For further details see <code class="function">dblink_connect()</code>.
   </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="contrib-dblink-connect.html" title="dblink_connect">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="dblink.html" title="F.12. dblink">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="contrib-dblink-disconnect.html" title="dblink_disconnect">Next</a></td></tr><tr><td width="40%" align="left" valign="top">dblink_connect </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 15.4 Documentation">Home</a></td><td width="40%" align="right" valign="top"> dblink_disconnect</td></tr></table></div></body></html>