In 9.1, if a table is created using an explicit pg_temp qualification,
the pg_class.relpersistence is marked 'p', not 't'.

postgres=# CREATE TABLE pg_temp.temptable (i int4);
CREATE TABLE

postgres=# select relpersistence from pg_class where relname = 'temptable';
 relpersistence
----------------
 p
(1 row)


BUt the table does go away if I exit the session:

postgres=# \q
edb-pg ~/git-pg1 $ psql
psql (9.0.1, server 9.2devel)
WARNING: psql version 9.0, server version 9.2.
         Some psql features might not work.
Type "help" for help.

postgres=# select relpersistence from pg_class where relname = 'temptable';
 relpersistence
----------------
(0 rows)

So in that sense, it does work as a temp table, but the relpersistence
is not 't'. So, is the "temp"ness no longer identified by
pg_class.relpersistence now?


In RelationBuildLocalRelation(), previously, namespace was used to
determine if the table should be marked temporary:

        /* it is temporary if and only if it is in my temp-table namespace */
        rel->rd_istemp = isTempOrToastNamespace(relnamespace);

But in Master branch, now if I look at RelationBuildLocalRelation(),
there is no such logic to mark relpersistence.

Was this intentional or is it a bug?


Regards
-Amit Khandekar

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to