Skip to content

Commit 3a73060

Browse files
author
Thomas G. Lockhart
committed
Add other initialization environment variables:
PGCOSTHEAP, PGCOSTINDEX, PGRPLANS, PGGEQO (PGDATESTYLE, PGTZ already defined)
1 parent f331145 commit 3a73060

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.45 1997/11/10 15:41:58 thomas Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.46 1997/11/14 15:38:31 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -110,8 +110,15 @@ struct EnvironmentOptions
110110
} EnvironmentOptions[] =
111111

112112
{
113-
{ "PGDATESTYLE", "datestyle" },
114-
{ "PGTZ", "timezone" },
113+
/* common user-interface settings */
114+
{ "PGDATESTYLE", "datestyle" },
115+
{ "PGTZ", "timezone" },
116+
117+
/* internal performance-related settings */
118+
{ "PGCOSTHEAP", "cost_heap" },
119+
{ "PGCOSTINDEX", "cost_index" },
120+
{ "PGRPLANS", "r_plans" },
121+
{ "PGGEQO", "geqo" },
115122
{ NULL }
116123
};
117124

@@ -660,7 +667,10 @@ PQsetenv(PGconn *conn)
660667
{
661668
PGresult *res;
662669

663-
sprintf(setQuery, "SET %s TO '%.60s'", eo->pgName, val);
670+
if (strcasecmp(val, "default") == 0)
671+
sprintf(setQuery, "SET %s = %.60s", eo->pgName, val);
672+
else
673+
sprintf(setQuery, "SET %s = '%.60s'", eo->pgName, val);
664674
#ifdef CONNECTDEBUG
665675
printf("Use environment variable %s to send %s\n", eo->envName, setQuery);
666676
#endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy