Thread: re-install postgres/postGIS without Loosing data??

re-install postgres/postGIS without Loosing data??

From
"G. P."
Date:
Hi,

I have installed postres/postgis 9 in win7.
I tried to edit pg_hba.conf not as postgres user and although i cancelled all changes I can start my postgres any more......

Now I am thinking of re-installing postgresql but for sure i dont loose my data ...
Any ideas ?

Thx
George  

Re: re-install postgres/postGIS without Loosing data??

From
"G. P."
Date:
Hi salah,

I tried 

C:\Program Files\PostgreSQL\9.0\bin>pg_ctl.exe -U postgres restart
pg_ctl: PID file "C:/Program Files/PostgreSQL/9.0/data/postmaster.pid" does not
exist
Is server running?
starting server anyway
server starting

but i get the following error:

2011-05-18 02:09:26 EEST LOG:  database system was shut down at 2011-05-17 22:45:00 EEST
2011-05-18 02:09:36 EEST LOG:  could not remove cache file "base/32803/pg_internal.init": Permission denied
2011-05-18 02:09:36 EEST PANIC:  could not open file "pg_xlog/000000010000000000000002" (log file 0, segment 2): Permission denied


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

2011-05-18 02:09:36 EEST LOG:  startup process (PID 5636) exited with exit code 3
2011-05-18 02:09:36 EEST LOG:  aborting startup due to startup process failure

Thats why i am considering to re-install postgres....




From: salah jubeh <s_jubeh@yahoo.com>
To: G. P. <pagomen2001@yahoo.gr>
Sent: Wed, May 18, 2011 1:05:38 AM
Subject: Re: [GENERAL] re-install postgres/postGIS without Loosing data??

Have a look on 

Regards
 


From: G. P. <pagomen2001@yahoo.gr>
To: pgsql-general@postgresql.org
Sent: Tuesday, May 17, 2011 11:54 PM
Subject: [GENERAL] re-install postgres/postGIS without Loosing data??

Hi,

I have installed postres/postgis 9 in win7.
I tried to edit pg_hba.conf not as postgres user and although i cancelled all changes I can start my postgres any more......

Now I am thinking of re-installing postgresql but for sure i dont loose my data ...
Any ideas ?

Thx
George  


Re: re-install postgres/postGIS without Loosing data??

From
Craig Ringer
Date:
On 18/05/2011 7:13 AM, G. P. wrote:

> C:\Program Files\PostgreSQL\9.0\bin>pg_ctl.exe -U postgres restart
> pg_ctl: PID file "C:/Program Files/PostgreSQL/9.0/data/postmaster.pid"

