Avoid using SplitIdentifierString to parse ListenAddresses, too.
authorTom Lane <[email protected]>
Wed, 13 Nov 2019 18:51:58 +0000 (13:51 -0500)
committerTom Lane <[email protected]>
Wed, 13 Nov 2019 18:51:58 +0000 (13:51 -0500)
This gets rid of our former behavior of forcibly downcasing
the postmaster's hostname list and truncating the elements to
NAMEDATALEN.  In principle, DNS hostnames are case-insensitive
so the first behavior should be harmless, and server hostnames
are seldom long enough for the second behavior to be an issue.
But it's still dubious, and an easy fix is available: just use
SplitGUCList instead.

AFAICT, all other SplitIdentifierString calls in the backend are
OK: either the items actually are SQL identifiers, or they are
keywords that are short and case-insensitive.

Per thinking about bug #16106.  While this has been wrong for
a very long time, the lack of field complaints means there's
little reason to back-.

Discussion: https://postgr.es/m/16106-7d319e4295d08e70@postgresql.org

src/backend/postmaster/postmaster.c

index 5f3035916521ad085f34e05c595792d237a15f51..9ff2832c002b34cb6ddf295ad9906ec7dda05f5b 100644 (file)
@@ -1134,7 +1134,7 @@ PostmasterMain(int argc, char *argv[])
                rawstring = pstrdup(ListenAddresses);
 
                /* Parse string into list of hostnames */
-               if (!SplitIdentifierString(rawstring, ',', &elemlist))
+               if (!SplitGUCList(rawstring, ',', &elemlist))
                {
                        /* syntax error in list */
                        ereport(FATAL,