relpersistence and temp table - Mailing list pgsql-hackers

From Amit Khandekar
Subject relpersistence and temp table
Date
Msg-id BANLkTimOZRwJdPV538GgePAGp=+cD9Y60g@mail.gmail.com
Whole thread Raw
Responses Re: relpersistence and temp table
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Mikko Partio
Date:
Subject: Re: [ADMIN] PANIC while doing failover (streaming replication)
Next
From: "Erik Rijkers"
Date:
Subject: must synchronous_standby_names be set?