Skip to content

Commit de97e7f

Browse files
committed
SET geqo TO ON|OFF
1 parent a4792bd commit de97e7f

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

src/backend/tcop/variable.c

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Routines for handling of 'SET var TO', 'SHOW var' and 'RESET var'
33
* statements.
44
*
5-
* $Id: variable.c,v 1.6 1997/04/24 15:41:37 vadim Exp $
5+
* $Id: variable.c,v 1.7 1997/04/29 04:38:58 vadim Exp $
66
*
77
*/
88

@@ -16,6 +16,7 @@
1616

1717
extern Cost _cpu_page_wight_;
1818
extern Cost _cpu_index_page_wight_;
19+
extern bool _use_geqo_;
1920

2021
/*-----------------------------------------------------------------------*/
2122
#if USE_EURODATES
@@ -69,6 +70,40 @@ static bool reset_null(const char *value)
6970
return TRUE;
7071
}
7172

73+
static bool parse_geqo (const char *value)
74+
{
75+
76+
if ( strcasecmp (value, "on") == 0 )
77+
_use_geqo_ = true;
78+
else if ( strcasecmp (value, "off") == 0 )
79+
_use_geqo_ = false;
80+
else
81+
elog(WARN, "Bad value for GEQO (%s)", value);
82+
83+
return TRUE;
84+
}
85+
86+
static bool show_geqo ()
87+
{
88+
89+
if ( _use_geqo_ )
90+
elog (NOTICE, "GEQO is ON");
91+
else
92+
elog (NOTICE, "GEQO is OFF");
93+
return TRUE;
94+
}
95+
96+
static bool reset_geqo ()
97+
{
98+
99+
#ifdef GEQO
100+
_use_geqo_ = true;
101+
#else
102+
_use_geqo_ = false;
103+
#endif
104+
return TRUE;
105+
}
106+
72107
static bool parse_cost_heap (const char *value)
73108
{
74109
float32 res = float4in ((char*)value);
@@ -202,6 +237,7 @@ struct VariableParsers
202237
show_cost_heap, reset_cost_heap },
203238
{ "cost_index", parse_cost_index,
204239
show_cost_index, reset_cost_index },
240+
{ "geqo", parse_geqo, show_geqo, reset_geqo },
205241
{ NULL, NULL, NULL }
206242
};
207243

0 commit comments

Comments
 (0)