473,413 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

How to restrict a user to access a specific database?

We are trying to switch from Oracle 10g to Postgre but I am having few technical issues which I am listing here and I hope someone can help.

Server Status:
- I am installing “postgresql-9.0.2-1-windows.exe” package on Windows Server 2003 SP2 with 2 LAN Cards
- The server is part of a domain and I am installing using the Administrator login
- Before installation we have removed completely the AV software

Installation:
- We have chose the following directories during installation:
D:\PostgreSQL\9.0
D:\PostgreSQL\9.0\data
- The PG user was created in the domain users with a pw that was accepted
- During installation, The locale is English, United States and not to [Default locale]
- During installation, starting the database server, this error shows
Warning: Problem running post-install step. Installation may not complete correctly
Failed to start the database server.
I clicked OK and continue
- After installation completion, the service "postgresql-9.0 - PostgreSQL Server 9.0" will fail. It is setup to start Automatically
Services: could not start the postgresql-9.0 service on Local Computer.
Error 1069: The service did not start due to a login failure.
- When checking the service login, I found out the user to be .\postgres so browse for it in the domain and changed it to DOMAIN_NAME\postgres, re-start the service it worked

Configuration Problems:
1. In postgresql.conf file when I changed the listen address to one of my LAN card to channel all traffic through it by doing: listen_addresses = '192.168.1.212' instead of listen_addresses = '*', re-starting the service will not work, changing the entry back and re-starting the service will not work, changing the entry back and re-start the whole server will work and the service will start

2. In pg_hba.conf I have the following entries:
host all all 127.0.0.1/32 md5
host all all 192.168.1.211/32 md5
host all all 192.168.1.212/32 md5
host all all 192.168.1.4/32 md5

using PGAdmin from the server itself, I created 2 New login Role “1” and “2” , 2 Tablespace “1” and “2” as this
D:\tablespace\1
D:\tablespace\2
which is next to the PG directory D:\PostgreSQL
and had to gave permission to the user: DOMAIN_NAME\postgres to D:\tablespace directory
then created the database “1” and “2” with the prospective user as owner and the tablespace

Logging from the remote machine with IP: 192.168.1.4 using the user 1, I can see both 1 and 2 dbs
however when I changed the pg_hba.conf to
host 1 all 192.168.1.4/32 md5
restarting the service, I can’t login at all. This entry does not work

however; these entries will work:
host all all 192.168.1.4/32 md5
host all 1 192.168.1.4/32 md5
But still can see all the dbs
I need to have each user sees its own DB, how can I do that
Feb 9 '11 #1
2 11265
rski
700 Expert 512MB
I need to have each user sees its own DB, how can I do that
If you want each user sees only its own database that would hard to do, because all database info are stored in pg_catalog 'schema' visible to all.
If you want each user to be able to connect only to its own database you can revoke from him CONNECT privilege for the other databases
Expand|Select|Wrap|Line Numbers
  1. REVOKE CONNECT ON DATABASE <db> FROM <user>;
  2.  
Feb 9 '11 #2
Thank you rski,

the second problem has been solved, but what about the problem number 1

thanks.
Feb 14 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: arabub | last post by:
I have an installation of Apache that apparently includes PHP (out of the box Redhat 9.0). If I make database calls to Postgresql, as what user is that call going to be made? The user that...
5
by: Jay McGrath | last post by:
Does anyone know if it is possible to prevent a user from accessing the tables in an MDE file? I can go to my start-up menu and limit access to various functions, etc. I could even disable the...
3
by: Annette Massie | last post by:
I have a database that contains complaint information in regards to Law Enforcement. They need to have this database secure and out of reach for all but two users. (including me, they say). In...
3
by: Chris Williamson | last post by:
Hi, Currently I am working on a Visual Basic program that makes use of an Access database produced under Japanese Access '97. The program works correctly on Windows 2000, however when it is...
4
by: jwa6 | last post by:
I have a user/pc specific problem in access. This doesn't occur on any other ( windows xp pc) that I have used the ..mbd on. This involves a query that's using a range of dates as a parm. This...
2
by: Smriti Dev | last post by:
Hi, I wanted find out if it is possible to have many users access an access database and add records using forms. I'm worried their might be data corruption. I will have about 5 users using the...
2
by: HSD | last post by:
database not allowing multiusers -------------------------------------------------------------------------------- Background An ACCESS database containing two tables and three forms has been...
1
by: Kyrierat | last post by:
Hi All, This seems a silly question as most people ask the opposite, but is it possible to restrict an Access database so only one person can use it at a time (a bit like other office documents...
1
by: Mubs | last post by:
Hi PPL, On my website i have setup user log in. once they log in i want to restrict certain users from certain pages.. and on some pages i want the user to enter their username and password...
2
by: osman7king | last post by:
when I create a user "user1" and give this user the permissions on a database "db1" (including login privilage), this user can access all databases although it doesn't have the privilges (even after...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.