~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to doc/src/sgml/html/libpq-pgpass.html

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
2
<HTML
 
3
><HEAD
 
4
><TITLE
 
5
>The Password File</TITLE
 
6
><META
 
7
NAME="GENERATOR"
 
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
 
9
REV="MADE"
 
10
HREF="mailto:pgsql-docs@postgresql.org"><LINK
 
11
REL="HOME"
 
12
TITLE="PostgreSQL 9.1beta1 Documentation"
 
13
HREF="index.html"><LINK
 
14
REL="UP"
 
15
TITLE="libpq - C Library"
 
16
HREF="libpq.html"><LINK
 
17
REL="PREVIOUS"
 
18
TITLE="Environment Variables"
 
19
HREF="libpq-envars.html"><LINK
 
20
REL="NEXT"
 
21
TITLE="The Connection Service File"
 
22
HREF="libpq-pgservice.html"><LINK
 
23
REL="STYLESHEET"
 
24
TYPE="text/css"
 
25
HREF="stylesheet.css"><META
 
26
HTTP-EQUIV="Content-Type"
 
27
CONTENT="text/html; charset=ISO-8859-1"><META
 
28
NAME="creation"
 
29
CONTENT="2011-04-27T21:20:33"></HEAD
 
30
><BODY
 
31
CLASS="SECT1"
 
32
><DIV
 
33
CLASS="NAVHEADER"
 
34
><TABLE
 
35
SUMMARY="Header navigation table"
 
36
WIDTH="100%"
 
37
BORDER="0"
 
38
CELLPADDING="0"
 
39
CELLSPACING="0"
 
40
><TR
 
41
><TH
 
42
COLSPAN="5"
 
43
ALIGN="center"
 
44
VALIGN="bottom"
 
45
><A
 
46
HREF="index.html"
 
47
>PostgreSQL 9.1beta1 Documentation</A
 
48
></TH
 
49
></TR
 
50
><TR
 
51
><TD
 
52
WIDTH="10%"
 
53
ALIGN="left"
 
54
VALIGN="top"
 
55
><A
 
56
TITLE="Environment Variables"
 
57
HREF="libpq-envars.html"
 
58
ACCESSKEY="P"
 
59
>Prev</A
 
60
></TD
 
61
><TD
 
62
WIDTH="10%"
 
63
ALIGN="left"
 
64
VALIGN="top"
 
65
><A
 
66
TITLE="libpq - C Library"
 
67
HREF="libpq.html"
 
68
>Fast Backward</A
 
69
></TD
 
70
><TD
 
71
WIDTH="60%"
 
72
ALIGN="center"
 
73
VALIGN="bottom"
 
74
>Chapter 31. <SPAN
 
75
CLASS="APPLICATION"
 
76
>libpq</SPAN
 
77
> - C Library</TD
 
78
><TD
 
79
WIDTH="10%"
 
80
ALIGN="right"
 
81
VALIGN="top"
 
82
><A
 
83
TITLE="libpq - C Library"
 
84
HREF="libpq.html"
 
85
>Fast Forward</A
 
86
></TD
 
87
><TD
 
88
WIDTH="10%"
 
89
ALIGN="right"
 
90
VALIGN="top"
 
91
><A
 
92
TITLE="The Connection Service File"
 
93
HREF="libpq-pgservice.html"
 
94
ACCESSKEY="N"
 
95
>Next</A
 
96
></TD
 
97
></TR
 
98
></TABLE
 
99
><HR
 
100
ALIGN="LEFT"
 
101
WIDTH="100%"></DIV
 
102
><DIV
 
103
CLASS="SECT1"
 
104
><H1
 
105
CLASS="SECT1"
 
106
><A
 
107
NAME="LIBPQ-PGPASS"
 
108
>31.14. The Password File</A
 
109
></H1
 
110
><P
 
111
>   The file <TT
 
112
CLASS="FILENAME"
 
113
>.pgpass</TT
 
114
> in a user's home directory or the
 
115
   file referenced by <TT
 
116
CLASS="ENVAR"
 
117
>PGPASSFILE</TT
 
118
> can contain passwords to
 
119
   be used if the connection requires a password (and no password has been
 
120
   specified  otherwise). On Microsoft Windows the file is named
 
121
   <TT
 
122
CLASS="FILENAME"
 
123
>%APPDATA%\postgresql\pgpass.conf</TT
 
