-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Queries covering deleted relations #15
Comments
On 27 January 2013 02:26, Michael Renner [email protected] wrote:
That would need a DDL trigger to make it work, so not at present. Simon Riggs http://www.2ndQuadrant.com/ |
@terrorobe Yeah, that's possible. Just discriminate against ERRCODE_UNDEFINED_TABLE errors when pg_stat_plans catches errors that the underlying query might throw up. All of these Actually, you'd probably want to look for all of these: ERRCODE_UNDEFINED_COLUMN Mostly these errors are thrown up during parse analysis. There are scenarios in which we may unsuccessfully detect that a query is prepared, as with the "single level, multiple entries for same client query" scenario that we recently saw with SQL functions. Maybe we could teach pg_stat_plans to be smarter about those cases, but ERRCODE_UNDEFINED_PARAMETER would be a good one for catching any that may remain. |
I should add that it would be nice if pg_stat_plans didn't propagate these and similar "expected" errors to clients, but rather just returned NULL. That way, it would be relatively straightforward to get plans for the entire hash table cache in a single query. |
Yes - handling such errors gracefully would be nice - in most cases we don't overly care if we can't explain some plans. In our collector we fetch the explain output for each plan separately which causes a linear increase in runtime. |
While rolling out pg_stat_plans on more databases I noticed problems with queries containing dropped relations:
Is it possible to set query_explainable to false for queries where one of the needed relations doesn't exist anymore/at the moment?
The text was updated successfully, but these errors were encountered: