2 .\" Title: dblink_connect_u
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "DBLINK_CONNECT_U" "3" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 dblink_connect_u \- opens a persistent connection to a remote database, insecurely
35 dblink_connect_u(text connstr) returns text
36 dblink_connect_u(text connname, text connstr) returns text
40 \fBdblink_connect_u()\fR
42 \fBdblink_connect()\fR, except that it will allow non\-superusers to connect using any authentication method\&.
44 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
46 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
48 file belonging to the server\*(Aqs user\&. This opens not only a risk of impersonation, but the possibility of exposing a password to an untrustworthy remote server\&. Therefore,
49 \fBdblink_connect_u()\fR
50 is initially installed with all privileges revoked from
51 PUBLIC, making it un\-callable except by superusers\&. In some situations it may be appropriate to grant
54 \fBdblink_connect_u()\fR
55 to specific users who are considered trustworthy, but this should be done with care\&. It is also recommended that any
57 file belonging to the server\*(Aqs user
59 contain any records specifying a wildcard host name\&.
61 For further details see
62 \fBdblink_connect()\fR\&.