postgresql/src/backend
Tom Lane decb08ebdf Code review for NextValueExpr expression node type.
Add missing infrastructure for this node type, notably in ruleutils.c where
its lack could demonstrably cause EXPLAIN to fail.  Add outfuncs/readfuncs
support.  (outfuncs support is useful today for debugging purposes.  The
readfuncs support may never be needed, since at present it would only
matter for parallel query and NextValueExpr should never appear in a
parallelizable query; but it seems like a bad idea to have a primnode type
that isn't fully supported here.)  Teach planner infrastructure that
NextValueExpr is a volatile, parallel-unsafe, non-leaky expression node
with cost cpu_operator_cost.  Given its limited scope of usage, there
*might* be no live bug today from the lack of that knowledge, but it's
certainly going to bite us on the rear someday.  Teach pg_stat_statements
about the new node type, too.

While at it, also teach cost_qual_eval() that MinMaxExpr, SQLValueFunction,
XmlExpr, and CoerceToDomain should be charged as cpu_operator_cost.
Failing to do this for SQLValueFunction was an oversight in my commit
0bb51aa96.  The others are longer-standing oversights, but no time like the
present to fix them.  (In principle, CoerceToDomain could have cost much
higher than this, but it doesn't presently seem worth trying to examine the
domain's constraints here.)

Modify execExprInterp.c to execute NextValueExpr as an out-of-line
function; it seems quite unlikely to me that it's worth insisting that
it be inlined in all expression eval methods.  Besides, providing the
out-of-line function doesn't stop anyone from inlining if they want to.

Adjust some places where NextValueExpr support had been inserted with the
aid of a dartboard rather than keeping it in the same order as elsewhere.

Discussion: https://postgr.es/m/23862.1499981661@sss.pgh.pa.us
2017-07-14 15:25:43 -04:00
..
access Fix potential data corruption during freeze 2017-07-06 17:18:55 +03:00
bootstrap Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
catalog Code review for NextValueExpr expression node type. 2017-07-14 15:25:43 -04:00
commands Fix COPY's handling of transition tables with indexes. 2017-07-10 11:40:08 +01:00
executor Code review for NextValueExpr expression node type. 2017-07-14 15:25:43 -04:00
foreign Abstract logic to allow for multiple kinds of child rels. 2017-04-03 22:41:31 -04:00
lib Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
libpq Treat clean shutdown of an SSL connection same as the non-SSL case. 2017-07-03 14:51:51 +03:00
main Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
nodes Code review for NextValueExpr expression node type. 2017-07-14 15:25:43 -04:00
optimizer Code review for NextValueExpr expression node type. 2017-07-14 15:25:43 -04:00
parser Re-allow SRFs and window functions within sub-selects within aggregates. 2017-06-27 17:51:11 -04:00
po Translation updates 2017-07-10 11:53:55 -04:00
port Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
postmaster On Windows, retry process creation if we fail to reserve shared memory. 2017-07-10 11:00:09 -04:00
regex Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
replication Fix ordering of operations in SyncRepWakeQueue to avoid assertion failure. 2017-07-12 15:30:52 +03:00
rewrite Fix multiple assignments to a column of a domain type. 2017-07-11 16:48:59 -04:00
snowball Initial pgindent run with pg_bsd_indent version 2.0. 2017-06-21 14:39:04 -04:00
statistics Fix typos in README.dependencies 2017-06-22 17:12:27 -04:00
storage Fix race between GetNewTransactionId and GetOldestActiveTransactionId. 2017-07-13 15:47:02 +03:00
tcop Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
tsearch Reduce memory usage of tsvector type analyze function. 2017-07-12 22:06:13 +03:00
utils Code review for NextValueExpr expression node type. 2017-07-14 15:25:43 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Implement multivariate n-distinct coefficients 2017-03-24 14:06:10 -03:00
common.mk Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
nls.mk Translation updates 2017-05-15 12:19:54 -04:00