1) It seems that no test case covers the below scenario: 2 sessions attach the same gtt, and insert/update/select concurrently. It is better to use the test framework in src/test/isolation like the code changes in https://commitfest.postgresql.org/24/2233/.
I rewrote the case under regress to make it easier to read. and I used the Isolation module to add some concurrent cases and fix some bugs.
Please check code(v52) and give me feedback.
Wenjing
2) CREATE GLOBAL TEMP SEQUENCE also need to be supported in src/bin/psql/tab-complete.c