On Tue, Oct 09, 2018 at 05:11:59PM +0900, Amit Langote wrote: > Hmm, how would one find the size of a partitioned index tree if we don't > allow indexes to be passed?
pg_total_relation_size() and pg_indexes_size() are designed for that purpose. Anyway, the elements of a partition tree are things which can be directly attached to it, like a table or a foreign table, and not objects which are directly dependent on a given table, like indexes or toast tables. So we have to add some filtering on the relkind. Indexes, partitioned indexes and sequences are three things which cannot be added as partitions. But I think that we had better just make sure that the filtering allows RELKIND_RELATION, RELKIND_PARTITIONED_TABLE and RELKIND_FOREIGN_TABLE relations only. > Maybe, we should apply same rules as are used when describing a table or > when getting its metadata via other means (pg_relation_size, etc.)? > Afaics, there are no checks performed in that case: > > Should we do anything different in this case? Yeah, perhaps we could live without any restriction. There would be still time to tweak that behavior in the v12 development cycle if there are any complaints. -- Michael
signature.asc
Description: PGP signature