postgresql/src/backend/commands
Tom Lane cb03fa33ae Fix assorted syscache lookup sloppiness in partition-related code.
heap_drop_with_catalog and ATExecDetachPartition neglected to check for
SearchSysCache failures, as noted in bugs #14927 and #14928 from Pan Bian.
Such failures are pretty unlikely, since we should already have some sort
of lock on the rel at these points, but it's neither a good idea nor
per project style to omit a check for failure.

Also, StorePartitionKey contained a syscache lookup that it never did
anything with, including never releasing the result.  Presumably the
reason why we don't see refcount-leak complaints is that the lookup
always fails; but in any case it's pretty useless, so remove it.

All of these errors were evidently introduced by the relation
partitioning feature.  Back-patch to v10 where that came in.

Amit Langote and Tom Lane

Discussion: https://postgr.es/m/20171127090105.1463.3962@wrigleys.postgresql.org
Discussion: https://postgr.es/m/20171127091341.1468.72696@wrigleys.postgresql.org
2017-11-27 19:22:08 -05:00
..
aggregatecmds.c Explicitly track whether aggregate final functions modify transition state. 2017-10-14 15:21:39 -04:00
alter.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
amcmds.c Fix typos in comments. 2017-02-06 11:33:58 +02:00
analyze.c Improve comments in vacuum_rel() and analyze_rel(). 2017-10-05 10:47:47 -04:00
async.c Replace remaining uses of pq_sendint with pq_sendint{8,16,32}. 2017-10-11 21:00:46 -07:00
cluster.c Change tupledesc->attrs[n] to TupleDescAttr(tupledesc, n). 2017-08-20 11:19:07 -07:00
collationcmds.c Don't install ICU collation keyword variants 2017-08-21 19:21:07 -04:00
comment.c Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
constraint.c Allow index AMs to cache data across aminsert calls within a SQL command. 2017-02-09 11:52:12 -05:00
conversioncmds.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
copy.c Centralize executor-related partitioning code. 2017-11-15 10:26:25 -05:00
createas.c Allow DML commands that create tables to use parallel query. 2017-10-05 11:40:48 -04:00
dbcommands.c Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
define.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
discard.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
dropcmds.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
event_trigger.c Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
explain.c Pass InitPlan values to workers via Gather (Merge). 2017-11-16 12:06:14 -05:00
extension.c Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
foreigncmds.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
functioncmds.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
indexcmds.c Simplify index_[constraint_]create API 2017-11-14 15:19:05 +01:00
lockcmds.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
Makefile Implement multivariate n-distinct coefficients 2017-03-24 14:06:10 -03:00
matview.c Change tupledesc->attrs[n] to TupleDescAttr(tupledesc, n). 2017-08-20 11:19:07 -07:00
opclasscmds.c Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
operatorcmds.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
policy.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
portalcmds.c Remove unnecessary PG_TRY overhead for CurrentResourceOwner changes. 2017-10-11 17:44:09 -04:00
prepare.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
proclang.c Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
publicationcmds.c Message style fixes 2017-09-11 11:21:27 -04:00
schemacmds.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
seclabel.c Reduce excessive dereferencing of function pointers 2017-09-07 13:56:09 -04:00
sequence.c Remove unnecessary PG_TRY overhead for CurrentResourceOwner changes. 2017-10-11 17:44:09 -04:00
statscmds.c Message style fixes 2017-09-11 11:21:27 -04:00
subscriptioncmds.c ... and the very same bug in publicationListToArray(). 2017-09-23 15:16:48 -04:00
tablecmds.c Fix assorted syscache lookup sloppiness in partition-related code. 2017-11-27 19:22:08 -05:00
tablespace.c Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
trigger.c Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
tsearchcmds.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
typecmds.c Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
user.c Don't allow logging in with empty password. 2017-08-07 17:03:42 +03:00
vacuum.c Improve comments in vacuum_rel() and analyze_rel(). 2017-10-05 10:47:47 -04:00
vacuumlazy.c Revert bogus fixes of HOT-freezing bug 2017-11-02 15:51:41 +01:00
variable.c Remove uses of "slave" in replication contexts 2017-08-10 22:55:41 -04:00
view.c Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00