postgresql/src/backend
Tom Lane 943140d572 Avoid dangling pointer to relation name in RLS code path in DoCopy().
With RLS active, "COPY tab TO ..." failed under -DRELCACHE_FORCE_RELEASE,
and would sometimes fail without that, because it used the relation name
directly from the relcache as part of the parsetree it's building.  That
becomes a potentially-dangling pointer as soon as the relcache entry is
closed, a bit further down.  Typical symptom if the relcache entry chanced
to get cleared would be "relation does not exist" error with a garbage
relation name, or possibly a core dump; but if you were really truly
unlucky, the COPY might copy from the wrong table.

Per report from Andrew Dunstan that regression tests fail with
-DRELCACHE_FORCE_RELEASE.  The core tests now pass for me (but have
not tried "make check-world" yet).

Discussion: https://postgr.es/m/7b52f900-0579-cda9-ae2e-de5da17090e6@2ndQuadrant.com
2017-03-06 16:50:47 -05:00
..
access Fix incorrect variable datatype 2017-02-28 12:18:25 +01:00
bootstrap Add macros to make AllocSetContextCreate() calls simpler and safer. 2016-08-27 17:50:38 -04:00
catalog Fix typos in comments. 2017-02-06 11:34:15 +02:00
commands Avoid dangling pointer to relation name in RLS code path in DoCopy(). 2017-03-06 16:50:47 -05:00
executor Make sure that hash join's bulk-tuple-transfer loops are interruptible. 2017-02-15 16:40:05 -05:00
foreign Remove GetUserMappingId() and GetUserMappingById(). 2016-07-22 11:32:23 -04:00
lib Revert "Permit dump/reload of not-too-large >1GB tuples" 2016-12-06 12:46:03 -03:00
libpq Fix typos in comments. 2017-02-06 11:34:15 +02:00
main Repair a bit of pgindent damage. 2016-06-09 18:09:17 -04:00
nodes Fix improper repetition of previous results from a hashed aggregate. 2016-08-24 14:38:13 -04:00
optimizer Fix typos in comments. 2017-02-06 11:34:15 +02:00
parser Fix YA unwanted behavioral difference with operator_precedence_warning. 2017-02-15 14:44:00 -05:00
po Translation updates 2017-02-06 12:42:47 -05:00
port Try to find out the actual hugepage size when making a MAP_HUGETLB request. 2016-10-13 15:06:57 -04:00
postmaster Fix typos in comments. 2017-02-06 11:34:15 +02:00
regex Suppress compiler warnings about useless comparison of unsigned to zero. 2016-02-15 17:12:16 -05:00
replication Make walsender always initialize the buffers. 2017-02-22 08:29:32 +09:00
rewrite pgindent run for 9.6 2016-06-09 18:02:36 -04:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Fix sloppy handling of corner-case errors in fd.c. 2017-02-21 17:51:27 -05:00
tcop Add castNode(type, ptr) for safe casting between NodeTag based types. 2017-01-26 16:47:03 -08:00
tsearch Fix typos in comments. 2017-02-06 11:34:15 +02:00
utils Handle unaligned SerializeSnapshot() buffer. 2017-03-02 00:03:32 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Provide and use a makefile target to build all generated headers. 2016-07-01 15:09:02 -04:00
nls.mk Translation updates 2017-02-06 12:42:47 -05:00