Re: Help me please... - Mailing list pgsql-general

From John R Pierce
Subject Re: Help me please...
Date
Msg-id 4A565C24.90807@hogranch.com
Whole thread Raw
In response to Re: Help me please...  (<jacob@aers.ca>)
List pgsql-general
jacob@aers.ca wrote:
>
> if you used default locations I believe it should be (this is from
> memory mind) under c:\program files\postgres\<version>\data\
>
>
>
> data is the folder you want.
>
>
>

First, verify the location of pgdata...

    sc qc pgsql-8.3

(I'm assuming this is 8.3, modify for other versions)
note the value of the -D parameter on the BINARY_PATH_NAME, like...

        BINARY_PATH_NAME   : D:\postgres\8.3\bin\pg_ctl.exe runservice
-w -N "pgsql-8.3" -D "D:\postgres\8.3\data\"

hence, mine is D:\postgres\8.3\data\

If you've reinstalled postgres from scratch, you'll likely have to do a
bit of dinking around.

First,

    NET STOP pgsql-8.3

Now, MOVE the current data dir somewhere safe, and COPY/S your backup of
the DATA directory to the active location.   Then, use the 'security'
dialog in file explorer, or the CACL command line, to grant the
'postgres' user full control over the data directory and all files in it.

command line version:

    cacls /t /e /c /g postgres:f \path\to\data

if this postgres user already existed from before, but the reinstalled
postgres service is having problems starting, you may need to reset the
service account password.    pick a random forgettable password.   I'm
going to use shattUp373treHodhu (random generator output)...

    NET USER postgres shattUp373treHodhu
    SC CONFIG pgsql-8.3 password= shattUp373treHodhu

upper case doesn't matter in the commands except for the password itself
but the spacing around the password=  is critical (none before the =,
one space after)

then try

    net start pgsql-8.3

and with any luck, your data is all intact.

its absolutely critical if you've reinstalled postgres that you install
the same version as you used before.





pgsql-general by date:

Previous
From:
Date:
Subject: Re: Help me please...
Next
From: Tom Lane
Date:
Subject: Re: Postgres 8.4 literal escaping