Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc859cda

Browse files
committed
Document libpq service capability, and add sample file.
1 parent973a210 commitc859cda

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

‎doc/src/sgml/libpq.sgml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.104 2003/01/06 22:48:16 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.105 2003/01/07 04:25:29 momjian Exp $
33
-->
44

55
<chapter id="libpq">
@@ -209,6 +209,19 @@ PGconn *PQconnectdb(const char *conninfo)
209209
</para>
210210
</listitem>
211211
</varlistentry>
212+
213+
<varlistentry>
214+
<term><literal>service</literal></term>
215+
<listitem>
216+
<para>
217+
Service name to use for additional parameters. It specifies a service
218+
name in pg_service.conf that holds additional connection parameters.
219+
This allows applications to specify only a service name so connection parameters
220+
can be centrally maintained. See <literal>pg_service.conf.sample</> for
221+
information on how to set up the file.
222+
</para>
223+
</listitem>
224+
</varlistentry>
212225
</variablelist>
213226

214227
If any parameter is unspecified, then the corresponding

‎src/backend/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.90 2003/01/06 03:18:26 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.91 2003/01/07 04:25:29 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -140,8 +140,9 @@ else
140140
> $(srcdir)/libpq/pg_hba.conf.sample.no_ipv6
141141
$(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample.no_ipv6 $(DESTDIR)$(datadir)/pg_hba.conf.sample
142142
endif
143+
$(INSTALL_DATA) $(srcdir)/libpq/pg_service.conf.sample $(DESTDIR)$(datadir)/pg_service.conf.sample
143144
$(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample $(DESTDIR)$(datadir)/pg_ident.conf.sample
144-
$(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample $(DESTDIR)$(datadir)/postgresql.conf.sample
145+
$(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample $(DESTDIR)$(datadir)/postgresql.conf.sample
145146

146147
install-bin: postgres$(POSTGRES_IMP) installdirs
147148
$(INSTALL_PROGRAM) postgres$(X)$(DESTDIR)$(bindir)/postgres$(X)
@@ -179,8 +180,9 @@ endif
179180
endif
180181
$(MAKE) -C catalog uninstall-data
181182
rm -f $(DESTDIR)$(datadir)/pg_hba.conf.sample \
183+
$(DESTDIR)$(datadir)/pg_service.conf.sample \
182184
$(DESTDIR)$(datadir)/pg_ident.conf.sample \
183-
$(DESTDIR)$(datadir)/postgresql.conf.sample
185+
$(DESTDIR)$(datadir)/postgresql.conf.sample
184186

185187

186188
##########################################################################

‎src/interfaces/libpq/fe-connect.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.218 2003/01/06 22:48:16 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.219 2003/01/07 04:25:29 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2338,14 +2338,11 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage)
23382338
return1;
23392339
}
23402340

2341-
/*As default, set the database name to the name of the service */
2341+
/*If not already set, set the database name to the name of the service */
23422342
for (i=0;options[i].keyword;i++)
23432343
if (strcmp(options[i].keyword,"dbname")==0)
2344-
{
2345-
if (options[i].val!=NULL)
2346-
free(options[i].val);
2347-
options[i].val=strdup(service);
2348-
}
2344+
if (options[i].val==NULL)
2345+
options[i].val=strdup(service);
23492346

23502347
while ((line=fgets(buf,MAXBUFSIZE-1,f))!=NULL)
23512348
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp