postgresql/src/backend/rewrite
Stephen Frost 6f8cb1e234 Make viewquery a copy in rewriteTargetView()
Rather than expect the Query returned by get_view_query() to be
read-only and then copy bits and pieces of it out, simply copy the
entire structure when we get it.  This addresses an issue where
AcquireRewriteLocks, which is called by acquireLocksOnSubLinks(),
scribbles on the parsetree passed in, which was actually an entry
in relcache, leading to segfaults with certain view definitions.
This also future-proofs us a bit for anyone adding more code to this
path.

The acquireLocksOnSubLinks() was added in commit c3e0ddd40.

Back-patch to 9.3 as that commit was.
2015-12-21 10:34:14 -05:00
..
Makefile Row-Level Security Policies (RLS) 2014-09-19 11:18:35 -04:00
rewriteDefine.c Disallow converting a table to a view if row security is present. 2015-07-28 16:24:01 -07:00
rewriteHandler.c Make viewquery a copy in rewriteTargetView() 2015-12-21 10:34:14 -05:00
rewriteManip.c Get rid of the planner's LateralJoinInfo data structure. 2015-12-11 15:52:38 -05:00
rewriteRemove.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
rewriteSupport.c Update copyright for 2015 2015-01-06 11:43:47 -05:00
rowsecurity.c Apply SELECT policies in INSERT/UPDATE+RETURNING 2015-10-05 07:55:13 -04:00