Thread: Remote Access to pgsql DB ???
Hi, I have a question about remote access to Pgsql DB. I acctually want to access mydb which located on a Unix server called ORION from another Unix server called OMEGA. According to documentation I have to run postmaster on ORION with -i option like: /usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data & so I have done that, I also changed pg_hba.conf on ORION for OMEGA IP address like: host all 172.21.2.41 255.255.255.255 trust But still I can not run psql mydb from Omega: psql: connectDBStart() -- connect() failed: Connection refused Is the postmaster running locally and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'? Why should I get this error when I have run postmaster with -i on ORION? Shall I run that on OMEGA as well, then it's not a remote access?!!! I appreciate your help! Thanks in advance, Fariba
[2001-12-04 15:35] Fariba Noorbakhsh said: | Hi, | | I have a question about remote access to Pgsql DB. I acctually want to | access mydb which located on a Unix server called ORION from another | Unix server called OMEGA. | | According to documentation I have to run postmaster on ORION with -i | option like: | | /usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data & [snip] | But still I can not run psql mydb from Omega: You need to say "psql -h orion mydb" cheers brent -- "Develop your talent, man, and leave the world something. Records are really gifts from people. To think that an artist would love you enough to share his music with anyone is a beautiful thing." -- Duane Allman
On Tue, 2001-12-04 at 15:44, Brent Verner wrote: > [2001-12-04 15:35] Fariba Noorbakhsh said: > | Hi, > | > | I have a question about remote access to Pgsql DB. I acctually want to > | access mydb which located on a Unix server called ORION from another > | Unix server called OMEGA. > | > | According to documentation I have to run postmaster on ORION with -i > | option like: > | > | /usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data & > [snip] > | But still I can not run psql mydb from Omega: > > You need to say "psql -h orion mydb" An even better way is to SSH to the machine and run either psql or pgaccess over the secure connection. Cheers Tony Grant -- RedHat Linux on Sony Vaio C1XD/S http://www.animaproductions.com/linux2.html Macromedia UltraDev with PostgreSQL http://www.animaproductions.com/ultra.html
In article <3C0CDF34.CC972E7C@ccs-munich.de>, "Fariba Noorbakhsh" <fNoorbakhsh@tecways.com> wrote: > Hi, > > I have a question about remote access to Pgsql DB. I acctually want to > access mydb which located on a Unix server called ORION from another > Unix server called OMEGA. > > According to documentation I have to run postmaster on ORION with -i > option like: > > /usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data & > > so I have done that, I also changed pg_hba.conf on ORION for OMEGA > IP address like: > > host all 172.21.2.41 255.255.255.255 trust > > But still I can not run psql mydb from Omega: > > psql: connectDBStart() -- connect() failed: Connection refused > Is the postmaster running locally > and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'? > This suggests that psql is trying to connect to a local postmaster. The -h option to psql tells it which host to connect to. In your case: psql -h orion mydb should do what you want. Regards John -- John Gray Azuli IT http://www.azuli.co.uk +44 121 693 3397 jgray@azuli.co.uk
i don't know if you can use psql to connect to remote servers - in fact i think you can't. try connecting from omega using a tool such as pgaccess in xwindows and you should be fine or telnet or ssh onto the orion box from omega and run psql from there i use IVT-TELNET for this at work. Steve "Fariba Noorbakhsh" <fNoorbakhsh@tecways.com> wrote in message news:3C0CDF34.CC972E7C@ccs-munich.de... > Hi, > > I have a question about remote access to Pgsql DB. I acctually want to > access mydb which located on a Unix server called ORION from another > Unix server called OMEGA. > > According to documentation I have to run postmaster on ORION with -i > option like: > > /usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data & > > so I have done that, I also changed pg_hba.conf on ORION for OMEGA > IP address like: > > host all 172.21.2.41 255.255.255.255 trust > > But still I can not run psql mydb from Omega: > > psql: connectDBStart() -- connect() failed: Connection refused > Is the postmaster running locally > and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'? > > Why should I get this error when I have run postmaster with -i on ORION? > > Shall I run that on OMEGA as well, then it's not a remote access?!!! > > I appreciate your help! > > Thanks in advance, > Fariba > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
On Mon, Dec 10, 2001 at 01:01:46PM -0000, Steve Brett wrote: > i don't know if you can use psql to connect to remote servers - in fact i > think you can't. You can. -- Holger Krug hkrug@rationalizer.com
"Steve Brett" <steve.brett@e-mis.com> writes: > i don't know if you can use psql to connect to remote servers - in fact i > think you can't. Of course you can. $ psql -h <hostname> -p <port> -Doug -- Let us cross over the river, and rest under the shade of the trees. --T. J. Jackson, 1863
I think you can. I have a linux node named BETALIN and another linux node that has the database on it named ARCHER. I log into BETALIN and at the command prompt I run: psql databasename -U username --host=archer I also use pgadmin to access the database from a Windows machine (this uses ODBC) Make sure you have the ip's set correctly in pg_hba.conf -----Original Message----- From: Steve Brett [mailto:steve.brett@e-mis.com] Sent: Monday, December 10, 2001 8:02 AM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Remote Access to pgsql DB ??? i don't know if you can use psql to connect to remote servers - in fact i think you can't. try connecting from omega using a tool such as pgaccess in xwindows and you should be fine or telnet or ssh onto the orion box from omega and run psql from there i use IVT-TELNET for this at work. Steve "Fariba Noorbakhsh" <fNoorbakhsh@tecways.com> wrote in message news:3C0CDF34.CC972E7C@ccs-munich.de... > Hi, > > I have a question about remote access to Pgsql DB. I acctually want to > access mydb which located on a Unix server called ORION from another > Unix server called OMEGA. > > According to documentation I have to run postmaster on ORION with -i > option like: > > /usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data & > > so I have done that, I also changed pg_hba.conf on ORION for OMEGA > IP address like: > > host all 172.21.2.41 255.255.255.255 trust > > But still I can not run psql mydb from Omega: > > psql: connectDBStart() -- connect() failed: Connection refused > Is the postmaster running locally > and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'? > > Why should I get this error when I have run postmaster with -i on > ORION? > > Shall I run that on OMEGA as well, then it's not a remote access?!!! > > I appreciate your help! > > Thanks in advance, > Fariba > > > ---------------------------(end of > broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
You definitely can do a remote connect- I do all of my work this way, and it runs smoothly. In addition to Troy's suggestions you might also check to be sure the host DB is really running with -i set on it. You should be able to see the whole command line for the postmaster that is running with a "ps ax". It seems like quite a few folks have trouble with a startup script somewhere subverting their intentions. If you're on 7.1 or above, it is better to set tcpip_socket=1 in the postgresql.conf file. -Nick > -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Campano, Troy > Sent: Monday, December 10, 2001 12:11 PM > To: 'Steve Brett'; pgsql-general@postgresql.org > Cc: pgsql-general@postgresql.org; 'fNoorbakhsh@tecways.com' > Subject: Re: [GENERAL] Remote Access to pgsql DB ??? > > > > I think you can. > > > I have a linux node named BETALIN and another linux node that has the > database on it named ARCHER. > > > I log into BETALIN and at the command prompt I run: > > > psql databasename -U username --host=archer > > I also use pgadmin to access the database from a Windows machine > (this uses > ODBC) > > > Make sure you have the ip's set correctly in pg_hba.conf > > > -----Original Message----- > From: Steve Brett [mailto:steve.brett@e-mis.com] > Sent: Monday, December 10, 2001 8:02 AM > To: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Remote Access to pgsql DB ??? > > > i don't know if you can use psql to connect to remote servers - in fact i > think you can't. > > try connecting from omega using a tool such as pgaccess in > xwindows and you > should be fine or telnet or ssh onto the orion box from omega and run psql > from there i use IVT-TELNET for this at work. > > Steve > > "Fariba Noorbakhsh" <fNoorbakhsh@tecways.com> wrote in message > news:3C0CDF34.CC972E7C@ccs-munich.de... > > Hi, > > > > I have a question about remote access to Pgsql DB. I acctually want to > > access mydb which located on a Unix server called ORION from another > > Unix server called OMEGA. > > > > According to documentation I have to run postmaster on ORION with -i > > option like: > > > > /usr/local/pgsql/bin/postmaster -i -D /usr/local/pgsql/data & > > > > so I have done that, I also changed pg_hba.conf on ORION for OMEGA > > IP address like: > > > > host all 172.21.2.41 255.255.255.255 trust > > > > But still I can not run psql mydb from Omega: > > > > psql: connectDBStart() -- connect() failed: Connection refused > > Is the postmaster running locally > > and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'? > > > > Why should I get this error when I have run postmaster with -i on > > ORION? > > > > Shall I run that on OMEGA as well, then it's not a remote access?!!! > > > > I appreciate your help! > > > > Thanks in advance, > > Fariba > > > > > > ---------------------------(end of > > broadcast)--------------------------- > > TIP 2: you can get off all lists at once with the unregister command > > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >