Re: PostgreSQL 9.3 DB initialization issue

From: Steve Midgley <science(at)misuse(dot)org>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Ashish Tiwari <tashish786(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org, postgres list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: PostgreSQL 9.3 DB initialization issue
Date: 2017-05-13 21:50:55
Message-ID: CAJexoSJKoN9vQyFSKqOgR+3_xv86tWVa91ZEcmK831B2ZmYtAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

On Sat, May 13, 2017 at 9:44 AM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 05/13/2017 08:53 AM, Ashish Tiwari wrote:
>
>> Hi Andrian,
>>
>> The data have kept separate as in
>>
>> /pgsql/data2 directory.
>>
>> We are passing this path while starting the server using pg-ctl from bin
>> directory as well this data path is given in to postgresql.conf .
>>
>> So in current situation the binary is as of 9.3 and data is as of 9.2
>>
>> As an alternative can we install the 9.2 and manually make the up DB is
>> it possible Or data is lost ?. finally
>>
>
> If /pgsql/data2 represents the Postgres 9.2 data directory then the data
> is not lost.
>
> I am including information from your previous post in the below.
>
> > $./initdb -D /pgsql/9.3/main/data
>
> Are you overriding the default location that Debian uses?:
>
> https://wiki.debian.org/PostgreSql
>
> I would look at the above to see how you can use the Debian tools to
> maintain/create multiple Postgres clusters.
>
>
> > 9.2 is uninstalled now.
>
> You will need to install it again to be able to access the data in the 9.2
> data directory you show above(/pgsql/data2). I would maintain that
> copy(/pgsql/data2) and just copy it into the 9.2 cluster when you get it
> reinstalled. If you want to upgrade to 9.3, then use the 9.3 pg_dumpall to
> dump the 9.2 data and then the 9.3 pg_restore to restore it into the 9.3
> instance.
>
>
>
>> Thanks.
>> BR,Ashish
>>
>>
>
I am by no means an expert on any of this, but Adrian, I think you have a
typo in your instructions? Should it read:

"use the *[9.2]* pg_dumpall to dump the 9.2 data and then the 9.3
pg_restore to restore it into the 9.3 instance." (in the original it said
[9.3] where my brackets are).

I think you meant to say that v 9.2 server binary should be used to call
pg_dumpall (and run against the v9.2 running server instance), and then the
resulting dump file can be read into the 9.3 server by using the v9.3
binary for pg_restore. The pg_restore (v9.3) command will operate using
source files created by pg_dumpall, and load that into 9.3 running server
instance.

If I'm wrong about this, please correct me. But given the context of
debugging on this email thread, it seemed like I should point this
(possible) typo out, so there was no ambiguity for Ashish and his team.

Steve

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Adrian Klaver 2017-05-13 22:26:56 Re: [SQL] PostgreSQL 9.3 DB initialization issue
Previous Message Ashish Tiwari 2017-05-13 16:49:03 Re: [SQL] PostgreSQL 9.3 DB initialization issue

Browse pgsql-sql by date

  From Date Subject
Next Message Adrian Klaver 2017-05-13 22:26:56 Re: [SQL] PostgreSQL 9.3 DB initialization issue
Previous Message Ashish Tiwari 2017-05-13 16:49:03 Re: [SQL] PostgreSQL 9.3 DB initialization issue