After upgrade pg_dumpall fails - Mailing list pgsql-general

From Patrick Nelson
Subject After upgrade pg_dumpall fails
Date
Msg-id 4165C48DE9A0D211B6400800095C585F172E06@WASHINGTON
Whole thread Raw
Responses Re: After upgrade pg_dumpall fails
List pgsql-general
Spent yesterday upgrading to 7.2.1, wasn't a walk in the park but it's
working.

Last night my system ran a pg_dumpall and displayed an error:

--
-- pg_dumpall (7.2.1)
--
\connect template1
DELETE FROM pg_shadow WHERE usesysid <> (SELECT datdba FROM pg_database
WHERE datname = 'template0');

connected to template1...
ERROR:  Unable to convert abstime 'invalid' to timestamptz

The error seems to come from pg_dumpall at the following line:

$PSQL -d template1 -At -c "\
SELECT
  'CREATE USER \"' || usename || '\" WITH SYSID ' || usesysid
  || CASE WHEN passwd IS NOT NULL THEN ' PASSWORD ''' || passwd || '''' else
'' end
  || CASE WHEN usecreatedb THEN ' CREATEDB'::text ELSE ' NOCREATEDB' END
  || CASE WHEN usesuper THEN ' CREATEUSER'::text ELSE ' NOCREATEUSER' END
  || CASE WHEN valuntil IS NOT NULL THEN ' VALID UNTIL '''::text
    || CAST(valuntil AS TIMESTAMP) || '''' ELSE '' END || ';'
FROM pg_shadow
WHERE usesysid <> (SELECT datdba FROM pg_database WHERE datname =
'template0');" \

Looking at pg_shadow the structure looks like:

# \d pg_shadow
         Table "pg_shadow"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 usename     | name    |
 usesysid    | integer |
 usecreatedb | boolean |
 usetrace    | boolean |
 usesuper    | boolean |
 usecatupd   | boolean |
 passwd      | text    |
 valuntil    | abstime |
Unique keys: pg_shadow_usename_index,
             pg_shadow_usesysid_index
Triggers: pg_sync_pg_pwd

Is valuntil's type improper?  Anything else that might cause this?

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: help writing a constraint
Next
From: Patrick Nelson
Date:
Subject: Re: After upgrade pg_dumpall fails