Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
contrib-dblink-connect-u.html29 linesDownload Raw Back to html
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>2<!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 — connect to other PostgreSQL databases">Up</a></td><th width="60%" align="center">F.12. dblink — connect to other PostgreSQL databases</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 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.22.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">3dblink_connect_u(text connstr) returns text4dblink_connect_u(text connname, text connstr) returns text5</pre></div><div class="refsect1" id="id-1.11.7.22.6.5"><h2>Description</h2><p>6    <code class="function">dblink_connect_u()</code> is identical to7    <code class="function">dblink_connect()</code>, except that it will allow non-superusers8    to connect using any authentication method.9   </p><p>10    If the remote server selects an authentication method that does not11    involve a password, then impersonation and subsequent escalation of12    privileges can occur, because the session will appear to have13    originated from the user as which the local <span class="productname">PostgreSQL</span>14    server runs.  Also, even if the remote server does demand a password,15    it is possible for the password to be supplied from the server16    environment, such as a <code class="filename">~/.pgpass</code> file belonging to the17    server's user.  This opens not only a risk of impersonation, but the18    possibility of exposing a password to an untrustworthy remote server.19    Therefore, <code class="function">dblink_connect_u()</code> is initially20    installed with all privileges revoked from <code class="literal">PUBLIC</code>,21    making it un-callable except by superusers.  In some situations22    it may be appropriate to grant <code class="literal">EXECUTE</code> permission for23    <code class="function">dblink_connect_u()</code> to specific users who are considered24    trustworthy, but this should be done with care.  It is also recommended25    that any <code class="filename">~/.pgpass</code> file belonging to the server's user26    <span class="emphasis"><em>not</em></span> contain any records specifying a wildcard host name.27   </p><p>28    For further details see <code class="function">dblink_connect()</code>.29   </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 — connect to other PostgreSQL databases">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 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> dblink_disconnect</td></tr></table></div></body></html>
codekingpro/portable-devtools · Team Ai