postgresql/src/backend
Tom Lane ec7eef6b11 Avoid caching expression state trees for domain constraints across queries.
In commit 8abb3cda0d I attempted to cache
the expression state trees constructed for domain CHECK constraints for
the life of the backend (assuming the domain's constraints don't get
redefined).  However, this turns out not to work very well, because
execQual.c will run those state trees with ecxt_per_query_memory pointing
to a query-lifespan context, and in some situations we'll end up with
pointers into that context getting stored into the state trees.  This
happens in particular with SQL-language functions, as reported by
Emre Hasegeli, but there are many other cases.

To fix, keep only the expression plan trees for domain CHECK constraints
in the typcache's data structure, and revert to performing ExecInitExpr
(at least) once per query to set up expression state trees in the query's
context.

Eventually it'd be nice to undo this, but that will require some careful
thought about memory management for expression state trees, and it seems
far too late for any such redesign in 9.5.  This way is still much more
efficient than what happened before 8abb3cda0.
2015-11-29 18:18:42 -05:00
..
access Fix typo in comment. 2015-11-19 16:45:39 -05:00
bootstrap pgindent run for 9.5 2015-05-23 21:35:49 -04:00
catalog Fix handling of inherited check constraints in ALTER COLUMN TYPE (again). 2015-11-20 14:55:47 -05:00
commands COPY (INSERT/UPDATE/DELETE .. RETURNING ..) 2015-11-27 19:11:22 +03:00
executor Avoid server crash when worker registration fails at execution time. 2015-11-20 13:03:39 -05:00
foreign Code review for foreign/custom join pushdown patch. 2015-05-10 14:36:36 -04:00
lib Avoid use of float arithmetic in bipartite_match.c. 2015-08-23 13:02:18 -04:00
libpq Message improvements 2015-11-16 21:39:23 -05:00
main Revoke support for strxfrm() that write past the specified array length. 2015-07-08 20:44:21 -04:00
nodes Provide readfuncs support for custom scans. 2015-11-12 07:40:31 -05:00
optimizer Fix incomplete set_foreignscan_references handling for fdw_recheck_quals 2015-11-18 22:12:21 -05:00
parser COPY (INSERT/UPDATE/DELETE .. RETURNING ..) 2015-11-27 19:11:22 +03:00
po Translation updates 2015-06-28 23:56:55 -04:00
port On Windows, ensure shared memory handle gets closed if not being used. 2015-10-13 11:21:33 -04:00
postmaster Message improvements 2015-11-16 21:39:23 -05:00
regex Fix enforcement of restrictions inside regexp lookaround constraints. 2015-11-07 12:43:24 -05:00
replication Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:21:31 -05:00
rewrite Apply SELECT policies in INSERT/UPDATE+RETURNING 2015-10-05 07:55:13 -04:00
snowball Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
storage Message improvements 2015-11-16 21:39:23 -05:00
tcop Fix problems with ParamListInfo serialization mechanism. 2015-11-02 18:11:29 -05:00
tsearch pgindent run for 9.5 2015-05-23 21:35:49 -04:00
utils Avoid caching expression state trees for domain constraints across queries. 2015-11-29 18:18:42 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Revert "Have dtrace depend on object files directly, not objfiles.txt" 2015-10-15 13:16:03 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
nls.mk Remove trailing slashes from directories in find command 2015-09-18 22:06:54 -04:00