postgresql/src/backend/commands
Tom Lane 6dd9f35779 Fix bogus CALLED_AS_TRIGGER() defenses.
contrib/lo's lo_manage() thought it could use
trigdata->tg_trigger->tgname in its error message about
not being called as a trigger.  That naturally led to a core dump.

unique_key_recheck() figured it could Assert that fcinfo->context
is a TriggerData node in advance of having checked that it's
being called as a trigger.  That's harmless in production builds,
and perhaps not that easy to reach in any case, but it's logically
wrong.

The first of these per bug #16340 from William Crowell;
the second from manual inspection of other CALLED_AS_TRIGGER
call sites.

Back-patch the lo.c change to all supported branches, the
other to v10 where the thinko crept in.

Discussion: https://postgr.es/m/16340-591c7449dc7c8c47@postgresql.org
2020-04-03 11:24:56 -04:00
..
aggregatecmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
alter.c Avoid duplicates in ALTER ... DEPENDS ON EXTENSION 2020-03-11 11:04:59 -03:00
amcmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
analyze.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
async.c Refactor ps_status.c API 2020-03-11 16:38:31 +01:00
cluster.c Revert "Skip WAL for new relfilenodes, under wal_level=minimal." 2020-03-22 09:24:09 -07:00
collationcmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
comment.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
constraint.c Fix bogus CALLED_AS_TRIGGER() defenses. 2020-04-03 11:24:56 -04:00
conversioncmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
copy.c Allow the planner-related functions and hook to accept the query string. 2020-03-30 13:51:05 +09:00
createas.c Allow the planner-related functions and hook to accept the query string. 2020-03-30 13:51:05 +09:00
dbcommands.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
define.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
discard.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
dropcmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
event_trigger.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
explain.c Revert "Include information on buffer usage during planning phase, in EXPLAIN output." 2020-04-03 12:20:42 +09:00
extension.c Allow the planner-related functions and hook to accept the query string. 2020-03-30 13:51:05 +09:00
foreigncmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
functioncmds.c Introduce "anycompatible" family of polymorphic types. 2020-03-19 11:43:11 -04:00
indexcmds.c Check equality semantics for unique indexes on partitioned tables. 2020-04-01 14:49:49 -04:00
lockcmds.c Make inherited LOCK TABLE perform access permission checks on parent table only. 2020-02-18 13:13:15 +09:00
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
matview.c Allow the planner-related functions and hook to accept the query string. 2020-03-30 13:51:05 +09:00
opclasscmds.c Improve error reporting in opclasscmds.c 2020-03-31 17:51:57 +03:00
operatorcmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
policy.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
portalcmds.c Allow the planner-related functions and hook to accept the query string. 2020-03-30 13:51:05 +09:00
prepare.c Revert "Include information on buffer usage during planning phase, in EXPLAIN output." 2020-04-03 12:20:42 +09:00
proclang.c Remove the "opaque" pseudo-type and associated compatibility hacks. 2020-03-05 15:48:56 -05:00
publicationcmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
schemacmds.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
seclabel.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
sequence.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
statscmds.c Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
subscriptioncmds.c Remove utils/acl.h from catalog/objectaddress.h 2020-03-10 10:27:00 +01:00
tablecmds.c Implement operator class parameters 2020-03-30 19:17:23 +03:00
tablespace.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
trigger.c Enable BEFORE row-level triggers for partitioned tables 2020-03-18 18:58:05 -03:00
tsearchcmds.c Preserve integer and float values accurately in (de)serialize_deflist. 2020-03-10 12:30:02 -04:00
typecmds.c Split out CreateCast into src/backend/catalog/pg_cast.c 2020-03-10 11:28:23 -03:00
user.c Remove long-dead comments. 2020-02-12 14:33:49 -05:00
vacuum.c Fix coverity complaint about commit 40d964ec99. 2020-04-01 09:28:13 +05:30
variable.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
view.c Restructure ALTER TABLE execution to fix assorted bugs. 2020-01-15 18:49:24 -05:00