diff options
| author | Bruce Momjian | 2003-01-07 04:25:29 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2003-01-07 04:25:29 +0000 |
| commit | c859cda7829f69d8d5562236fc012a3ff5f65012 (patch) | |
| tree | f5409447317a488eeacb358e9758d3211d32b5a1 /src | |
| parent | 973a210cce990134f63da12f8ca2d4d0718a103e (diff) | |
Document libpq service capability, and add sample file.
Diffstat (limited to 'src')
| -rw-r--r-- | src/backend/Makefile | 8 | ||||
| -rw-r--r-- | src/interfaces/libpq/fe-connect.c | 11 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/backend/Makefile b/src/backend/Makefile index 9df4b921d10..d53888096c8 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.90 2003/01/06 03:18:26 momjian Exp $ +# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.91 2003/01/07 04:25:29 momjian Exp $ # #------------------------------------------------------------------------- @@ -140,8 +140,9 @@ else > $(srcdir)/libpq/pg_hba.conf.sample.no_ipv6 $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample.no_ipv6 $(DESTDIR)$(datadir)/pg_hba.conf.sample endif + $(INSTALL_DATA) $(srcdir)/libpq/pg_service.conf.sample $(DESTDIR)$(datadir)/pg_service.conf.sample $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample $(DESTDIR)$(datadir)/pg_ident.conf.sample - $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample $(DESTDIR)$(datadir)/postgresql.conf.sample + $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample $(DESTDIR)$(datadir)/postgresql.conf.sample install-bin: postgres $(POSTGRES_IMP) installdirs $(INSTALL_PROGRAM) postgres$(X) $(DESTDIR)$(bindir)/postgres$(X) @@ -179,8 +180,9 @@ endif endif $(MAKE) -C catalog uninstall-data rm -f $(DESTDIR)$(datadir)/pg_hba.conf.sample \ + $(DESTDIR)$(datadir)/pg_service.conf.sample \ $(DESTDIR)$(datadir)/pg_ident.conf.sample \ - $(DESTDIR)$(datadir)/postgresql.conf.sample + $(DESTDIR)$(datadir)/postgresql.conf.sample ########################################################################## diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 7ff4de0debc..0e015f191fa 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.218 2003/01/06 22:48:16 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.219 2003/01/07 04:25:29 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -2338,14 +2338,11 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage) return 1; } - /* As default, set the database name to the name of the service */ + /* If not already set, set the database name to the name of the service */ for (i = 0; options[i].keyword; i++) if (strcmp(options[i].keyword, "dbname") == 0) - { - if (options[i].val != NULL) - free(options[i].val); - options[i].val = strdup(service); - } + if (options[i].val == NULL) + options[i].val = strdup(service); while ((line = fgets(buf, MAXBUFSIZE - 1, f)) != NULL) { |
