On 02/06/2014 11:11 PM, Tom Lane wrote:
> Craig Ringer <craig@2ndquadrant.com> writes:
>> We don't rerun rewrite on plan invalidation.
>
> Don't we? plancache.c certainly does, in fact it starts from the raw
> grammar output. Skipping the rewriter would mean failing to respond
> to CREATE OR REPLACE VIEW, for example.
I was thinking about exactly that case as I went to sleep - especially
as it's things like CREATE OR REPLACE VIEW that prevent me from just
rewriting the security qual when it's initially added, before storage in
the catalogs.
I could've sworn discussion around row security in the past concluded
that it couldn't be properly done in the rewriter because of an
inability to correctly invalidate plans. Searching the archives, though,
I don't find anything to support that. I'll just say I'm glad to be
wrong, and proceed from there.
-- Craig Ringer http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services