Re: [SQL] Permission on insert rules

2002-11-13 Thread Bruno Wolff III
On Wed, Nov 13, 2002 at 10:44:19 +, Luis Sousa <[EMAIL PROTECTED]> wrote: > > I have a table, whose primary key is a serial, that is connected to a > few tables. In this view, I want to insert data, in the main table, and > also in the "child" tables. My idea was to create a rule, that fi

Re: [SQL] Permission on insert rules

2002-11-13 Thread Josh Berkus
Luis, > There's any way to insert data inside the tables, using the > functions, called by the rules, without giving direct access to the > user ? > I don't know, using a trigger or any kind of structure !!?? Not until 7.3. Which is due out soon ... a couple of weeks, likely. -Josh Berkus

Re: [SQL] Permission on insert rules

2002-11-13 Thread Luis Sousa
Tom Lane wrote: Luis Sousa <[EMAIL PROTECTED]> writes: When inserting, using the rule, the insert that's defined on the rule works fine, but the insert defined inside the function, doesn't (that's the one that gives permssion denied). Right. As of 7.3 you can fix this by making the fu

Re: [SQL] Permission on insert rules

2002-11-13 Thread Luis Sousa
Hi again, I already know what's the problem. Actually, everything works fine in the example posted by Robert. Part of my rule is as simple as that example, but I'm also calling functions inside the rule. I have a table, whose primary key is a serial, that is connected to a few tables. In this v

Re: [SQL] Permission on insert rules

2002-11-12 Thread Robert Treat
This should be a test case for what Luis wants, although it works in 7.2.1 so maybe not. Luis, if this isn't what your trying to do, you'll need to post some code: create table parent (id int, name text, misc text); create view child as select id,name from parent; create rule jammasterjay as on

Re: [SQL] Permission on insert rules

2002-11-12 Thread Josh Berkus
Luis, > That's what I already made. The problem is when I do the update, I > permission denied in all the tables for update and insert. The user > that's making this operation only have select privilege. > Any way, I'm using version 7.2.1-2 for debian. I can't reproduce the problem, and permissio

Re: [SQL] Permission on insert rules

2002-11-12 Thread Luis Sousa
Josh Berkus wrote: Luis, Just a question. I'm writing some rules to insert/update some data in my database, and I gave all the privileges on that view to the user, and only select on the tables. When that user inserts data using the view, I thought that was user postgres that will do the r

Re: [SQL] Permission on insert rules

2002-11-12 Thread Luis Sousa
Robert Treat wrote: On Fri, 2002-11-08 at 21:40, Bruce Momjian wrote: Josh Berkus wrote: Luis, Just a question. I'm writing some rules to insert/update some data in my database, and I gave all the privileges on that view to the user, and only select on the tables. When that user

Re: [SQL] Permission on insert rules

2002-11-12 Thread Luis Sousa
Bruce Momjian wrote: Josh Berkus wrote: Luis, Just a question. I'm writing some rules to insert/update some data in my database, and I gave all the privileges on that view to the user, and only select on the tables. When that user inserts data using the view, I thought that was user p

Re: [SQL] Permission on insert rules

2002-11-11 Thread Josh Berkus
Luis, > Just a question. > I'm writing some rules to insert/update some data in my database, and I > gave all the privileges on that view to the user, and only select on the > tables. > When that user inserts data using the view, I thought that was user > postgres that will do the rest ! But I

Re: [SQL] Permission on insert rules

2002-11-11 Thread Josh Berkus
Robert, > If the functions can fire as there creator instead of there caller, > then > I would think as long as the creator has insert/update views on the > base > table, you should be able to do updateable rules and give only > permissions to the view for the caller. (Though maybe you have to use

Re: [SQL] Permission on insert rules

2002-11-11 Thread Robert Treat
On Fri, 2002-11-08 at 21:40, Bruce Momjian wrote: > Josh Berkus wrote: > > > > Luis, > > > > > Just a question. > > > I'm writing some rules to insert/update some data in my database, and I > > > gave all the privileges on that view to the user, and only select on the > > > tables. > > > When t

Re: [SQL] Permission on insert rules

2002-11-08 Thread Bruce Momjian
Josh Berkus wrote: > > Luis, > > > Just a question. > > I'm writing some rules to insert/update some data in my database, and I > > gave all the privileges on that view to the user, and only select on the > > tables. > > When that user inserts data using the view, I thought that was user > > p

Re: [SQL] Permission on insert rules

2002-11-08 Thread Josh Berkus
Luis, > Just a question. > I'm writing some rules to insert/update some data in my database, and I > gave all the privileges on that view to the user, and only select on the > tables. > When that user inserts data using the view, I thought that was user > postgres that will do the rest ! But I

[SQL] Permission on insert rules

2002-11-08 Thread Luis Sousa
Hello everybody, Just a question. I'm writing some rules to insert/update some data in my database, and I gave all the privileges on that view to the user, and only select on the tables. When that user inserts data using the view, I thought that was user postgres that will do the rest ! But I g