Re: [PROPOSAL] Drop orphan temp tables in single-mode

2019-06-07 Thread Arthur Zakirov
Hello Alexander, On Friday, June 7, 2019, Alexander Korotkov wrote: > BTW, does this patch checks that temporary table is really orphan? > AFAICS, user may define some temporary tables in single-user mode > before running VACUUM. As far as I remember, the patch checks it. -- Arthur Zakirov Pos

Re: [PROPOSAL] Drop orphan temp tables in single-mode

2019-06-07 Thread Alexander Korotkov
On Fri, Mar 8, 2019 at 9:28 AM Michael Paquier wrote: > On Thu, Mar 07, 2019 at 10:49:29AM -0500, Robert Haas wrote: > > On Thu, Mar 7, 2019 at 10:24 AM Tom Lane wrote: > > > So if we think we can invent a "MAGICALLY FIX MY DATABASE" command, > > > let's do that. But please let's not turn a well

Re: [PROPOSAL] Drop orphan temp tables in single-mode

2019-03-07 Thread Michael Paquier
On Thu, Mar 07, 2019 at 10:49:29AM -0500, Robert Haas wrote: > On Thu, Mar 7, 2019 at 10:24 AM Tom Lane wrote: > > So if we think we can invent a "MAGICALLY FIX MY DATABASE" command, > > let's do that. But please let's not turn a well defined command > > like VACUUM into something that you don't

Re: [PROPOSAL] Drop orphan temp tables in single-mode

2019-03-07 Thread Grigory Smolkin
On 03/07/2019 06:49 PM, Robert Haas wrote: On Thu, Mar 7, 2019 at 10:24 AM Tom Lane wrote: So if we think we can invent a "MAGICALLY FIX MY DATABASE" command, let's do that. But please let's not turn a well defined command like VACUUM into something that you don't quite know what it will do

Re: [PROPOSAL] Drop orphan temp tables in single-mode

2019-03-07 Thread Arthur Zakirov
> On Thu, Mar 7, 2019 at 10:24 AM Tom Lane wrote: > > So if we think we can invent a "MAGICALLY FIX MY DATABASE" command, > > let's do that. But please let's not turn a well defined command > > like VACUUM into something that you don't quite know what it will do. I see your point. Another approa

Re: [PROPOSAL] Drop orphan temp tables in single-mode

2019-03-07 Thread Robert Haas
On Thu, Mar 7, 2019 at 10:24 AM Tom Lane wrote: > So if we think we can invent a "MAGICALLY FIX MY DATABASE" command, > let's do that. But please let's not turn a well defined command > like VACUUM into something that you don't quite know what it will do. I am on the fence about that. I see you

Re: [PROPOSAL] Drop orphan temp tables in single-mode

2019-03-07 Thread Tom Lane
Robert Haas writes: > In a way I agree, but I think the reality is that some very large > percentage of people who enter single user mode do so because of a > wraparound-induced shutdown, and what they need is an easy way to get > the system back on line. Running a catalog query to look for > und

Re: [PROPOSAL] Drop orphan temp tables in single-mode

2019-03-07 Thread Robert Haas
On Thu, Mar 7, 2019 at 9:40 AM Tom Lane wrote: > I wonder if a better response would be, in single-user mode, to allow temp > tables to be processed as local temp tables regardless of their backend > number. (Everywhere, not just in VACUUM.) Since commit debcec7dc31a992703911a9953e299c8d730c778

Re: [PROPOSAL] Drop orphan temp tables in single-mode

2019-03-07 Thread Tom Lane
Arthur Zakirov writes: > In some cases if PostgreSQL encounters with wraparound PostgreSQL might > leave created temporary tables even after shutdown. > This orphan temporary tables prevent VACUUM to fix wraparound. It is > because in single mode VACUUM considers orphan temp tables as temp > ta

Re: [PROPOSAL] Drop orphan temp tables in single-mode

2019-03-07 Thread Alexander Korotkov
Hi! On Thu, Mar 7, 2019 at 12:46 PM Arthur Zakirov wrote: > In some cases if PostgreSQL encounters with wraparound PostgreSQL might > leave created temporary tables even after shutdown. > > This orphan temporary tables prevent VACUUM to fix wraparound. It is > because in single mode VACUUM consid

[PROPOSAL] Drop orphan temp tables in single-mode

2019-03-07 Thread Arthur Zakirov
Hello hackers, In some cases if PostgreSQL encounters with wraparound PostgreSQL might leave created temporary tables even after shutdown. This orphan temporary tables prevent VACUUM to fix wraparound. It is because in single mode VACUUM considers orphan temp tables as temp tables of other b