Doc: modernize comment for boolin().

Most of the behavior described by this comment was moved to
parse_bool_with_len() some time ago.  Move what's still
valuable there too, and drop the rest.

Peter Smith

Discussion: https://postgr.es/m/CAHut+PtMJURKp=U8Z=Ktp0zV40sEb1f-iEk9FvY2GQe+5ZBnwg@mail.gmail.com
This commit is contained in:
Tom Lane 2023-10-19 11:31:05 -04:00
parent 5147ab1dd3
commit 8483a54b7d

View File

@ -35,6 +35,7 @@ parse_bool(const char *value, bool *result)
bool bool
parse_bool_with_len(const char *value, size_t len, bool *result) parse_bool_with_len(const char *value, size_t len, bool *result)
{ {
/* Check the most-used possibilities first. */
switch (*value) switch (*value)
{ {
case 't': case 't':
@ -119,12 +120,7 @@ parse_bool_with_len(const char *value, size_t len, bool *result)
*****************************************************************************/ *****************************************************************************/
/* /*
* boolin - converts "t" or "f" to 1 or 0 * boolin - input function for type boolean
*
* Check explicitly for "true/false" and TRUE/FALSE, 1/0, YES/NO, ON/OFF.
* Reject other values.
*
* In the switch statement, check the most-used possibilities first.
*/ */
Datum Datum
boolin(PG_FUNCTION_ARGS) boolin(PG_FUNCTION_ARGS)