{
Oid toastrelid;
+ /*
+ * Truncate the relation. Partitioned tables have no storage, so there is
+ * nothing to do for them here.
+ */
+ if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
+ return;
+
/* Truncate the actual file (and discard buffers) */
RelationTruncate(rel, 0);
(1 row)
drop table public.whereami;
+-- For partitioned temp tables, ON COMMIT actions ignore storage-less
+-- partitioned tables.
+begin;
+create temp table temp_parted_oncommit (a int)
+ partition by list (a) on commit delete rows;
+create temp table temp_parted_oncommit_1
+ partition of temp_parted_oncommit
+ for values in (1) on commit delete rows;
+insert into temp_parted_oncommit values (1);
+commit;
+-- partitions are emptied by the previous commit
+select * from temp_parted_oncommit;
+ a
+---
+(0 rows)
+
+drop table temp_parted_oncommit;
select pg_temp.whoami();
drop table public.whereami;
+
+-- For partitioned temp tables, ON COMMIT actions ignore storage-less
+-- partitioned tables.
+begin;
+create temp table temp_parted_oncommit (a int)
+ partition by list (a) on commit delete rows;
+create temp table temp_parted_oncommit_1
+ partition of temp_parted_oncommit
+ for values in (1) on commit delete rows;
+insert into temp_parted_oncommit values (1);
+commit;
+-- partitions are emptied by the previous commit
+select * from temp_parted_oncommit;
+drop table temp_parted_oncommit;