Re: Reaping Temp tables to avoid XID wraparound - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: Reaping Temp tables to avoid XID wraparound
Date
Msg-id 87zhr0plul.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to RE: Reaping Temp tables to avoid XID wraparound  ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>)
Responses Re: Reaping Temp tables to avoid XID wraparound
List pgsql-hackers
>>>>> "Tsunakawa" == Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com> writes:

 >> From the temp table namespace I can get the backend ID using a regex
 >> - but I have no idea how I can map that to a PID - any thoughts?

 Tsunakawa> SELECT pg_stat_get_backend_pid(backendid);

Doesn't work - that function's idea of "backend id" doesn't match the
real one, since it's looking at a local copy of the stats from which
unused slots have been removed.

postgres=# select pg_my_temp_schema()::regnamespace;
 pg_my_temp_schema 
-------------------
 pg_temp_5
(1 row)

postgres=# select pg_stat_get_backend_pid(5);
 pg_stat_get_backend_pid 
-------------------------
                    4730
(1 row)

postgres=# select pg_backend_pid();
 pg_backend_pid 
----------------
          21086
(1 row)

-- 
Andrew (irc:RhodiumToad)


pgsql-hackers by date:

Previous
From: "Tsunakawa, Takayuki"
Date:
Subject: RE: Reaping Temp tables to avoid XID wraparound
Next
From: Thomas Munro
Date:
Subject: Re: dsa_allocate() faliure