Re: Script Location

From: GH <grasshacker(at)over-yonder(dot)net>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Script Location
Date: 2000-11-16 04:45:40
Message-ID: 20001115224540.B13873@over-yonder.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Nov 16, 2000 at 12:22:34AM -0500, some SMTP stream spewed forth:
> 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?
>
> Paul M. Foster
>

http://www.postgresql.org/docs/user/app-pgdump.htm
Description: ...pg_dump will produce the queries necessary to re-generate
all user-defined types, functions, tables, indices, aggregates, and
operators...

Note the limitations (if you have not already done so).

http://www.postgresql.org/docs/admin/backup.htm#AEN2278
Restoring
The text files created by pg_dump are intended to be read in by the psql
program. The general command form to restore a dump is

psql dbname < infile
where infile is what you used as outfile for the pg_dump command. The
database dbname will not be created by this command, you must do that
yourself before executing psql (e.g., with createdb dbname). psql
supports similar options to pg_dump for controlling the database server
location and the user names. See its reference page for more information.

To answer your question:
You seem to misunderstand pg_dump (?).
To restore from a dump, just reate the database and
psql [options] < dumpfile
The dumpfile can be anywhere (accessible to your user).
It actually does *not* belong under the pgsql directory.

That sounds correct..

G'luck and
cheers
gh

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Paul M Foster 2000-11-16 05:22:34 Script Location
Previous Message Lamar Owen 2000-11-16 04:43:58 Re: Script Location