Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed two versions of Postgresql, 8.4 and 9.1. When I try to run psql it only picks up the previous psql version. For example, when I run the following line to connect to the database, ax_data:

C:\Program Files (x86)\PostgreSQL\9.1\bin>psql ax_data
Password:
psql (9.1.2, server 8.4.8)
WARNING: psql version 9.1, server version 8.4.
         Some psql features might not work.
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

ax_data=

It is not finding the more recent psql installation. When using pgAdmin, if I click on psql a small command window pops up, but when I type commands in nothing is happening. I'm not very experienced with Postgresql so I could have made some basic mistake somewhere along the way. Any thoughts on what I could be doing wrong?


EDIT:

I am able to login using:

C:\>C:\"Program Files (x86)"\PostgreSQL\9.1\bin\psql.exe -p 5434 -U postgres
psql (9.1.2)
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

postgres=# LS
postgres-#

but none of the commands seem to work. For example, whenever I type anything in after the prompt, there is no response.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

If you have both versions installed, you can not run both servers at the same time on the same port. So, you can differentiate between the servers by running them on two different ports or by running one at a time.

To differentiate between the two clients, you can simply refer to the client using the full path name.

share|improve this answer
    
Both servers run on different ports (8.4 on 5432 and 9.1 on 5434). Should I be specifying the port number when running psql? –  celenius Dec 27 '11 at 18:59
    
Yes, sure. I use '-p' to choose different port. –  Khaled Dec 27 '11 at 19:02
    
Thanks for your help @Khaled, I am now able to login, but psql does not appear to be working. Not sure if there is something else that I need to do (I updated my question with a brief description). –  celenius Dec 27 '11 at 19:51

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.