From: Kris Deugau <kdeugau@vianet.ca>
To: pgsql-admin@postgresql.org
Subject: Re: pg_dumpall - Need advice
Date: Fri, 16 Sep 2005 15:11:47 -0400
Message-ID: <432B18F3.16195FFD@vianet.ca> (raw)
References: <35b7725f050916113056ade940@mail.gmail.com>
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!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: kdeugau@vianet.ca
Subject: Re: pg_dumpall - Need advice
In-Reply-To: <432B18F3.16195FFD@vianet.ca>
References: <35b7725f050916113056ade940@mail.gmail.com> <432B18F3.16195FFD@vianet.ca>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox