Thread: restoring DB

restoring DB

From
Cleiton Peres Reis
Date:
Hello,

I would like to know, if I've the Database directory only :

/var/lib/pgsql/data/base/example-db
            ^^^^^^^^^^^

I can restore this Database later ?

Note. I don't have the dump of this database.


My postgres version is 6.5.2


Thanks a lot .


--

        Cleiton P Reis
    Universidade Catolica de Pelotas
        Ciencia da Computacao


nothing it is stronger than the heart of a volunteer
-Cel Dolitle

Re: restoring DB

From
Martijn van Oosterhout
Date:
On Fri, May 31, 2002 at 04:44:01AM -0300, Cleiton Peres Reis wrote:
>
> Hello,
>
> I would like to know, if I've the Database directory only :
>
> /var/lib/pgsql/data/base/example-db
>             ^^^^^^^^^^^
>
> I can restore this Database later ?
>
> Note. I don't have the dump of this database.

The answer is maybe. you'll be able to extract some data, but there is
no guarentee it will reflect the state of the database at any stage.

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Canada, Mexico, and Australia form the Axis of Nations That
> Are Actually Quite Nice But Secretly Have Nasty Thoughts About America

Re: restoring DB

From
Cleiton Peres Reis
Date:
On Fri, 31 May 2002 19:07:31 +1000
Martijn van Oosterhout <kleptog@svana.org> wrote:

> On Fri, May 31, 2002 at 04:44:01AM -0300, Cleiton Peres Reis wrote:
> >
> > Hello,
> >
> > I would like to know, if I've the Database directory only :
> >
> > /var/lib/pgsql/data/base/example-db
> >             ^^^^^^^^^^^
> >
> > I can restore this Database later ?
> >
> > Note. I don't have the dump of this database.
>
> The answer is maybe. you'll be able to extract some data, but there is
> no guarentee it will reflect the state of the database at any stage.


   And How I can do this ? How can I try to get some data ?
simple copying the directory and start postgres ? (I tryed this and don't work :(


--

        Cleiton P Reis
    Universidade Catolica de Pelotas
        Ciencia da Computacao


nothing it is stronger than the heart of a volunteer
-Cel Dolitle

Re: restoring DB

From
Martijn van Oosterhout
Date:
On Fri, May 31, 2002 at 10:50:27AM -0300, Cleiton Peres Reis wrote:
> On Fri, 31 May 2002 19:07:31 +1000
> Martijn van Oosterhout <kleptog@svana.org> wrote:
>
> > On Fri, May 31, 2002 at 04:44:01AM -0300, Cleiton Peres Reis wrote:
> > >
> > > Hello,
> > >
> > > I would like to know, if I've the Database directory only :
> > >
> > > /var/lib/pgsql/data/base/example-db
> > >             ^^^^^^^^^^^
> > >
> > > I can restore this Database later ?
> > >
> > > Note. I don't have the dump of this database.
> >
> > The answer is maybe. you'll be able to extract some data, but there is
> > no guarentee it will reflect the state of the database at any stage.
>
>
>    And How I can do this ? How can I try to get some data ?
> simple copying the directory and start postgres ? (I tryed this and don't work :(

Get a new postgres install. createdb example-db. shutdown the postmaster.
copy the files into that directory. run that reset_xlog program. start
postmaster. pray.

all totally untested, but that's the theory at least.

HTH,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Canada, Mexico, and Australia form the Axis of Nations That
> Are Actually Quite Nice But Secretly Have Nasty Thoughts About America