Increase value of OUTER_VAR

From: Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Increase value of OUTER_VAR
Date: 2021-03-03 08:29:12
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Playing with a large value of partitions I caught the limit with 65000
table entries in a query plan:

if (IS_SPECIAL_VARNO(list_length(glob->finalrtable)))
errmsg("too many range table entries")));

Postgres works well with so many partitions.
The constants INNER_VAR, OUTER_VAR, INDEX_VAR are used as values of the
variable 'var->varno' of integer type. As I see, they were introduced
with commit 1054097464 authored by Marc G. Fournier, in 1996.
Value 65000 was relevant to the size of the int type at that time.

Maybe we will change these values to INT_MAX? (See the patch in attachment).

Andrey Lepikhov
Postgres Professional

Attachment Content-Type Size
0001-Set-values-of-special-varnos-to-the-upper-bound-of-t.patch text/plain 1.1 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Chen 2021-03-03 08:41:49 Re: BUG #16583: merge join on tables with different DB collation behind postgres_fdw fails
Previous Message Michael Paquier 2021-03-03 08:19:22 Add support for PROVE_FLAGS and PROVE_TESTS in MSVC scripts