How can I recovery old Data from files and folders on windows?

Started by Premsun Choltanwanichover 21 years ago10 messagesgeneral
Jump to latest
#1Premsun Choltanwanich
Premsun@nsasia.co.th

I got some problem on PostgreSQL 8 for windows so I uninstall and
reinstall it again. Before I uninstall PostgreSQL 8 I already backup all
files and folders (copy all to other place).

The problem is how can I restore by use files and folders that I
already backup. If I try to restore by put all of it back it will be
make a same error. I just want to restore only DATA (databases,
functions, views, users, group etc).

Please suggest me that How can I recovery old Data from files and
folders on windows?

#2Markus Wollny
Markus.Wollny@computec.de
In reply to: Premsun Choltanwanich (#1)
Re: How can I recovery old Data from files and folders on windows?

Hi!

You can't. You'll have to restore your erroneous version first, then dump your data, the reinstall and use restore to restore the data you want.

Kind regards

Markus

Show quoted text

-----Ursprüngliche Nachricht-----
Von: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] Im Auftrag von
Premsun Choltanwanich
Gesendet: Dienstag, 7. Dezember 2004 10:49
An: pgsql-general@postgresql.org
Betreff: [GENERAL] How can I recovery old Data from files and
folders on windows?

I got some problem on PostgreSQL 8 for windows so I uninstall
and reinstall it again. Before I uninstall PostgreSQL 8 I
already backup all files and folders (copy all to other place).

The problem is how can I restore by use files and folders
that I already backup. If I try to restore by put all of it
back it will be make a same error. I just want to restore
only DATA (databases, functions, views, users, group etc).

Please suggest me that How can I recovery old Data from
files and folders on windows?

