POSTGRE TCP/IP REMOTE CONNECTION

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

POSTGRE TCP/IP REMOTE CONNECTION

Postby ifckladyluck » Sat Apr 17, 2010 5:32 pm

I am trying to remotely connect to a postgre server, but i cant seem to get it to work.

I have done the following:
added the line host all all 0.0.0.0/0 md5 into pg_hba.conf
added the line listen_addresses = '*' into postgresql.conf

when i try to browse databases through the pockertracker3 Configure PostgreSQL Database Window I type the computers IP address into the SERVER field.
It will work on the host computer, but will not work on the remote computer.

Any ideas?
ifckladyluck
 
Posts: 12
Joined: Sat May 10, 2008 2:01 pm

Re: POSTGRE TCP/IP REMOTE CONNECTION

Postby ifckladyluck » Sun Apr 18, 2010 12:48 am

seems it was simply a windows firewall issue, and turning it off resolved all of my problems. hope this helps anyone else thats trying to establish a similar setup.

as a side note. does anyone with any experience with postgre know how to setup a role that can only view a particular database? in other words, any other database is not only not accessable, but also not visible.
ifckladyluck
 
Posts: 12
Joined: Sat May 10, 2008 2:01 pm

Re: POSTGRE TCP/IP REMOTE CONNECTION

Postby WhiteRider » Sun Apr 18, 2010 5:23 am

Thanks for the update - I'll see if I can get one of our PostgreSQL experts to take a look at this thread.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: POSTGRE TCP/IP REMOTE CONNECTION

Postby kraada » Sun Apr 18, 2010 8:46 am

You can create a role with various privileges using the CREATE ROLE command, but I think for what you want you'll also need to use GRANT and REVOKE. The easiest way to do what you want is probably to create a role with minimal privileges, but that can login. Then revoke its ability to connect to all databases and explicitly grant whichever privileges you would like for the one database in question (obviously you'd want connect, probably insert and update, beyond that it depends what you want) - easiest would probably be to grant all privileges on that specific database only though again it depends on your needs.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: POSTGRE TCP/IP REMOTE CONNECTION

Postby ifckladyluck » Sun Apr 18, 2010 3:18 pm

is there a way to do this through pgadmin?
ifckladyluck
 
Posts: 12
Joined: Sat May 10, 2008 2:01 pm

Re: POSTGRE TCP/IP REMOTE CONNECTION

Postby WhiteRider » Sun Apr 18, 2010 5:01 pm

You can probably run those commands in PGAdmin, yes. I'll get Kraada to look at this thread again, but I suspect it will be tomorrow now before he sees it.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: POSTGRE TCP/IP REMOTE CONNECTION

Postby kraada » Mon Apr 19, 2010 8:42 am

You can run that SQL through PGAdmin by clicking the little notepad with SQL on it and the pencil at the top and typing it all in. Note that you need to be connected to a database (so highlight some database or another to see the button become clickable).

Another option is to right click on the server (so something like localhost (127.0.0.1) that has the grey server box next to it) and click New Object and choose the type of role you want to add. It gives you something of a wizard-esque set of options to choose from, so you can do it that way if you prefer, but I don't have much more experience with it other than knowing that it's there for those who prefer it.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 3 guests