Forum OpenACS Q&A: Re: Upgrade PG 7.3.4 to 7.4.1

Collapse
Posted by Dave Bauer on
Malte,

Did you run pg_dump from 7.3.4 before attempting to upgrade? I used this method and it worked for me. I wonder what the different might be.

Collapse
Posted by Malte Sussdorff on
Steps tried:

7.3.4. pg_dump, 7.4.1 psql
7.3.4. pg_dump, 7.4.1 pg_restore
7.3.4. pg_dump, 7.3.4 pgsql (on 7.4 database)
7.4.1. pg_dump, 7.4.1 psql
7.3.4. pg_dump, 7.3.6 pgsql/pg_dump, 7.4.1 psql

All failed with "invalid command \N". I'm curious as well if it worked for you....

Collapse
Posted by Steve Manning on
Is it something in your data thats being inteprepted incorrectly? Are you dumping blobs as well? Can you see the \N in the file?

If your not dumping blobs you might also want to try a different --format.

I did an upgrade from 7.3 to 7.4 by dumping plaintext in 7.3 then upgrading to 7.4 and importing and that worked fine (it wasn't an OpenACS instance tho).

You might also want to try two dumps one for data (-a) and one for schema (-s) to see if you can narrow it down.


    - Steve

Collapse
Posted by Bruno Mattarollo on
I did a pg_dump from 7.3.4 (server running RH 9) and then psql into 7.4 (on Panther -Mac OS X 10.3-) and it worked fine, no errors.

PG 7.4.2 was released today, compiling it and will let you know when I have time to try that as well.

/B

Collapse
Posted by Tilmann Singer on
I did a restore of a pg 7.4.1 dump on a pg 7.4.1 database recently and saw the same error. It turned out that it works when omitting the manual loading of postgresql.sql before restoring the dump, maybe the same applies to upgrades.
Collapse
Posted by C. R. Oldham on
<blockquote> PG 7.4.2 was released today
</blockquote>

Note this is already in Debian Unstable.  I upgraded to it today.

Collapse
Posted by Malte Sussdorff on
Tilmann, you are hereby declared saviour of the day :). It works.

Now someone has to make a note on that in the documentation....

Collapse
Posted by C. R. Oldham on
When browsing the HISTORY file for 7.4.2 I discovered the following:

[...] A dump/restore is not required for those running 7.4.X.  However, it may be advisable as the easiest method of incorporating fixes for two errors that have been found in the initial contents of 7.4.X system catalogs. A dump/initdb/reload sequence using 7.4.2's initdb will automatically correct these problems. [...]

The HISTORY file documents how to manually fix the problems without a dump/initdb/reload.

Oliver Elphick, the Debian Pg package maintainer informs me that if you were running the 7.4.1 Debian package before, the 7.4.2 package does NOT automatically install these fixes.

Collapse
Posted by Mark McI on
Hello Malte,

I am experiencing this EXACT problem.  I see that Tillman suggested omitting the manual loading of postgresql.sql. Can you briefly explain what that is?

I am dumping with pg_dump and restoring with the following command:
psql -e dbname < db_dump.sql

Any help you can provide will be MUCH appreciated as I'm inexperienced with postgres and totally stumped.

Collapse
Posted by Rocael Hernández Rizzardini on
do
psql -f packages/acs-kernel/sql/postgresql/postgresql.sql dbname

(that should do the trick)

when I restore a dump, usually do something like:
psql -f dump.file dbname