2020年10月23日(金) 12:12 Michael Paquier <[email protected]>:
>
> On Fri, Oct 23, 2020 at 11:34:06AM +0900, Ian Lawrence Barwick wrote:
> > Not that I've ever had to do this (or would want to do it on a production
> > system), but this error message seems incorrect:
> >
> > postgres=# ALTER SYSTEM SET unix_socket_directories =
> > '/tmp/sock1','/tmp/sock2';
> > ERROR: SET unix_socket_directories takes only one argument
> >
> > Trivial patch attached.
>
> I have never seen that case, but I think that you are right. Still,
> that's not the end of it, see by yourself what the following command
> generates with only your patch, which is fancy:
> ALTER SYSTEM SET unix_socket_directories = '/tmp/sock1','/tmp/, sock2';
>
> We need an extra GUC_LIST_QUOTE on top of what you are proposing.
Ah yes, good point.
Updated version attached.
Regards
Ian Barwick
--
EnterpriseDB: https://www.enterprisedb.com
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index a62d64eaa4..bb34630e8e 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -4173,7 +4173,7 @@ static struct config_string ConfigureNamesString[] =
{"unix_socket_directories", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
gettext_noop("Sets the directories where Unix-domain sockets will be created."),
NULL,
- GUC_SUPERUSER_ONLY
+ GUC_LIST_INPUT | GUC_LIST_QUOTE | GUC_SUPERUSER_ONLY
},
&Unix_socket_directories,
#ifdef HAVE_UNIX_SOCKETS