postgresql/src
Tom Lane 4ba4bfaf25 Fix possible loss of sync between rectypeid and underlying PLpgSQL_type.
When revalidate_rectypeid() acts to update a stale record type OID
in plpgsql's data structures, it fixes the active PLpgSQL_rec struct
as well as the PLpgSQL_type struct it references.  However, the latter
is shared across function executions while the former is not.  In a
later function execution, the PLpgSQL_rec struct would be reinitialized
by copy_plpgsql_datums and would then contain a stale type OID,
typically leading to "could not open relation with OID NNNN" errors.
revalidate_rectypeid() can easily fix this, fortunately, just by
treating typ->typoid as authoritative.

Per report and diagnosis from Ashutosh Sharma, though this is not his
suggested fix.  Back-patch to v11 where this code came in.

Discussion: https://postgr.es/m/CAE9k0Pkd4dZwt9J5pS9xhJFWpUtqs05C9xk_GEwPzYdV=GxwWg@mail.gmail.com
2019-12-26 15:19:39 -05:00
..
backend Refactor parser's generation of Var nodes. 2019-12-26 11:16:42 -05:00
bin Replace use of strerror() with %s by %m in pg_waldump 2019-12-24 12:14:08 +09:00
common Fix output of Unicode normalization test 2019-12-11 08:42:17 +01:00
fe_utils Fix query cancellation handling in psql 2019-12-17 10:44:25 +09:00
include Improve comments in utils/rel.h. 2019-12-26 11:20:05 -05:00
interfaces libpq should expose GSS-related parameters even when not implemented. 2019-12-20 15:34:07 -05:00
makefiles Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:35 -04:00
pl Fix possible loss of sync between rectypeid and underlying PLpgSQL_type. 2019-12-26 15:19:39 -05:00
port In pgwin32_open, loop after ERROR_ACCESS_DENIED only if we can't stat. 2019-12-21 17:39:36 -05:00
template Fix compiler warning for ppoll() on Cygwin 2019-12-22 23:20:00 +01:00
test Allow whole-row Vars to be used in partitioning expressions. 2019-12-25 15:44:15 -05:00
timezone Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
tools Clean up inconsistent backslash use in paths 2019-12-20 12:29:07 +01:00
tutorial Add .gitignore to src/tutorial/ 2019-11-22 21:14:54 +09:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:35 -04:00
Makefile.shlib Clean up MinGW def file generation 2019-10-20 10:19:13 +02:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00