postgresql/src/backend/commands
Tom Lane a30531c5c8 Fix "unexpected relkind" error when denying permissions on toast tables.
get_relkind_objtype, and hence get_object_type, failed when applied to a
toast table.  This is not a good thing, because it prevents reporting of
perfectly legitimate permissions errors.  (At present, these functions
are in fact *only* used to determine the ObjectType argument for
acl_error() calls.)  It seems best to have them fall back to returning
OBJECT_TABLE in every case where they can't determine an object type
for a pg_class entry, so do that.

In passing, make some edits to alter.c to make it more obvious that
those calls of get_object_type() are used only for error reporting.
This might save a few cycles in the non-error code path, too.

Back-patch to v11 where this issue originated.

John Hsu, Michael Paquier, Tom Lane

Discussion: https://postgr.es/m/C652D3DF-2B0C-4128-9420-FB5379F6B1E4@amazon.com
2019-11-05 13:40:37 -05:00
..
aggregatecmds.c Implement OR REPLACE option for CREATE AGGREGATE. 2019-03-19 01:16:50 +00:00
alter.c Fix "unexpected relkind" error when denying permissions on toast tables. 2019-11-05 13:40:37 -05:00
amcmds.c Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
analyze.c Allow setting statistics target for extended statistics 2019-09-11 00:25:51 +02:00
async.c PG_FINALLY 2019-11-01 11:18:03 +01:00
cluster.c Split tuptoaster.c into three separate files. 2019-09-05 13:15:10 -04:00
collationcmds.c Collations with nondeterministic comparison 2019-03-22 12:12:43 +01:00
comment.c Remove superfluous tqual.h includes. 2019-01-21 12:15:02 -08:00
constraint.c Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
conversioncmds.c Remove dead encoding-conversion functions. 2019-07-05 14:17:27 -04:00
copy.c PG_FINALLY 2019-11-01 11:18:03 +01:00
createas.c Represent Lists as expansible arrays, not chains of cons-cells. 2019-07-15 13:41:58 -04:00
dbcommands.c Silence -Wmaybe-uninitialized compiler warnings in dbcommands.c. 2019-09-27 14:14:30 -07:00
define.c Fix inconsistencies and typos in the tree, take 9 2019-08-05 12:14:58 +09:00
discard.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
dropcmds.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
event_trigger.c PG_FINALLY 2019-11-01 11:18:03 +01:00
explain.c Represent Lists as expansible arrays, not chains of cons-cells. 2019-07-15 13:41:58 -04:00
extension.c PG_FINALLY 2019-11-01 11:18:03 +01:00
foreigncmds.c Represent Lists as expansible arrays, not chains of cons-cells. 2019-07-15 13:41:58 -04:00
functioncmds.c Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
indexcmds.c Handle interrupts within a transaction context in REINDEX CONCURRENTLY 2019-10-25 10:20:08 +09:00
lockcmds.c Avoid using lcons and list_delete_first where it's easy to do so. 2019-07-17 11:15:34 -04:00
Makefile Move vacuumlazy.c into access/heap. 2019-01-15 12:06:19 -08:00
matview.c tableam: Rename wrapper functions to match callback names. 2019-05-23 16:32:36 -07:00
opclasscmds.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
operatorcmds.c Fix inconsistencies and typos in the tree 2019-07-29 12:28:30 +09:00
policy.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
portalcmds.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
prepare.c Fix inconsistencies and typos in the tree, take 9 2019-08-05 12:14:58 +09:00
proclang.c Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
publicationcmds.c Warn if wal_level is too low when creating a publication. 2019-07-13 10:35:34 +12:00
schemacmds.c Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
seclabel.c Represent Lists as expansible arrays, not chains of cons-cells. 2019-07-15 13:41:58 -04:00
sequence.c Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
statscmds.c Remove last traces of heap_open/close in the tree 2019-10-19 11:18:15 +09:00
subscriptioncmds.c PG_FINALLY 2019-11-01 11:18:03 +01:00
tablecmds.c Fix failure when creating cloned indexes for a partition 2019-11-02 14:16:04 +09:00
tablespace.c pgindent run prior to branching v12. 2019-07-01 12:37:52 -04:00
trigger.c PG_FINALLY 2019-11-01 11:18:03 +01:00
tsearchcmds.c Represent Lists as expansible arrays, not chains of cons-cells. 2019-07-15 13:41:58 -04:00
typecmds.c Avoid using lcons and list_delete_first where it's easy to do so. 2019-07-17 11:15:34 -04:00
user.c Add an enforcement mechanism for global object names in regression tests. 2019-06-29 11:34:00 -04:00
vacuum.c PG_FINALLY 2019-11-01 11:18:03 +01:00
variable.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
view.c Support reloptions of enum type 2019-09-25 15:56:52 -03:00