Skip site navigation (1) Skip section navigation (2)

pg_stats queries versus per-database encodings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: pg_stats queries versus per-database encodings
Date: 2009-01-03 21:20:43
Message-ID: 10396.1231017643@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
I notice that the pg_stat_statements patch is applying pg_mbcliplen()
to query strings, in the fond illusion that it knows what encoding
they are in.

This brings up a bigger issue, namely that pg_stat_activity isn't
exactly encoding-proof either --- whatever encoding is in use in a
particular database is what query strings from backends in that database
will be stored in.  Readers in another database will be exposed to
strings that probably aren't encoded correctly for their DB.

We could attack this by including source database's encoding in the
shared-memory entries, and performing a conversion on the fly when
reading out the data.  However, what happens if the conversion fails?
Seems like this provides a way for users to hide their queries from
the DBA ... just include a comment with some characters that are
untranslatable.

Thoughts?

			regards, tom lane

Responses

pgsql-hackers by date

Next:From: Guillaume LelargeDate: 2009-01-03 21:21:57
Subject: Re: Latest version of Hot Standby patch
Previous:From: Magnus HaganderDate: 2009-01-03 20:16:49
Subject: Re: reloptions and toast tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group