pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bill Moran <wmoran@collaborativefusion.com>
To: Phoenix Kiula <phoenix.kiula@gmail.com>
Cc: PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: Dumping/Restoring with constraints?
Date: Wed, 27 Aug 2008 11:41:08 -0400
Message-ID: <20080827114108.cf0c9704.wmoran@collaborativefusion.com> (raw)
In-Reply-To: <e373d31e0808270820ia11a515se1110775ab29e998@mail.gmail.com>
References: <e373d31e0808270619uba31c8eodc2c85662b85140a@mail.gmail.com>
	<22708.1219845242@sss.pgh.pa.us>
	<e373d31e0808270712n7c599a82sca5a6bbf6cc5c20a@mail.gmail.com>
	<23571.1219848176@sss.pgh.pa.us>
	<e373d31e0808270751m646aebb5ga122d0d8aa87fd11@mail.gmail.com>
	<23743.1219848802@sss.pgh.pa.us>
	<e373d31e0808270820ia11a515se1110775ab29e998@mail.gmail.com>

In response to "Phoenix Kiula" <phoenix.kiula@gmail.com>:

> On Wed, Aug 27, 2008 at 10:53 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> >
> > No, you were right the first time: just feed the dump script to psql.
> >
> 
> Ok. Tried that. Because there's no database, I have to execute the
> psql command as "postgres" otherwise it doesn't work.
> 
> So here's my command:
> 
>   $ psql -d postgres -U postgres -h localhost < mydb.sql
> 
> This seems to be it. This is what I should be executing, except that
> it spews out many errors, like:
> 
>    ERROR:  invalid byte sequence for encoding "UTF8": 0x80

In psql, do a \l on both the original and the DB you're restoring to.
The encoding should be the same, if it's not, then fix that before
restoring.  If you're using pg_dump (which you don't mention ... it's
getting difficult to follow what you're doing in this thread) then
you can also use the -C option to have pg_dump add a CREATE DATABASE
statement to the dump file for you.

If you actually want to switch database encodings, that's an entirely
different question thread unto itself.

-- 
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

wmoran@collaborativefusion.com
Phone: 412-422-3463x4023



view thread (36+ messages)  latest in thread

Message-ID: <20080827114108.cf0c9704.wmoran@collaborativefusion.com>
Permalink:  ../20080827114108.cf0c9704.wmoran@collaborativefusion.com/
Also on:    postgresql.org/message-id/20080827114108.cf0c9704.wmoran@collaborativefusion.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: wmoran@collaborativefusion.com, phoenix.kiula@gmail.com, pgsql-general@postgresql.org
  Subject: Re: Dumping/Restoring with constraints?
  In-Reply-To: <20080827114108.cf0c9704.wmoran@collaborativefusion.com>

* 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