1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +03:00

Remove most compile-time options, add a few runtime options to make up for it.

In particular, no more compiled-in default for PGDATA or LIBDIR.  Commands
that need them need either invocation options or environment variables.
PGPORT default is hardcoded as 5432, but overrideable with options or
environment variables.
This commit is contained in:
Bryan Henderson
1996-11-14 10:25:54 +00:00
parent 7ac541daf1
commit f64b840387
25 changed files with 1943 additions and 1908 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.18 1996/11/11 12:16:54 scrappy Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.19 1996/11/14 10:25:50 bryanh Exp $
*
*-------------------------------------------------------------------------
*/
@ -63,7 +63,7 @@ static void conninfo_free(void);
/* ----------
* Definition of the conninfo parametes and their fallback resources.
* Definition of the conninfo parameters and their fallback resources.
* If Environment-Var and Compiled-in are specified as NULL, no
* fallback is available. If after all no value can be determined
* for an option, an error is returned.
@ -93,7 +93,7 @@ static PQconninfoOption PQconninfoOptions[] = {
{ "host", "PGHOST", DefaultHost, NULL,
"Database-Host", "", 40 },
{ "port", "PGPORT", POSTPORT, NULL,
{ "port", "PGPORT", DEF_PGPORT, NULL,
"Database-Port", "", 6 },
{ "tty", "PGTTY", DefaultTty, NULL,
@ -192,7 +192,6 @@ PQconnectdb(const char *conninfo)
conn->Pfdebug = NULL;
conn->port = NULL;
conn->notifyList = DLNewList();
conn->lobjfuncs = NULL;
conn->pghost = strdup(conninfo_getval("host"));
conn->pgport = strdup(conninfo_getval("port"));
@ -300,7 +299,6 @@ PQsetdb(const char *pghost, const char* pgport, const char* pgoptions, const cha
conn->Pfdebug = NULL;
conn->port = NULL;
conn->notifyList = DLNewList();
conn->lobjfuncs = NULL;
if (!pghost || pghost[0] == '\0') {
if (!(tmp = getenv("PGHOST"))) {
@ -312,7 +310,7 @@ PQsetdb(const char *pghost, const char* pgport, const char* pgoptions, const cha
if (!pgport || pgport[0] == '\0') {
if (!(tmp = getenv("PGPORT"))) {
tmp = POSTPORT;
tmp = DEF_PGPORT;
}
conn->pgport = strdup(tmp);
} else
@ -521,7 +519,6 @@ freePGconn(PGconn *conn)
if (conn->dbName) free(conn->dbName);
if (conn->pguser) free(conn->pguser);
if (conn->notifyList) DLFreeList(conn->notifyList);
if (conn->lobjfuncs) free(conn->lobjfuncs);
free(conn);
}