124
> (where
 
125
   <TT
 
126
CLASS="FILENAME"
 
127
>%APPDATA%</TT
 
128
> refers to the Application Data subdirectory in
 
129
   the user's profile).
 
130
  </P
 
131
><P
 
132
>   This file should contain lines of the following format:
 
133
</P><PRE
 
134
CLASS="SYNOPSIS"
 
135
><TT
 
136
CLASS="REPLACEABLE"
 
137
><I
 
138
>hostname</I
 
139
></TT
 
140
>:<TT
 
141
CLASS="REPLACEABLE"
 
142
><I
 
143
>port</I
 
144
></TT
 
145
>:<TT
 
146
CLASS="REPLACEABLE"
 
147
><I
 
148
>database</I
 
149
></TT
 
150
>:<TT
 
151
CLASS="REPLACEABLE"
 
152
><I
 
153
>username</I
 
154
></TT
 
155
>:<TT
 
156
CLASS="REPLACEABLE"
 
157
><I
 
158
>password</I
 
159
></TT
 
160
></PRE
 
161
><P>
 
162
   Each of the first four fields can be a literal value, or
 
163
   <TT
 
164
CLASS="LITERAL"
 
165
>*</TT
 
166
>, which matches anything.  The password field from
 
167
   the first line that matches the current connection parameters will be
 
168
   used.  (Therefore, put more-specific entries first when you are using
 
169
   wildcards.) If an entry needs to contain <TT
 
170
CLASS="LITERAL"
 
171
>:</TT
 
172
> or
 
173
   <TT
 
174
CLASS="LITERAL"
 
175
>\</TT
 
176
>, escape this character with <TT
 
177
CLASS="LITERAL"
 
178
>\</TT
 
179
>.
 
180
   A host name of <TT
 
181
CLASS="LITERAL"
 
182
>localhost</TT
 
183
> matches both TCP (host name
 
184
   <TT
 
185
CLASS="LITERAL"
 
186
>localhost</TT
 
187
>) and Unix domain socket (<TT
 
188
CLASS="LITERAL"
 
189
>pghost</TT
 
190
> empty
 
191
   or the default socket directory) connections coming from the local
 
192
   machine. In a standby server, a database name of <TT
 
193
CLASS="LITERAL"
 
194
>replication</TT
 
195
>
 
196
   matches streaming replication connections made to the master server.
 
197
   The <TT
 
198
CLASS="LITERAL"
 
199
>database</TT
 
200
> field is of limited usefulness because
 
201
   users have the same password for all databases in the same cluster.
 
202
  </P
 
203
><P
 
204
>   On Unix systems, the permissions on <TT
 
205
CLASS="FILENAME"
 
206
>.pgpass</TT
 
207
> must
 
208
   disallow any access to world or group; achieve this by the command
 
209
   <TT
 
210
CLASS="COMMAND"
 
211
>chmod 0600 ~/.pgpass</TT
 
212
>.  If the permissions are less
 
213
   strict than this, the file will be ignored.  On Microsoft Windows, it
 
214
   is assumed that the file is stored in a directory that is secure, so
 
215
   no special permissions check is made.
 
216
  </P
 
217
></DIV
 
218
><DIV
 
219
CLASS="NAVFOOTER"
 
220
><HR
 
221
ALIGN="LEFT"
 
222
WIDTH="100%"><TABLE
 
223
SUMMARY="Footer navigation table"
 
224
WIDTH="100%"
 
225
BORDER="0"
 
226
CELLPADDING="0"
 
227
CELLSPACING="0"
 
228
><TR
 
229
><TD
 
230
WIDTH="33%"
 
231
ALIGN="left"
 
232
VALIGN="top"
 
233
><A
 
234
HREF="libpq-envars.html"
 
235
ACCESSKEY="P"
 
236
>Prev</A
 
237
></TD
 
238
><TD
 
239
WIDTH="34%"
 
240
ALIGN="center"
 
241
VALIGN="top"
 
242
><A
 
243
HREF="index.html"
 
244
ACCESSKEY="H"
 
245
>Home</A
 
246
></TD
 
247
><TD
 
248
WIDTH="33%"
 
249
ALIGN="right"
 
250
VALIGN="top"
 
251
><A
 
252
HREF="libpq-pgservice.html"
 
253
ACCESSKEY="N"
 
254
>Next</A
 
255
></TD
 
256
></TR
 
257
><TR
 
258
><TD
 
259
WIDTH="33%"
 
260
ALIGN="left"
 
261
VALIGN="top"
 
262
>Environment Variables</TD
 
263
><TD
 
264
WIDTH="34%"
 
265
ALIGN="center"
 
266
VALIGN="top"
 
267
><A
 
268
HREF="libpq.html"
 
269
ACCESSKEY="U"
 
270
>Up</A
 
271
></TD
 
272
><TD
 
273
WIDTH="33%"
 
274
ALIGN="right"
 
275
VALIGN="top"
 
276
>The Connection Service File</TD
 
277
></TR
 
278
></TABLE
 
279
></DIV
 
280
></BODY
 
281
></HTML
 
282
>
 
 
b'\\ No newline at end of file'