Skip site navigation (1) Skip section navigation (2)

Re: Upgrading a database with pg_dumpall / psql ...

From: Paul Lambert <paul(dot)lambert(at)reynolds(dot)com(dot)au>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Upgrading a database with pg_dumpall / psql ...
Date: 2007-11-16 02:03:49
Message-ID: 473CFA85.8000409@reynolds.com.au (view raw or flat)
Thread:
Lists: pgsql-admin
Marc G. Fournier From: wrote:
> This is one of those 'stupid questions I hate to ask' ... I've rechecked the 
> docs to make sure I haven't missed something stupid, and unless I'm blind, 
> I haven't ...
> 
> I'm trying to upgrade a database from 8.1 -> 8.2 ... on a seperate server,
> with 8.2 pg_dump already installed, I do:
> 
>   pg_dumpall -U pgsql -h <host> > dump.sql
> 
> Works great.
> 
> Then I upgrade the 8.1 server to 8.2, initdb, and try and do the restore
> doing:
> 
>   psql -U pgsql -h <host> template1 < dump.sql
> 
> And get a whack of:
> 
> invalid command \n
> invalid command \
> invalid command \ni
> invalid command \
> invalid command \n
> invalid command \n
> invalid command \.
> 
> and other errors ... so I'm obviously missing something that is probably
> obvious to everyone else ...  am I dumping wrong?  If I use '--inserts', 
> it, of course, works like a charm, its only when I try and use COPY ...
> 

Perhaps in your old install standard_conforming_strings was set to off? 
Where in your new 8.2 install it is on by default. Check the 
postgresql.conf settings in your new install comparing against your 8.1 
install, probably find some things particularly in the platform/version 
compatibility section are different.

-- 
Paul Lambert
Database Administrator
AutoLedgers

In response to

Responses

pgsql-admin by date

Next:From: Marc G. FournierDate: 2007-11-16 05:44:38
Subject: Re: Upgrading a database with pg_dumpall / psql ...
Previous:From: Trent PingenotDate: 2007-11-15 21:02:35
Subject: PG Service won't start

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group