~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-proposed

« back to all changes in this revision

Viewing changes to src/include/utils/plancache.h

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-07-24 16:13:59 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20140724161359-uk325qfv03euxuuh
Tags: 9.3.5-0ubuntu0.14.04.1
* New upstream bug fix release: (LP: #1348176)
  - pg_upgrade: Users who upgraded to version 9.3 using pg_upgrade may have
    an issue with transaction information which causes VACUUM to eventually
    fail. These users should run the script provided in the release notes to
    determine if their installation is affected, and then take the remedy
    steps outlined there.
  - Various data integrity and other bug fixes.
  - Secure Unix-domain sockets of temporary postmasters started during make
    check.
    Any local user able to access the socket file could connect as the
    server's bootstrap superuser, then proceed to execute arbitrary code as
    the operating-system user running the test, as we previously noted in
    CVE-2014-0067. This change defends against that risk by placing the
    server's socket in a temporary, mode 0700 subdirectory of /tmp.
  - See release notes for details:
    http://www.postgresql.org/about/news/1534/
* Remove pg_regress patches to support --host=/path, obsolete with above
  upstream changes and not applicable any more.
* Drop tcl8.6 patch, applied upstream.
* Add missing logrotate test dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 * the analyzed-and-rewritten query tree, and rebuild it when next needed.
31
31
 *
32
32
 * An actual execution plan, represented by CachedPlan, is derived from the
33
 
 * CachedPlanSource when we need to execute the query.  The plan could be
 
33
 * CachedPlanSource when we need to execute the query.  The plan could be
34
34
 * either generic (usable with any set of plan parameters) or custom (for a
35
35
 * specific set of parameters).  plancache.c contains the logic that decides
36
36
 * which way to do it for any particular execution.  If we are using a generic
61
61
 * allows the query tree to be discarded easily when it is invalidated.
62
62
 *
63
63
 * Some callers wish to use the CachedPlan API even with one-shot queries
64
 
 * that have no reason to be saved at all.      We therefore support a "oneshot"
65
 
 * variant that does no data copying or invalidation checking.  In this case
 
64
 * that have no reason to be saved at all.  We therefore support a "oneshot"
 
65
 * variant that does no data copying or invalidation checking.  In this case
66
66
 * there are no separate memory contexts: the CachedPlanSource struct and
67
67
 * all subsidiary data live in the caller's CurrentMemoryContext, and there
68
 
 * is no way to free memory short of clearing that entire context.      A oneshot
 
68
 * is no way to free memory short of clearing that entire context.  A oneshot
69
69
 * plan is always treated as unsaved.
70
70
 *
71
71
 * Note: the string referenced by commandTag is not subsidiary storage;
72
 
 * it is assumed to be a compile-time-constant string.  As with portals,
 
72
 * it is assumed to be a compile-time-constant string.  As with portals,
73
73
 * commandTag shall be NULL if and only if the original query string (before
74
74
 * rewriting) was an empty string.
75
75
 */
114
114
 * CachedPlan represents an execution plan derived from a CachedPlanSource.
115
115
 * The reference count includes both the link from the parent CachedPlanSource
116
116
 * (if any), and any active plan executions, so the plan can be discarded
117
 
 * exactly when refcount goes to zero.  Both the struct itself and the
 
117
 * exactly when refcount goes to zero.  Both the struct itself and the
118
118
 * subsidiary data live in the context denoted by the context field.
119
119
 * This makes it easy to free a no-longer-needed cached plan.  (However,
120
120
 * if is_oneshot is true, the context does not belong solely to the CachedPlan