| -- |
| -- Transactions (GPDB-specific tests) |
| -- |
| CREATE TEMPORARY TABLE temptest (a int); |
| INSERT INTO temptest VALUES (generate_series(1, 10)); |
| CREATE TEMPORARY SEQUENCE tempseq; |
| SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY; |
| -- Make sure COPY works with temp tables during a READ ONLY transaction. |
| COPY temptest TO '@abs_builddir@/results/xacttemp.data'; |
| DELETE FROM temptest; |
| COPY temptest FROM '@abs_builddir@/results/xacttemp.data'; |
| SELECT * from temptest; |
| a |
| ---- |
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| (10 rows) |
| |
| -- Ensure temporary sequences function correctly as well. |
| SELECT nextval('tempseq'); |
| nextval |
| --------- |
| 1 |
| (1 row) |
| |
| SELECT setval('tempseq', 5); |
| setval |
| -------- |
| 5 |
| (1 row) |
| |
| SELECT nextval('tempseq'); |
| nextval |
| --------- |
| 6 |
| (1 row) |
| |