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

Commit3a73060

Browse files
author
Thomas G. Lockhart
committed
Add other initialization environment variables:
PGCOSTHEAP, PGCOSTINDEX, PGRPLANS, PGGEQO (PGDATESTYLE, PGTZ already defined)
1 parentf331145 commit3a73060

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
#ifdefCONNECTDEBUG
665675
printf("Use environment variable %s to send %s\n",eo->envName,setQuery);
666676
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp