postgresql/src/backend/utils/adt
Tom Lane e3ec3c00d8 Remove arbitrary 64K-or-so limit on rangetable size.
Up to now the size of a query's rangetable has been limited by the
constants INNER_VAR et al, which mustn't be equal to any real
rangetable index.  65000 doubtless seemed like enough for anybody,
and it still is orders of magnitude larger than the number of joins
we can realistically handle.  However, we need a rangetable entry
for each child partition that is (or might be) processed by a query.
Queries with a few thousand partitions are getting more realistic,
so that the day when that limit becomes a problem is in sight,
even if it's not here yet.  Hence, let's raise the limit.

Rather than just increase the values of INNER_VAR et al, this patch
adopts the approach of making them small negative values, so that
rangetables could theoretically become as long as INT_MAX.

The bulk of the patch is concerned with changing Var.varno and some
related variables from "Index" (unsigned int) to plain "int".  This
is basically cosmetic, with little actual effect other than to help
debuggers print their values nicely.  As such, I've only bothered
with changing places that could actually see INNER_VAR et al, which
the parser and most of the planner don't.  We do have to be careful
in places that are performing less/greater comparisons on varnos,
but there are very few such places, other than the IS_SPECIAL_VARNO
macro itself.

A notable side effect of this patch is that while it used to be
possible to add INNER_VAR et al to a Bitmapset, that will now
draw an error.  I don't see any likelihood that it wouldn't be a
bug to include these fake varnos in a bitmapset of real varnos,
so I think this is all to the good.

Although this touches outfuncs/readfuncs, I don't think a catversion
bump is required, since stored rules would never contain Vars
with these fake varnos.

Andrey Lepikhov and Tom Lane, after a suggestion by Peter Eisentraut

Discussion: https://postgr.es/m/43c7f2f5-1e27-27aa-8c65-c91859d15190@postgrespro.ru
2021-09-15 14:11:21 -04:00
..
.gitignore Revert "Add gitignore entries for jsonpath_gram.h" 2019-03-23 00:19:34 +01:00
acl.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
amutils.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
array_expanded.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
array_selfuncs.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
array_typanalyze.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
array_userfuncs.c Prevent integer overflows in array subscripting calculations. 2021-05-10 10:44:38 -04:00
arrayfuncs.c Fix hash_array 2021-09-15 12:15:04 +02:00
arraysubs.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
arrayutils.c Prevent integer overflows in array subscripting calculations. 2021-05-10 10:44:38 -04:00
ascii.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
bool.c Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
cash.c Expose internal function for converting int64 to numeric 2020-09-09 20:16:28 +02:00
char.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
cryptohashfuncs.c Add result size as argument of pg_cryptohash_final() for overflow checks 2021-02-15 10:18:34 +09:00
date.c Make timetz_zone() stable, and correct a bug for DYNTZ abbreviations. 2021-09-06 11:03:56 -04:00
datetime.c interval: round values when spilling to months 2021-08-03 12:10:29 -04:00
datum.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
dbsize.c Teach pg_size_pretty and pg_size_bytes about petabytes 2021-07-09 18:56:00 +12:00
domains.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
encode.c Revert refactoring of hex code to src/common/ 2021-08-19 09:20:13 +09:00
enum.c Rename "enum blacklist" to "uncommitted enums". 2021-01-05 12:38:48 +13:00
expandeddatum.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
expandedrecord.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
float.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
format_type.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
formatting.c Fix out-of-bound memory access for interval -> char conversion 2021-04-12 11:30:50 +09:00
genfile.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
geo_ops.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
geo_selfuncs.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
geo_spgist.c Fix more confusion in SP-GiST. 2021-04-04 17:57:07 -04:00
inet_cidr_ntop.c Avoid conflicts with library versions of inet_net_ntop() and friends. 2019-08-18 19:27:23 -04:00
inet_net_pton.c Avoid conflicts with library versions of inet_net_ntop() and friends. 2019-08-18 19:27:23 -04:00
int8.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
int.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
json.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
jsonb_gin.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
jsonb_op.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
jsonb_util.c Implementation of subscripting for jsonb 2021-01-31 23:50:40 +03:00
jsonb.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
jsonbsubs.c Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
jsonfuncs.c Fix typo 2021-09-08 16:48:51 +02:00
jsonpath_exec.c Fix some typos, grammar and style in docs and comments 2021-02-24 16:13:17 +09:00
jsonpath_gram.y Avoid determining regexp subexpression matches, when possible. 2021-08-09 11:26:34 -04:00
jsonpath_scan.l Update copyright for 2021 2021-01-02 13:06:25 -05:00
jsonpath.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
levenshtein.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
like_match.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
like_support.c Avoid divide-by-zero in regex_selectivity() with long fixed prefix. 2021-02-12 16:26:47 -05:00
like.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
lockfuncs.c Rename debug_invalidate_system_caches_always to debug_discard_caches. 2021-07-13 15:01:01 -04:00
mac8.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
mac.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
Makefile Use "-I." in directories holding Bison parsers, for Oracle compilers. 2021-04-12 19:24:41 -07:00
mcxtfuncs.c Reorder superuser check in pg_log_backend_memory_contexts() 2021-06-08 08:53:12 +09:00
misc.c Do not rely on pgstat.h to indirectly include storage/ headers. 2021-04-02 20:02:47 -07:00
multirangetypes_selfuncs.c Fix wording 2021-08-06 20:55:59 +02:00
multirangetypes.c Support for unnest(multirange) 2021-07-18 21:07:24 +03:00
name.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
network_gist.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
network_selfuncs.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
network_spgist.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
network.c Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30
numeric.c Adjust the integer overflow tests in the numeric code. 2021-08-06 21:29:15 +01:00
numutils.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
oid.c Remove Value node struct 2021-09-09 08:36:53 +02:00
oracle_compat.c Add bytea equivalents of ltrim() and rtrim(). 2021-01-18 15:11:32 -05:00
orderedsetaggs.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
partitionfuncs.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_locale.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
pg_lsn.c Simplify printing of LSNs 2021-02-23 10:27:02 +01:00
pg_upgrade_support.c Revert per-index collation version tracking feature. 2021-05-07 21:10:11 +12:00
pgstatfuncs.c pgstat: split reporting/fetching of bgwriter and checkpointer stats. 2021-08-04 19:16:04 -07:00
pseudotypes.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
quote.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
rangetypes_gist.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
rangetypes_selfuncs.c Fix wording 2021-08-06 20:55:59 +02:00
rangetypes_spgist.c Fix wording 2021-08-06 20:55:59 +02:00
rangetypes_typanalyze.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
rangetypes.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
regexp.c Let regexp_replace() make use of REG_NOSUB when feasible. 2021-08-09 20:53:25 -04:00
regproc.c Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
ri_triggers.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
rowtypes.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
ruleutils.c Remove arbitrary 64K-or-so limit on rangetable size. 2021-09-15 14:11:21 -04:00
selfuncs.c Reject SELECT ... GROUP BY GROUPING SETS (()) FOR UPDATE. 2021-06-01 11:12:56 -04:00
tid.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
timestamp.c Disallow negative strides in date_bin() 2021-07-28 12:10:12 -04:00
trigfuncs.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
tsginidx.c Convert tsginidx.c's GIN indexing logic to fully ternary operation. 2021-02-16 12:07:14 -05:00
tsgistidx.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
tsquery_cleanup.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
tsquery_gist.c Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
tsquery_op.c Avoid using ambiguous word "non-negative" in error messages. 2021-07-28 01:20:16 +09:00
tsquery_rewrite.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
tsquery_util.c Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
tsquery.c Improve error message about valid value for distance in phrase operator. 2021-08-25 11:43:56 +09:00
tsrank.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
tsvector_op.c Convert tsginidx.c's GIN indexing logic to fully ternary operation. 2021-02-16 12:07:14 -05:00
tsvector_parser.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
tsvector.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
uuid.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
varbit.c Add bit_count SQL function 2021-03-23 10:13:58 +01:00
varchar.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
varlena.c Revert refactoring of hex code to src/common/ 2021-08-19 09:20:13 +09:00
version.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
windowfuncs.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
xid8funcs.c Fix typo in comments. 2021-09-06 17:03:40 +09:00
xid.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
xml.c Remove some unnecessary casts in format arguments 2021-08-08 22:08:07 +02:00