Re: [HACKERS] dumpall prob - Mailing list pgsql-hackers

From Patrick Welche
Subject Re: [HACKERS] dumpall prob
Date
Msg-id E11yJ25-00022w-00@quartz.newn.cam.ac.uk
Whole thread Raw
In response to Re: [HACKERS] dumpall prob  ("Patrick Welche" <prlw1@newn.cam.ac.uk>)
List pgsql-hackers
> % pg_dumpall > db.out2
> Connection to database 'List' failed.
> pqReadData() -- backend closed the channel unexpectedly.
>         This probably means the backend terminated abnormally
>         before or while processing the request.
> 
> pg_dump failed on List, exiting
> 
> 
> ... investigating ...

Reason:

In pg_dumpall, line 50 is:

psql -l -A -q -t| tr '|' ' ' | grep -v '^template1 ' | \

which outputs:

% psql -l -A -q -t| tr '|' ' ' | grep -v '^template1 '
List of databases
Database Owner
darwin prlw1
...
(5 rows)


so presumably, it tries to open a connection to "List" as user "of"
this implies that "-q" isn't quite as quiet as it could be...

I tried changing it to

psql -l -A -q -t| tr '|' ' ' | egrep -v '(^template1 |^List of databases|^Database Owner| rows)' | \ 

as a work around, but then:

\connect template1 ERROR:  attribute 'prlw1' not found
create database darwin;
\connect darwin ERROR:  attribute 'prlw1' not found

etc

and this is because line 56 wants to read
               where usesysid = \'$DBUSERID\'; \" | \
rather than               where usesysid = $DBUSERID; \" | \


Cheers,

Patrick


pgsql-hackers by date:

Previous
From: "Patrick Welche"
Date:
Subject: Re: [HACKERS] initdb / pg_version
Next
From: Don Baccus
Date:
Subject: Re: AW: [HACKERS] SELECT ... AS ... names in WHERE/GROUP BY/HAVING