VACUUM fails to parse 0 and 1 as boolean value

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: VACUUM fails to parse 0 and 1 as boolean value
Date: 2019-05-14 17:45:21
Message-ID: CAHGQGwGYg82A8UCQxZe7Zn9MnyUBGdyB=1CNpKF3jBny+RbyfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

VACUUM fails to parse 0 and 1 as boolean value

The document for VACUUM explains

boolean
Specifies whether the selected option should be turned on or off.
You can write TRUE, ON, or 1 to enable the option, and FALSE, OFF,
or 0 to disable it.

But VACUUM fails to parse 0 and 1 as boolean value as follows.

=# VACUUM (INDEX_CLEANUP 1);
ERROR: syntax error at or near "1" at character 23
STATEMENT: VACUUM (INDEX_CLEANUP 1);

This looks a bug. The cause of this is a lack of NumericOnly clause
for vac_analyze_option_arg in gram.y. The attached patch
adds such NumericOnly. The bug exists only in 12dev.

Barring any objection, I will commit the patch.

Regards,

--
Fujii Masao

Attachment Content-Type Size
vacuum_numeric_as_boolean.patch application/octet-stream 396 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-05-14 17:52:23 Re: VACUUM fails to parse 0 and 1 as boolean value
Previous Message Tom Lane 2019-05-14 16:22:03 Re: SQL-spec incompatibilities in similar_escape() and related stuff