| Server IP : 172.67.134.114 / Your IP : 162.159.115.42 Web Server : Apache/2.4.37 System : Linux almalinux.duckdns.org 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64 User : ricodeal ( 1046) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/postgresql-docs/html/ |
Upload File : |
<?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="[email protected]" /><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><div xmlns="http://www.w3.org/TR/xhtml1/transitional" 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.11. dblink">Up</a></td><th width="60%" align="center">F.11. dblink</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 10.23 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></hr></div><div class="refentry" id="CONTRIB-DBLINK-CONNECT-U"><div class="titlepage"></div><a id="id-1.11.7.20.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.20.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 xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navfooter"><hr></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.11. 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 10.23 Documentation">Home</a></td><td width="40%" align="right" valign="top"> dblink_disconnect</td></tr></table></div></body></html>