BUG #4063: psql locks up on pager during dump restore

From: "John Whitley" <jwhitley(at)tableausoftware(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4063: psql locks up on pager during dump restore
Date: 2008-03-26 22:12:50
Message-ID: 200803262212.m2QMCojG088947@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4063
Logged by: John Whitley
Email address: jwhitley(at)tableausoftware(dot)com
PostgreSQL version: 8.3.0
Operating system: Windows XP SP2, Windows Server 2k3
Description: psql locks up on pager during dump restore
Details:

On at least Windows XP SP2 and Windows Server 2k3, psql is locking up during
a restore of a pg_dumpall dump from a Postgres 8.1 installation. The lockup
appears to be input dependent, in that it recurs on the same line of the
backup repeatably. The root cause appears to be related to psql invoking
the pager. Symptoms as observed via ProcessExplorer are that psql.exe
repeatedly spawns cmd.exe instances which in turn spawn the pager
(more.com).

The initial command line attempted is:

C:\path\to\psql -X -q -h <host> -p <port> -U <user> -f backup.sql postgres

As one would expect, the variant of more found doesn't matter. E.g. psql
might pick up Windows' more.com or Cygwin's more.exe, depending on PATH
settings but either one will participate happily in locking up psql.

Surprisingly, turning off paging via pset doesn't work; it locks up
identically to the above, but only spawning cmd.exe instances and not the
more.com subprocesses. That command line is:

C:\path\to\psql -X -q -h <host> -p <port> -U <user> --pset pager=off -f
backup.sql postgres

The only successful workaround I've found is to use the first command line
with PATH unset. What appears to happen is that psql spawns the cmd.exe
subprocess, but can't find the pager.. but runs to completion anyway.

Last but not least, all of this reproduces with psql from Postgres 8.1 as
well. I presume that we didn't encounter this issue before since we changed
the run context of our restore process at the 8.1 -> 8.3 transition from
running under a Windows service to running as a (usually administrator
group) normal user.

NOTE: I am able to provide the dump file that reproduces this bug upon
request. Please contact me at my address listed above as needed
(jwhitley(at)tableausoftware(dot)com)

Browse pgsql-bugs by date

  From Date Subject
Next Message saturn five 2008-03-27 01:16:22 BUG #4064: the 'PostgreSQL Database Server 8.3' service auto shutdown
Previous Message Tom Lane 2008-03-26 14:23:33 Re: BUG #4061: after backup/restore pg_attrdef.adsrc column lacks schema name.