Re: problem with recreating database with export

From: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: problem with recreating database with export
Date: 2012-09-27 21:29:04
Message-ID: 201209272329.04706.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ondrej Ivanič 2012-09-27 22:48:16 Re: PostgreSQL, OLAP, and Large Clusters
Previous Message Adrian Klaver 2012-09-27 20:49:26 Re: problem with recreating database with export