Re: I lost the pg_control file - Mailing list pgsql-general

From Tulio Oliveira
Subject Re: I lost the pg_control file
Date
Msg-id 3AF53AE0.5D7323DC@marilia.com
Whole thread Raw
In response to I lost the pg_control file  (Tulio Oliveira <mestredosmagos@marilia.com>)
List pgsql-general
Tom Lane wrote:
>
> Tulio Oliveira <mestredosmagos@marilia.com> writes:
> > I just lost the pg_control file, located in
/usr/local/pgsql/data/global
>
> How did that happen?
>
> > I start a new INITDB after rename the PG_DATA directory to another
name,
> > but if I copy the pg_control file to real data directory, I receive a
> > "NO FILE POINTER ERROR"...
>
> I think you could recover by copying in a freshly-initialized pg_control
> (be sure you make it with the same locale setting as before!) and then
> running the pg_resetxlog utility from contrib.  You'll probably have to
> use the -f switch to pg_resetxlog ... read its README file!
>
> Once you get the postmaster to start, do NOT make any changes to the
> database, or you will be very sorry :-(.  Run pg_dumpall, then reload
> the data into a correctly initialized database.
>
>                         regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl


Thanks, Tom Lane,

But I can't compile the pg_resetxlog !!!

in /usr/src/postgresql-7.1rc4/contrib/pg_resetxlog  directory, I typed
"make" and the result is:

gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
-I../../src/include
-c -o pg_resetxlog.o pg_resetxlog.c
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations pg_resetxlog.o
pg_crc.o   -Wl,-rpath,/usr/local/pgsql/lib -lz -lcrypt -lresolv -lnsl
-ldl -lm -lbsd  -o pg_resetxlog
/usr/bin/ld: cannot find -lbsd
collect2: ld returned 1 exit status
make: *** [pg_resetxlog] Error 1


And even I chmod 777 pg_resetxlog, and try ./pg_resetxlog -f $PGDATA, I
get an error "bash: ./pg_resetxlog.o: cannot execute binary
file"


Please, what can I do ???



regards,

tulio oliveira



--
Tulio Oliveira
Akácia Tecnologia
www.akacia.com.br
tulio@akacia.com.br

pgsql-general by date:

Previous
From: Lincoln Yeoh
Date:
Subject: Re: OODBMS vs. RDBMS
Next
From: "Christian Marschalek"
Date:
Subject: Sessions, Connections ...