diff options
Diffstat (limited to 'src/backend/commands/define.c')
-rw-r--r-- | src/backend/commands/define.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/backend/commands/define.c b/src/backend/commands/define.c index 009dcfd17d8..2fd919dd546 100644 --- a/src/backend/commands/define.c +++ b/src/backend/commands/define.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/define.c,v 1.104 2009/04/04 21:12:31 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/define.c,v 1.105 2009/07/26 23:34:17 tgl Exp $ * * DESCRIPTION * The "DefineFoo" routines take the parse tree and pick out the @@ -133,7 +133,7 @@ defGetBoolean(DefElem *def) return true; /* - * Allow 0, 1, "true", "false" + * Allow 0, 1, "true", "false", "on", "off" */ switch (nodeTag(def->arg)) { @@ -153,11 +153,18 @@ defGetBoolean(DefElem *def) { char *sval = defGetString(def); + /* + * The set of strings accepted here should match up with + * the grammar's opt_boolean production. + */ if (pg_strcasecmp(sval, "true") == 0) return true; if (pg_strcasecmp(sval, "false") == 0) return false; - + if (pg_strcasecmp(sval, "on") == 0) + return true; + if (pg_strcasecmp(sval, "off") == 0) + return false; } break; } |