---------------------------(end of
broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org

#3Frank van Vugt
ftm.van.vugt@foxi.nl
In reply to: Markus Wollny (#2)
RC1, missing -lpthread when building with --disable-shared on i686

L.S.

I noticed the following :

Workstation used to build RC1:

2.4.21-260-athlon, i686 athlon i386 GNU/Linux

Configured with :

./configure
--enable-thread-safety
--disable-shared
--prefix=/usr/src/postgresql/install

Error during make install :

in directory src/bin/pg_ctl

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels
-fno-strict-aliasing pg_ctl.o -L../../../src/interfaces/libpq -lpq
-L../../../src/port -Wl,-rpath,/usr/src/postgresql/install/lib -lpgport -lz
-lreadline -lcrypt -lresolv -lnsl -ldl -lm -o pg_ctl
../../../src/interfaces/libpq/libpq.a(fe-secure.o)(.text+0x140): In function
`pq_block_sigpipe':
: undefined reference to `pthread_sigmask'
../../../src/interfaces/libpq/libpq.a(fe-secure.o)(.text+0x1e0): In function
`pq_reset_sigpipe':
: undefined reference to `pthread_sigmask'
collect2: ld gaf exit-status 1 terug

There seems to be a missing option '-lpthread' here, adding it properly links
the file.

The same goes for pg_restore, pg_dumpall, psql, createdb, createlang,
createuser, dropdb, droplang, dropuser, clusterdb and vacuumdb.

--
Best,

Frank.

#4Bruce Momjian
bruce@momjian.us
In reply to: Frank van Vugt (#3)
Re: RC1, missing -lpthread when building with --disable-shared

What do you show for PTHREAD_* in Makefile.global?

Is this another platform where the library doesn't remember dependencies
used when it was built? It is Linux so I wouldn't think so.

---------------------------------------------------------------------------

Frank van Vugt wrote:

L.S.

I noticed the following :

Workstation used to build RC1:

2.4.21-260-athlon, i686 athlon i386 GNU/Linux

Configured with :

./configure
--enable-thread-safety
--disable-shared
--prefix=/usr/src/postgresql/install

Error during make install :

in directory src/bin/pg_ctl

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels
-fno-strict-aliasing pg_ctl.o -L../../../src/interfaces/libpq -lpq
-L../../../src/port -Wl,-rpath,/usr/src/postgresql/install/lib -lpgport -lz
-lreadline -lcrypt -lresolv -lnsl -ldl -lm -o pg_ctl
../../../src/interfaces/libpq/libpq.a(fe-secure.o)(.text+0x140): In function
`pq_block_sigpipe':
: undefined reference to `pthread_sigmask'
../../../src/interfaces/libpq/libpq.a(fe-secure.o)(.text+0x1e0): In function
`pq_reset_sigpipe':
: undefined reference to `pthread_sigmask'
collect2: ld gaf exit-status 1 terug

There seems to be a missing option '-lpthread' here, adding it properly links
the file.

The same goes for pg_restore, pg_dumpall, psql, createdb, createlang,
createuser, dropdb, droplang, dropuser, clusterdb and vacuumdb.

--
Best,

Frank.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#5Frank van Vugt
ftm.van.vugt@foxi.nl
In reply to: Bruce Momjian (#4)
Re: RC1, missing -lpthread when building with --disable-shared on i686

What do you show for PTHREAD_* in Makefile.global?

PTHREAD_CFLAGS = -pthread -D_REENTRANT -D_THREAD_SAFE
-D_POSIX_PTHREAD_SEMANTICS
PTHREAD_LIBS = -lpthread

Is this another platform where the library doesn't remember dependencies
used when it was built? It is Linux so I wouldn't think so.

Yeah, early in the beta-cycle builds on my Slackware v9.1 server showed
symptoms like this, but these were already handled a while ago. This comes up
just now since I started to use RC1 on my development workstation, which runs
SuSE (v9.0 for that matter, will be able to try v9.1 in a couple of hours and
v9.2 tomorrow, it you'd like).

--
Best,

Frank.

#6Frank van Vugt
ftm.van.vugt@foxi.nl
In reply to: Bruce Momjian (#4)
Re: RC1, missing -lpthread when building with --disable-shared on i686

I just confirmed that the same goes for:

Linux 2.6.5-7.111.5-default, i686 i686 i386 GNU/Linux
(SuSE v9.1)

Makefile.global holds:

PTHREAD_CFLAGS = -pthread -D_REENTRANT -D_THREAD_SAFE
-D_POSIX_PTHREAD_SEMANTICS
PTHREAD_LIBS = -lpthread

Would you like confirmation for v9.2 as well?

--
Best,

Frank.

#7Bruce Momjian
bruce@momjian.us
In reply to: Frank van Vugt (#3)
Threading with non-shared libraries

OK, it took me a while to figure this out, but it is similar to the
problem we have on AIX. AIX shared libraries don't track other
libraries needed by the shared library, and non-shared libraries also
have no such dependency information.

I have attached a patch that is very similar to the AIX fix. It
basically propagates the thread library flags to all uses of libpq.

Would you please test and report back? Thanks.

---------------------------------------------------------------------------

Frank van Vugt wrote:

L.S.

I noticed the following :

Workstation used to build RC1:

2.4.21-260-athlon, i686 athlon i386 GNU/Linux

Configured with :

./configure
--enable-thread-safety
--disable-shared
--prefix=/usr/src/postgresql/install

Error during make install :

in directory src/bin/pg_ctl

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels
-fno-strict-aliasing pg_ctl.o -L../../../src/interfaces/libpq -lpq
-L../../../src/port -Wl,-rpath,/usr/src/postgresql/install/lib -lpgport -lz
-lreadline -lcrypt -lresolv -lnsl -ldl -lm -o pg_ctl
../../../src/interfaces/libpq/libpq.a(fe-secure.o)(.text+0x140): In function
`pq_block_sigpipe':
: undefined reference to `pthread_sigmask'
../../../src/interfaces/libpq/libpq.a(fe-secure.o)(.text+0x1e0): In function
`pq_reset_sigpipe':
: undefined reference to `pthread_sigmask'
collect2: ld gaf exit-status 1 terug

There seems to be a missing option '-lpthread' here, adding it properly links
the file.

The same goes for pg_restore, pg_dumpall, psql, createdb, createlang,
createuser, dropdb, droplang, dropuser, clusterdb and vacuumdb.

--
Best,

Frank.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/pgpatches/shlibtext/plainDownload+6-0
#8Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#7)
Re: Threading with non-shared libraries

Bruce Momjian wrote:

OK, it took me a while to figure this out, but it is similar to the
problem we have on AIX. AIX shared libraries don't track other
libraries needed by the shared library, and non-shared libraries also
have no such dependency information.

I'm pretty sure that static linking is completely broken for nontrivial
configurations because of this issue. If we want to support that, we
should do an all-out fix, not a fix for one library and one platform.

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

#9Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#8)
Re: Threading with non-shared libraries

Peter Eisentraut wrote:

Bruce Momjian wrote:

OK, it took me a while to figure this out, but it is similar to the
problem we have on AIX. AIX shared libraries don't track other
libraries needed by the shared library, and non-shared libraries also
have no such dependency information.

I'm pretty sure that static linking is completely broken for nontrivial
configurations because of this issue. If we want to support that, we
should do an all-out fix, not a fix for one library and one platform.

Right. My idea is that we need that code on AIX or when doing static
builds on any platform.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#10Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#7)
Re: Threading with non-shared libraries

OK, applied. I got a private email from the poster stating the patch
works for him. The final patch is slightly different because of the AIX
test.

---------------------------------------------------------------------------

Index: Makefile.global.in
===================================================================
RCS file: /cvsroot/pgsql/src/Makefile.global.in,v
retrieving revision 1.206
diff -c -r1.206 Makefile.global.in
*** Makefile.global.in	16 Dec 2004 17:48:29 -0000	1.206
--- Makefile.global.in	16 Dec 2004 18:12:55 -0000
***************
*** 308,318 ****
--- 308,324 ----

libpq = -L$(libpq_builddir) -lpq

+ # If doing static linking, shared library dependency can't be
+ # used so we specify pthread libs for every usage of libpq
+ ifeq ($(enable_shared), no)
+ libpq += $(PTHREAD_LIBS)
+ else
  # AIX libraries do not remember their required libs so we have to force
  # thread dependent libraires in the link
  ifeq ($(PORTNAME), aix)
  libpq += $(PTHREAD_LIBS)
  endif
+ endif

submake-libpq:
$(MAKE) -C $(libpq_builddir) all

---------------------------------------------------------------------------

Bruce Momjian wrote:

OK, it took me a while to figure this out, but it is similar to the
problem we have on AIX. AIX shared libraries don't track other
libraries needed by the shared library, and non-shared libraries also
have no such dependency information.

I have attached a patch that is very similar to the AIX fix. It
basically propagates the thread library flags to all uses of libpq.

Would you please test and report back? Thanks.

---------------------------------------------------------------------------

Frank van Vugt wrote:

L.S.

I noticed the following :

Workstation used to build RC1:

2.4.21-260-athlon, i686 athlon i386 GNU/Linux

Configured with :

./configure
--enable-thread-safety
--disable-shared
--prefix=/usr/src/postgresql/install

Error during make install :

in directory src/bin/pg_ctl

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels
-fno-strict-aliasing pg_ctl.o -L../../../src/interfaces/libpq -lpq
-L../../../src/port -Wl,-rpath,/usr/src/postgresql/install/lib -lpgport -lz
-lreadline -lcrypt -lresolv -lnsl -ldl -lm -o pg_ctl
../../../src/interfaces/libpq/libpq.a(fe-secure.o)(.text+0x140): In function
`pq_block_sigpipe':
: undefined reference to `pthread_sigmask'
../../../src/interfaces/libpq/libpq.a(fe-secure.o)(.text+0x1e0): In function
`pq_reset_sigpipe':
: undefined reference to `pthread_sigmask'
collect2: ld gaf exit-status 1 terug

There seems to be a missing option '-lpthread' here, adding it properly links
the file.

The same goes for pg_restore, pg_dumpall, psql, createdb, createlang,
createuser, dropdb, droplang, dropuser, clusterdb and vacuumdb.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073