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

Re: [GENERAL] Forgot to dump old data before re-installing machine

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org, "Dave Page" <dpage(at)postgresql(dot)org>, "Stefan Schwarzer" <stefan(dot)schwarzer(at)grid(dot)unep(dot)ch>, "Martijn van Oosterhout" <kleptog(at)svana(dot)org>
Subject: Re: [GENERAL] Forgot to dump old data before re-installing machine
Date: 2008-01-18 19:11:57
Message-ID: 200801182011.59549.peter_e@gmx.net (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-patches
Tom Lane wrote:
> What would work better is to add some code that checks whether
> pg_control_version looks like the byte-swap of a small number,
> and prints a suitably modified error message if so.

Here is a possible patch.  Example output:

$ pg-install/bin/postgres -D pg-install/var/data
FATAL:  database files are incompatible with server
DETAIL:  The database cluster was initialized with PG_CONTROL_VERSION 1090715648 (0x41030000), but the server was compiled with PG_CONTROL_VERSION 833 (0x00000341).
HINT:  This could be a mismatched byte order.  It looks like you need to initdb.

I didn't follow how the user got into this mess, so I don't know whether the
suggestion "you need to initdb" is appropriate.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

Attachment: byte-order-check.patch
Description: text/x-diff (2.4 KB)

In response to

Responses

pgsql-patches by date

Next:From: Dave PageDate: 2008-01-18 19:16:39
Subject: Re: [GENERAL] Forgot to dump old data before re-installing machine
Previous:From: Dave PageDate: 2008-01-18 18:15:28
Subject: Re: Forgot to dump old data before re-installing machine

pgsql-general by date

Next:From: Dave PageDate: 2008-01-18 19:16:39
Subject: Re: [GENERAL] Forgot to dump old data before re-installing machine
Previous:From: Glyn AstillDate: 2008-01-18 18:53:27
Subject: Re: Stupid question about WAL archiving

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