Re: Script Location

From: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
To: Paul M Foster <paulf(at)quillandmouse(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Script Location
Date: 2000-11-16 04:43:58
Message-ID: 3A13660E.899E628F@wgcr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Paul M Foster wrote:
>
> When I dump a database (creating a script from the pg_dump command), I
> can't just put it in any old directory and point psql at it. I have to
> put it in the /var/lib/pgsql subdirs before postgresql will accept it.
> Is this right? Am I doing something wrong? Is this a bug^H^H^Hfeature?

You just have to point the output of pg_dump to any directory owned by
the user running pg_dump.

Since you mention /var/lib/pgsql, I'm assuming you are using an RPM
installation. If my assumption is incorrect, correct me, please.

In the default RPM installation, /var/lib/pgsql serves multiple roles:
/var/lib/pgsql is ~postgres
/var/lib/pgsql/data is PGDATA
/var/lib/pgsql/backups is designed as a repository for your dumps. This
gives you a 'safe haven' for your dumps that is owned by the user
postgres, which is the default database administration user for the RPM
installation.

If you attempt to pg_dump to a file in a directory not owned by
postgres, you will get an error. Likewise, if you have a dumpfile from
another system in a directory where the user postgres (or whatever user
you are trying to pipe the dump through psql back in) doesn't have read
and execute permissions, you will get an error.

To correct this problem, set your permissions appropriately in the
directory you wish to use.

Hope that helps!
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

In response to

Browse pgsql-general by date

  From Date Subject
Next Message GH 2000-11-16 04:45:40 Re: Script Location
Previous Message Lamar Owen 2000-11-16 04:36:47 Updated RPMset available (7.0.3-2)