> */2011-05-18 02:09:26 EEST LOG: database system was shut down at
> 2011-05-17 22:45:00 EEST/*
> */2011-05-18 02:09:36 EEST LOG: could not remove cache file
> "base/32803/pg_internal.init": Permission denied/*
> */2011-05-18 02:09:36 EEST PANIC: could not open file
> "pg_xlog/000000010000000000000002" (log file 0, segment 2): Permission
> denied/*

You cannot restart postgresql using pg_ctl running under your normal
user account if it was originally set up as a Windows service running as
the "postgres" user. You must use runas.exe to run pg_ctl as user
"postgres", or just use the service control panel (services.msc) or "net
service" command to control it.

Rather than trying to reinstall, which might make the problem worse
rather than better, stop trying to change things and think for a moment.
Restart the computer, then check the services control panel and see if
postgresql is shown as running there. If it is not, try to start it. If
it does not start, examine the system event logs ("Event Viewer" in the
start menu) to see if there are any error messages from the service.
Also check the PostgreSQL logs, which will be in

   C:/Program Files/PostgreSQL/9.0/data/pg_log

to see if there are any informative error messages at the bottom of the
most recent log file.

Once you've done that, you'll have some idea what's wrong and what to do
next.

--
Craig Ringer

Tech-related writing at http://soapyfrogs.blogspot.com/

Re: re-install postgres/postGIS without Loosing data??

From
"G. P."
Date:
Hi Craig,All

when i try from the service control panel

I  get an 
1053 error : the service did not respond to restart or control request in a timely fashion

Additionally no log is produced @ 
C:/Program Files/PostgreSQL/9.0/data/pg_log

I suspect a mesh with the postgres account. Can I re-install this account?

thx
george

From: Craig Ringer <craig@postnewspapers.com.au>
To: G. P. <pagomen2001@yahoo.gr>
Cc: salah jubeh <s_jubeh@yahoo.com>; pgsql-general@postgresql.org
Sent: Wed, May 18, 2011 3:52:07 AM
Subject: Re: [GENERAL] re-install postgres/postGIS without Loosing data??

On 18/05/2011 7:13 AM, G. P. wrote:

> C:\Program Files\PostgreSQL\9.0\bin>pg_ctl.exe -U postgres restart
> pg_ctl: PID file "C:/Program Files/PostgreSQL/9.0/data/postmaster.pid"

> */2011-05-18 02:09:26 EEST LOG: database system was shut down at
> 2011-05-17 22:45:00 EEST/*
> */2011-05-18 02:09:36 EEST LOG: could not remove cache file
> "base/32803/pg_internal.init": Permission denied/*
> */2011-05-18 02:09:36 EEST PANIC: could not open file
> "pg_xlog/000000010000000000000002" (log file 0, segment 2): Permission
> denied/*

You cannot restart postgresql using pg_ctl running under your normal user account if it was originally set up as a Windows service running as the "postgres" user. You must use runas.exe to run pg_ctl as user "postgres", or just use the service control panel (services.msc) or "net service" command to control it.

Rather than trying to reinstall, which might make the problem worse rather than better, stop trying to change things and think for a moment. Restart the computer, then check the services control panel and see if postgresql is shown as running there. If it is not, try to start it. If it does not start, examine the system event logs ("Event Viewer" in the start menu) to see if there are any error messages from the service. Also check the PostgreSQL logs, which will be in

  C:/Program Files/PostgreSQL/9.0/data/pg_log

to see if there are any informative error messages at the bottom of the most recent log file.

Once you've done that, you'll have some idea what's wrong and what to do next.

-- Craig Ringer

Tech-related writing at http://soapyfrogs.blogspot.com/

Re: re-install postgres/postGIS without Loosing data??

From
Thierry Hauchard
Date:
Hi,

We experienced similar problem : it was just the encoding of pg_hba.conf
that was accidentally changed when modifying it (UTF8/ansi)

Thierry

Le 18/05/2011 09:28, G. P. a écrit :
> Hi Craig,All
>
> when i try from the service control panel
>
> I get an
> *1053 error : the service did not respond to restart or control request
> in a timely fashion*
>
> Additionally no log is produced @
> *C:/Program Files/PostgreSQL/9.0/data/pg_log*
> *
> *
> I suspect a mesh with the postgres account. Can I re-install this account?
>
> thx
> george
>


Re: re-install postgres/postGIS without Loosing data??

From
"G. P."
Date:
Hi Thierry,

The encoding is ansi. Should I save them as UTF8?  


From: Thierry Hauchard <gesteam_l4d@gesteam.fr>
To: pgsql-general@postgresql.org
Sent: Wed, May 18, 2011 10:46:51 AM
Subject: Re: [GENERAL] re-install postgres/postGIS without Loosing data??

Hi,

We experienced similar problem : it was just the encoding of pg_hba.conf
that was accidentally changed when modifying it (UTF8/ansi)

Thierry

Le 18/05/2011 09:28, G. P. a écrit :
> Hi Craig,All
>
> when i try from the service control panel
>
> I get an
> *1053 error : the service did not respond to restart or control request
> in a timely fashion*
>
> Additionally no log is produced @
> *C:/Program Files/PostgreSQL/9.0/data/pg_log*
> *
> *
> I suspect a mesh with the postgres account. Can I re-install this account?
>
> thx
> george
>


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: re-install postgres/postGIS without Loosing data??

From
Craig Ringer
Date:
On 05/18/2011 03:46 PM, Thierry Hauchard wrote:
> Hi,
>
> We experienced similar problem : it was just the encoding of pg_hba.conf
> that was accidentally changed when modifying it (UTF8/ansi)

The encoding should not matter unless there are characters above byte
128, because UTF-8 and the ANSI encoding are the same from 0-127.

I guess it's possible that Pg chokes if it finds a byte-order mark (BOM)
at the start of pg_hba.conf; I haven't tested this. A BOM is optional
for UTF-8 text but some text editors do add it, and I've run into
software that chokes on a BOM before. Many editors do assume unknown
text is UTF-8 if they can't identify it as some other known encoding,
and some would add a BOM on saving in this case.

If there is a byte order mark (BOM) you'll be able to tell because the
first three bytes of pg_hba.conf or postgresql.conf , when examined in a
hex editor, will be 0xEF 0xBB 0xBF .

--
Craig Ringer

Re: re-install postgres/postGIS without Loosing data??

From
"G. P."
Date:
can I download from somewhere "clean" pg_hba.conf / postgresql.conf with default values, just to ensure that the failure is caused by them ?
 

From: Craig Ringer <craig@postnewspapers.com.au>
To: Thierry Hauchard <gesteam_l4d@gesteam.fr>
Cc: pgsql-general@postgresql.org
Sent: Wed, May 18, 2011 12:46:11 PM
Subject: Re: [GENERAL] re-install postgres/postGIS without Loosing data??

On 05/18/2011 03:46 PM, Thierry Hauchard wrote:
> Hi,
>
> We experienced similar problem : it was just the encoding of pg_hba.conf
> that was accidentally changed when modifying it (UTF8/ansi)

The encoding should not matter unless there are characters above byte 128, because UTF-8 and the ANSI encoding are the same from 0-127.

I guess it's possible that Pg chokes if it finds a byte-order mark (BOM) at the start of pg_hba.conf; I haven't tested this. A BOM is optional for UTF-8 text but some text editors do add it, and I've run into software that chokes on a BOM before. Many editors do assume unknown text is UTF-8 if they can't identify it as some other known encoding, and some would add a BOM on saving in this case.

If there is a byte order mark (BOM) you'll be able to tell because the first three bytes of pg_hba.conf or postgresql.conf , when examined in a hex editor, will be 0xEF 0xBB 0xBF .

--
Craig Ringer

-- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: re-install postgres/postGIS without Loosing data??

From
John R Pierce
Date:
On 05/18/11 4:31 AM, G. P. wrote:
> can I download from somewhere "clean" pg_hba.conf / postgresql.conf
> with default values, just to ensure that the failure is caused by them ?

those files are created by initdb

just run initdb on a scratch directory



Re: re-install postgres/postGIS without Loosing data??

From
"G. P."
Date:

Finally i re-installed PostgreSQL & everything seems to be OK!


From: John R Pierce <pierce@hogranch.com>
To: pgsql-general@postgresql.org
Sent: Wed, May 18, 2011 5:34:05 PM
Subject: Re: [GENERAL] re-install postgres/postGIS without Loosing data??

On 05/18/11 4:31 AM, G. P. wrote:
> can I download from somewhere "clean" pg_hba.conf / postgresql.conf with default values, just to ensure that the failure is caused by them ?

those files are created by initdb

just run initdb on a scratch directory



-- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: re-install postgres/postGIS without Loosing data??

From
Craig Ringer
Date:
On 05/18/2011 07:31 PM, G. P. wrote:
> can I download from somewhere "clean" pg_hba.conf / postgresql.conf with
> default values, just to ensure that the failure is caused by them ?

AFAIK they're generated by the installer, as they contain paths specific
to your installation. So not really.

It sounds like you might want to try to start Pg using pg_ctl via
runas.exe to run it as the postgres user account and see what error(s)
are produced.

See: http://technet.microsoft.com/en-us/library/bb490994.aspx

--
Craig Ringer