Re: problem with recreating database with export - Mailing list pgsql-general

From Leif Biberg Kristensen
Subject Re: problem with recreating database with export
Date
Msg-id 201209272329.04706.leif@solumslekt.org
Whole thread Raw
In response to Re: problem with recreating database with export  (Dennis Gearon <gearond@sbcglobal.net>)
List pgsql-general
 Torsdag 27. september 2012 16.55.15 skrev Dennis Gearon :
> <note to future>
> To anyone reading this in the future, if you have problems importing a
> plain text database export, it is usually impossible to do:
> psql -d some_dbase -f the_backup.sql. I don't know why. What works is doing
> 'cd ./the_files_directory', going INTO psql command line, then issuing '\i
> the_backup.sql', and it's really fast. 8 seconds for 128 mbyte file.
>
> PS,do this as user 'postgres' on the system.
> </note to future>

FWIW, here are a few relevant lines from my reload.sh script, which I have
been using since version 7.4, and which is working perfectly:

    dropdb $DB
    createdb --encoding=UNICODE $DB
    psql -U postgres -d $DB -f $INFILE > restore.log 2>&1

Note that I'm running this as a regular postgres user, whose only privilege is
to create new databases.

regards, Leif


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: problem with recreating database with export
Next
From: Ondrej Ivanič
Date:
Subject: Re: PostgreSQL, OLAP, and Large Clusters