On 08/08/2011 01:07 PM, Hannu Krosing wrote:
As far as I understand the problem, the parsing must transform table
references to schema-qualified references. The table_foobar in "SELECT *
FROM table_foobar WHERE id = ?" is not enough to identify a table. Using
search_path, query_str as a key is one possibility, but the search_path
is likely to be different for each user, and this could result in the
same query being cached multiple times.
That is why I think it is best done in the main parser - it has to parse
and analyse the query anyway and likely knows which constants are
"arguments" to the query
By the way, I checked current Git HEAD and pg_stat_statements seems to
not handle search_path correctly. For pg_stat_statements this is not
critical, but if the raw query string is used as plan cache key things
will obviously break...
Sent via pgsql-hackers mailing list (email@example.com)
To make changes to your subscription: