From: | Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> |
---|---|
To: | "Tsunakawa\, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> |
Cc: | 'James Sewell' <james(dot)sewell(at)jirotech(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Reaping Temp tables to avoid XID wraparound |
Date: | 2019-02-13 00:38:51 |
Message-ID: | 87zhr0plul.fsf@news-spur.riddles.org.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>>>>> "Tsunakawa" == Tsunakawa, Takayuki <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)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)
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Munro | 2019-02-13 00:52:45 | Re: dsa_allocate() faliure |
Previous Message | Tsunakawa, Takayuki | 2019-02-13 00:32:18 | RE: Reaping Temp tables to avoid XID wraparound |