[TNM] pgAdmin III entries getting picked up when they shouldn't be

Greg Sabino Mullane greg at endpoint.com
Thu Jun 16 16:21:42 UTC 2016


> > The problem is that we have no way of knowing when the application
> > name ends and when the next field begin (in this case, a comma and
> > the word 'client'). As the application_name field is very free-form,
> > and does not get quoted, it can contain a comma. I do not know if
> > there is a canonical solution to this problem, but perhaps we can at
> > least devise some sort of clever workaround? Ideas and patches
> > welcome.
> >
> 
> Sounds like maybe PostgreSQL should quote the appname as I'm sure pgBadger
> and other tools are all dealing with this too

Yeah, although that leads to a twisty maze of escaped characters. I'm wondering 
if a solution for your particular case (and similar ones) is to simply make 
the regex a typical non-greedy dot-star, but only doing that if there is some 
string *after* the %a in the log_line_prefix. Would require a lot more brains 
to the log_line_prefix section, but it should work, e.g.:

app=.+?,client=\S+

-- 
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <https://mail.endcrypt.com/pipermail/tnm/attachments/20160616/d4ca14fb/attachment-0001.sig>


More information about the TNM mailing list