diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/regress/expected/temp.out | 17 | ||||
-rw-r--r-- | src/test/regress/sql/temp.sql | 14 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/test/regress/expected/temp.out b/src/test/regress/expected/temp.out index addf1ec4443..a769abe9bba 100644 --- a/src/test/regress/expected/temp.out +++ b/src/test/regress/expected/temp.out @@ -199,3 +199,20 @@ select pg_temp.whoami(); (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; diff --git a/src/test/regress/sql/temp.sql b/src/test/regress/sql/temp.sql index 5183c727f5e..1074c7cfac8 100644 --- a/src/test/regress/sql/temp.sql +++ b/src/test/regress/sql/temp.sql @@ -151,3 +151,17 @@ select whoami(); 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; |