X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AD0FED9040 for ; Fri, 16 Sep 2005 16:11:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 44832-03 for ; Fri, 16 Sep 2005 19:11:50 +0000 (GMT) Received: from filtermail.webhart.net (filtermail.webhart.net [209.91.179.134]) by svr1.postgresql.org (Postfix) with ESMTP id B43E9D8DD8 for ; Fri, 16 Sep 2005 16:11:49 -0300 (ADT) Received: from vianet.ca (pem-fw.vianet.ca [209.91.179.130]) by filtermail.webhart.net (8.12.3/8.12.3) with ESMTP id j8GJBnWq028861 for ; Fri, 16 Sep 2005 15:11:50 -0400 Message-ID: <432B18F3.16195FFD@vianet.ca> Date: Fri, 16 Sep 2005 15:11:47 -0400 From: Kris Deugau Reply-To: pgsql-admin@postgresql.org, pgsql-admin@postgresql.org Organization: ViaNet Pembroke X-Mailer: Mozilla 4.78 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: pg_dumpall - Need advice References: <35b7725f050916113056ade940@mail.gmail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.51 on 209.91.179.134 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.038 required=5 tests=[AWL=-0.013, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/192 X-Sequence-Number: 18929 Please, don't post in HTML. J French wrote: > I need to write a database dump/backup shell script to cron but I > can't seem to get pg_dumpall working. Could someone who has this > working take a look at my configuration below and give me some > pointers? It would appear that "/usr/lib/postgresql/bin/readpgenv: > line 2: /etc/postgresql/postgresql.env: No such file or directory " > would be a big tip off except I can't find that file on my system and > have no idea what it is/does. I'm new to postgresql (obviously). > Thanks for your time. -John Apparently a Debian-specific file, since I don't recognize it offhand and none of the RedHat(-derived) boxen I run have it. > debian:~# dpkg -l | grep postgresql > ii postgresql 7.4.7-6sarge1 object-relational SQL database > management sy > ii postgresql-cli 7.4.7-6sarge1 front-end programs for PostgreSQL > debian:~# Aside from my grumpiness about all things Debian... > debian:~# su postgres > postgres@debian:/root$ cd > postgres@debian:~$ pwd > /var/lib/postgres > postgres@debian:~$ pg_dumpall > testdump > /usr/lib/postgresql/bin/readpgenv: line 2: > /etc/postgresql/postgresql.env: No such file or directory > postgres@debian:~$ ... this works Just Fine for me on a fairly-bare Sarge box, with Postgres installed just to see what happens. Since you seem to be missing a semi-critical file (Debian-specific, unfortunately - and why it's in any way necessary is beyond me), try creating /etc/postgresql/postgresql.env with this content: (Watch for linewraps) ======BEGIN # postgresql debian package # # This section is supplied as part of the Debian package for PostgreSQL. # It sets the environment for an ordinary user of PostgreSQL and should # be executed by the .profile or equivalent for the postgres administrator # # It is automatically read by all six frontend programs (in the # postgresql-client package). [ -r /etc/postgresql/postmaster.conf ] && . /etc/postgresql/postmaster.conf PGDATA=${POSTGRES_DATA:-/var/lib/postgres/data} PGLIB=/usr/lib/postgresql/lib PGACCESS_HOME=/usr/lib/postgresql/share/pgaccess PGHOST= export PGLIB PGDATA PGACCESS_HOME PGHOST ======END If that doesn't help, try uninstalling the postgresql package, and reinstalling it. You may have to purge it and manually hunt down leftover files before reinstalling. > Contents of /etc/postgresql: Er, if this is truly PostgreSQL as installed from the standard Debian package, I sincerely hope that you meant /etc/postgresql/pg_hba.conf. FWIW, it looks identical to the fresh one I found just after installing. I see 5 files in /etc/postgresql: postgres@test2:/etc/postgresql$ ls -l total 32 -rw-r----- 1 root postgres 4885 2005-05-18 04:33 pg_hba.conf -rw-r----- 1 root postgres 1441 2005-05-18 04:33 pg_ident.conf -rw-r--r-- 1 root root 9058 2005-09-16 14:50 postgresql.conf -rw-r--r-- 1 root root 602 2005-05-18 04:33 postgresql.env -rw-r--r-- 1 root root 3458 2005-09-16 14:49 postmaster.conf -kgd (Debian just rubs me the wrong way. I always end up fighting some component instead of quickly and easily bending it to my usage.) -- Get your mouse off of there! You don't know where that email has been!