Re: Restore database from files (not dump files)? - Mailing list pgsql-general

From wheel
Subject Re: Restore database from files (not dump files)?
Date
Msg-id MPG.1fe7e24a50328dc7989744@newsgroups.comcast.net
Whole thread Raw
In response to Re: Restore database from files (not dump files)?  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Restore database from files (not dump files)?  (Richard Huxton <dev@archonet.com>)
Re: Restore database from files (not dump files)?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
In article <12nhtgngknodu64@corp.supernews.com>, ptjm@interlog.com
says...
> In article <MPG.1fe17d71afa77c5b989742@newsgroups.comcast.net>,
> wheel  <wheel@wheel.not> wrote:
>
> % I copied all of the database 'parts' to the new 'base' directory. I am
> % not sure how carefully anyone has read what I wrote. But it's so simple
> % what I'm asking about, or so it would seem to me.
>
> As several people have pointed out, you can't do this.
>
> % In another install of pg (assuming BM is not reading this and won't be
> % upset by abbreviations) there was a database at this location:
> %
> % c:\postgresql\data\base\16404
> %
> % at least I think that is a database folder, I've never read anything
> % about where/how postgres stores the files for a database. Under the
> % 16404 folder are many other folders, I think they comprise that
> % particular database.
> %
> % On a separate postgres installation, ie different server, I want to move
> % that 16404 folder (with child dirs etc, what I assume are it's parts) to
> % what amounts to the same location:
> %
> % c:\postgresql\data\base\16404
>
> As several people have pointed out, this will not work. You can copy
> c:\postgresql\data and everything under it, but you can't copy
> individual subdirectories and have it work.
>
>
I see what you and they were talking about now.

The reason I'd not understood before what that when told that it doesn't
work to copy individual subdirs, was because as I'd stated I wasn't 100%
sure that the dirs like c:\postgresql\data\base\16404\ represented the
top level of a distinct db's directory structure, and had mentioned one
of that folder's subdirectories as an example of what I'd copied along
with c:\postgresql\data\base\16404\. That subdir is what I thought
people were referring to when they said you can't selectively copy
subdirectories. After that I more or less stubbornly misinterpreted what
was being recommended in that light.

I guess the reason is that the pg system database etc are lodged in the
hive under \base\, and the system db contains the metadata about the db
to be restored?

Unfortunately I've tried this now (exact same version of pg windows
binary, user, password etc) and it didn't work. I'll just forget about
the db I was trying to restore, it wasn't important, and has certainly
not been worth the train wreck intro to the group.

pgsql-general by date:

Previous
From: wheel
Date:
Subject: Re: Restore database from files (not dump files)?
Next
From: Richard Huxton
Date:
Subject: Re: Why DISTINCT ... DESC is slow?