Re: Syslog Facility Patch - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Syslog Facility Patch
Date
Msg-id Pine.LNX.4.21.0011151954510.779-100000@peter.localdomain
Whole thread Raw
In response to Re: Syslog Facility Patch  (Larry Rosenman <ler@lerctr.org>)
Responses Re: Syslog Facility Patch  (Larry Rosenman <ler@lerctr.org>)
List pgsql-hackers
Larry Rosenman writes:

> > syntax is lexically compatible with the syntax of the SET command.  
> > Therefore you can't have "funny" characters in 'value' unless
> > single-quoted.
> I added period(.), hyphen(-), and underscore(_).

Probably '/' and ':' as well, for krb_server_keyfile.

> ! UNQUOTED_STRING {LETTER}({LETTER_OR_DIGIT}|[-._])*
> ! STRING          (\'|\")([^'"\n]|\\.)*(\'|\")

That will accept strings that start with one kind of quote and end with
another.  Please stick to single-quotes only, unless you want to make a
case for the double-quotes.

I'm also not quite sure about

> +         if (s[i] == '\'')
> +         {
> + 
> +             /*
> +              * Note: if scanner is working right, unescaped quotes can
> +              * only appear in pairs, so there should be another character.
> +              */
> +             i++;
> +             newStr[j] = s[i];
> +         }

The SQL scanner accepts 'foo''bar' as the SQL-approved method of escaping
quotes in quotes.  GUC doesn't do that (way too complicated for now), so
this probably needs to be adjusted.

Other than that, looks good.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



pgsql-hackers by date:

Previous
From: "Mikheev, Vadim"
Date:
Subject: RE: RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)
Next
From: Don Baccus
Date:
Subject: Re: Re: [GENERAL] PHPBuilder article -- Postgres vs MySQL