473,406 Members | 2,369 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,406 software developers and data experts.

row level grants

Is there any way to grant user access at the row level? Or maybe some
way to simulate it?

Alex
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #1
5 1345
Alexander Cohen wrote:
Is there any way to grant user access at the row level? Or maybe some
way to simulate it?
If you can write a query to will return only the rows you want the user
to see, you can write a view that returns those rows and grant rights to
that view.

J

Alex
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
Alexander Cohen wrote:
Is there any way to grant user access at the row level? Or maybe some
way to simulate it?


There is no built-in way to do this, at least not currently.

I wrote an article that might get you going in the right direction,
available here:

http://www.onlamp.com/pub/a/onlamp/2...xtensions.html

The functions I refer to in the article are custom C functions -- I'll
be posting the source code on my website (www.joeconway.com) sometime
after OSCON is over in a few weeks. In the meantime maybe you can use
the concepts as a starting point.

HTH,

Joe

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #3
On Thu, Jul 01, 2004 at 17:09:23 -0400,
Alexander Cohen <al**@toomuchspace.com> wrote:
Is there any way to grant user access at the row level? Or maybe some
way to simulate it?


You can do this with views. You need something in each row that will
allow you to tell which users have access to a row and check that
against current_user in the view. If there is more than one user
per row, then you might need to join the table to another table
that maps users to groups.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #4
> Is there any way to grant user access at the row level? Or maybe some
way to simulate it?

Think about using views. Examples are in the list archive.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #5
Bruno Wolff III <br***@wolff.to> writes:
Alexander Cohen <al**@toomuchspace.com> wrote:
Is there any way to grant user access at the row level? Or maybe some
way to simulate it?
You can do this with views. You need something in each row that will
allow you to tell which users have access to a row and check that
against current_user in the view.


There are working examples of this in the standard distribution.
Take a look at the pg_stats view and the information_schema views.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sohail Hasan | last post by:
Hi All, I want to bring back my mysql original database as well as root GRANTS as was during the installation because i installed an application that modified my root GRANTS and now I am not...
1
by: mike | last post by:
best regards: What is the difference between DOM Level 1 and DOM Level 2. Thank you. May god be with you.
6
by: GrispernMix | last post by:
//ques and and level order traversal file name: lab6_build_leaf_up.cpp Instructions:
7
by: GrispernMix | last post by:
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <conio.h> #include <iostream> #include <string.h> using namespace std; #define TRUE 1 #define FALSE 0
1
by: Miguel | last post by:
Hello, I have a vb.net application that can create and copy files to a server. The problem comes when I put all that code in a Service but there is no way to access the server. Does anybody know...
1
by: Ruth413 | last post by:
Hello - I am getting the these errors in my sql 2005 generated script. I am stuck with first error. Please help.... Msg 102, Level 15, State 1, Line 3 Incorrect syntax near '('. Msg 319,...
1
by: Mark D Powell | last post by:
Using SQL Server 2000 I need to extract all the grants made to a user created role so that I can recreate the role in another version of a database and there are more grants than I want to do by...
0
OraMaster
by: OraMaster | last post by:
Why grants assigned via roles do not work in named PL/SQL (despite working in anonymous PL/SQL)? Does anyone have explaination for this.
6
by: gskbond | last post by:
Following is my logic to traverse level by level an mway search tree.... (Yeah I finally used templates to implement a queue... :) ) void mWayTree:: TraverseLevelOrder(Node *root,int lvl) {...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...

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.