Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am brand new at this so maybe it's a simple mistake. I was given a very large .sql file with the instructions to make a copy of a database locally on a computer. I was told "to be able to install the database you need to install postgres. Use pgAdmin to create a table called reports with UTF8 encoding".

pgAdmin III always tells me the server is not listening. Postgres is not showing up anywhere in the services in administrative tools. Whenever I install or uninstall Postgres 9.1 or 9.2 I get errors. When I uninstall I get "Error stopping service postgresql-x64-9.2", "Error deleting service postgresql-x64-9.2", "The data directory (C:\Program Files\PostgreSQL\9.2\data) and service user account (NT AUTHORITY\NetworkService) has not been removed".

telling me it's not listening

I was advised to login to the postgres account, however none appears at the login screen. If I try to create an account named postgres I get a bogus error message (see picture) it won't let me create an account named postgres

I was advised to type this into the command line: command prompt

When installing I get this error: enter image description here

share|improve this question
    
Did you use the one-click installer provided by enterprisedb or some other method to install postgresql? When an error occurs with the one click installer a log is written in %TEMP%. –  Eelke Oct 20 '12 at 12:22
    
To see all user accounts on a windows machine go to Control Panel > Administrative Tools > Computer Management. In the tree on the left go to System Tools > Local Users and Groups > Users –  Eelke Oct 20 '12 at 12:24
    
@Eelke is see the account postgres there! The install-postgersql.log is quite lengthy, was there something in particular you wanted from it? –  Celeritas Oct 21 '12 at 1:41
    
You shouldn't need to re-initdb, so I'm a bit ... surprised ... by that advice. Unless you did it with runas to do it as the postgres user, it'll muck up the cluster permissions and likely cause the server to fail to start. –  Craig Ringer Oct 21 '12 at 6:45
    
So how do I login to the postgres account? It's not on the start up screen. @CraigRinger what you said is over my head. –  Celeritas Oct 21 '12 at 11:08

2 Answers 2

up vote 3 down vote accepted

Since you installed multiple versions of PostgreSQL, there is a good chance your cluster is running on a different port than 5432. Additional clusters automatically use the next free port unless instructed otherwise. Like 5433, 5434 etc.

Check your setting in postgresql.conf to find out and connect to the proper port. postgresql.conf is usually installed in your data directory, which in turn is defined in pg_env.bat, usually located here

C:\Program Files\PostgreSQL\<version>\pg_env.bat

Default location of the data directory:

C:\Program Files\PostgreSQL\<version>\data\postgresql.conf

Where <version> is 9.1 or 9.2 in your case.
Base directory varies according to your version of Windows.

Obviously initdb fails to create a database cluster. Read the chapter in the manual to get a grip on initdb. Maybe a problem with missing privileges?

Here is a closely related question with a solution.

share|improve this answer
    
I don't think I have that file. Where would it be? My install directory is C:\Program Files\PostgreSQL\9.1 –  Celeritas Oct 19 '12 at 20:42
    
@Celeritas: I added a bit to the answer. –  Erwin Brandstetter Oct 19 '12 at 20:53
    
My data folder is empty and I can't find pg_env.bat –  Celeritas Oct 19 '12 at 20:56
    
@Celeritas: That would indicate that you did not, in fact, successfully install PostgreSQL. At least not the last step of creating a database cluster. –  Erwin Brandstetter Oct 19 '12 at 21:19
1  
@ErwinBrandstetter please have a look at the conversation on this at chat.stackexchange.com/rooms/6169/… Obviously, there are steps which proved useless (but before installing 9.1, the OP uninstalled 9.2) –  dezso Oct 20 '12 at 8:35

I know the one-click installer breaks (or used to break) with passwords that have an ampersand in them.

It's part of some shell that doesn't go through. It gives errors like the ones you saw.

share|improve this answer
    
How does your answer answers the question? –  altmannmarcelo May 21 '13 at 8:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.