0

Some of you MAY be able to crack a really tough nut...

I have to move all the data from a PostgreSQL (9.1 - Windows) database to SQL Server because the company I am contracting with is upgrading the old program with a newer .NET version.

The real nut is that the User/Password for Postgres are baked in the old program... Of course the guy who wrote it is gone. No source code or any way to contact him. (Smaaaart)

I was able to obtain the WHOLE Postgres directory (Bin, Data... The whole thing) and I hope it can be done.

Is there a way out of this mess, or should I just blow the contract and look for something else?

THANK YOU!

marc_s
  • 8,613
  • 6
  • 43
  • 51
  • What does 'baked' mean? It's hardcoded and then compiled into a binary? How does the lost password issue affect the migration? – dezso Mar 03 '15 at 07:53
  • Correct. User and Password are hardcoded in a compiled program, and the company doesn't have any documentation. Problem is that I'm not all that familiar with Postgres, and I have no clue about how to recover the data, if at all possible. Looks like Postgres definitely wants User/Pass to let me do anything with the data... You think I should just walk away? – Piero Giorgi Mar 03 '15 at 08:49
  • If you have access to the server, read into http://dba.stackexchange.com/questions/19643/how-do-i-reset-the-postgres-password-for-postgresql-on-windows – dezso Mar 03 '15 at 09:36

1 Answers1

1

I think currently you are not able to log into the postgresql database? If this is the case you can get access of the database by changing the access authorization. Please open pg_hba.conf and change the following line:

local   all             postgres                                md5

to:

local   all             postgres                                peer

or

local   all             postgres                                trust

Now restart the postgresql service. You should now be able to connect to the database by typing: psql

You can get list of databases by typing: psql -l

user2436428
  • 163
  • 6
  • 1
    I'd love to vote up your answer (Changing md5 to trust in pg_hba was perfect), but it requires 15 points of reputation... :-) Thank you, though, besides the fact that I'm a complete noob with Postgres, your answer was exactly to the point. – Piero Giorgi Mar 20 '15 at 02:10