Hello, At Mon, 22 Feb 2016 22:52:29 +0900, Fujii Masao <masao.fu...@gmail.com> wrote in <CAHGQGwENujogaQvcc=u0tffnffgtwxnb1yfcphdtycjdg1_...@mail.gmail.com> > On Tue, Feb 16, 2016 at 4:19 PM, Masahiko Sawada <sawada.m...@gmail.com> > wrote: > > On Mon, Feb 15, 2016 at 2:54 PM, Michael Paquier > > <michael.paqu...@gmail.com> wrote: > >> On Mon, Feb 15, 2016 at 2:11 PM, Kyotaro HORIGUCHI wrote: > >>> Surprizingly yes. The list is handled as an identifier list and > >>> parsed by SplitIdentifierString thus it can accept double-quoted > >>> names. > >> > > > > Attached latest version patch which has only feature logic so far. > > I'm writing document patch about this feature now, so this version > > patch doesn't have document and regression test patch. > > Thanks for updating the patch! > > When I changed s_s_names to 'hoge*' and reloaded the configuration file, > the server crashed unexpectedly with the following error message. > This is obviously a bug. > > FATAL: syntax error
I had a glance on the lexer part in the new patch. It'd be better to design the lexer from the beginning according to the required behavior. The documentation for the syntax is saying as the following, http://www.postgresql.org/docs/current/static/runtime-config-logging.html > application_name (string) > > The application_name can be any string of less than NAMEDATALEN > characters (64 characters in a standard build). <snip> Only > printable ASCII characters may be used in the application_name > value. Other characters will be replaced with question marks (?). And according to what some functions mentioned so far do, totally an application_name is treated as follwoing, I suppose. - check_application_name() currently allows [\x20-\x7e], which differs from the definition of the SQL identifiers. - SplitIdentifierString() and syncrep code - allows any byte except a double quote in double-quoted representation. A double-quote just after a delimiter can open quoted representation. - Non-quoted name can contain any character including double quotes except ',' and white spaces. - The syncrep code does case-insensitive matching with the application_name. So, to preserve or following the current behavior expct the last one, the following pattern definitions would do. The lexer/grammer for the new format of s_s_names could be simpler than what it is. space [ \n\r\f\t\v] /* See the definition of isspace(3) */ whitespace {space}+ dquote \" app_name_chars [\x21-\x2b\x2d-\x7e] /* excluding ' ', ',' */ app_name_indq_chars [\x20\x21\x23-\x7e] /* excluding '"' */ app_name_dq_chars ({app_name_indq_chars}|{dquote}{dquote}) delimiter {whitespace}*,{whitespace}* app_name ({app_name_chars}+|{dquote}{app_name_dq_chars}+{dquote}) s_s_names {app_name}({delimiter}{app_name})* regards, -- Kyotaro Horiguchi NTT Open Source Software Center -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers