Re: [HACKERS] insert/update/delete returning and rules

2006-09-04 Thread Zeugswetter Andreas DCP SD
> With this approach, you still have to update your rules if > you want to support RETURNING on your views --- but if you > don't update them, you don't have a security hole. Basically > the standard setup for an updatable view would use > "ON INSERT DO INSTEAD INSERT INTO ... RETURNING

Re: [HACKERS] insert/update/delete returning and rules

2006-09-01 Thread Tom Lane
I wrote: > After some further thought, I think we could make it work if we treat > XXX RETURNING as a distinct rule event type and make the following > restrictions (which are exactly analogous to the restrictions for ON > SELECT rules) for ON XXX RETURNING rules: After working on this for a bit,

Re: [HACKERS] insert/update/delete returning and rules

2006-09-01 Thread Tom Lane
"Jaime Casanova" <[EMAIL PROTECTED]> writes: > On 8/15/06, Tom Lane <[EMAIL PROTECTED]> wrote: >> I'm tempted to suggest that the RETURNING commands might need to be >> separate rule events, and that to support this you'd need to write >> an additional rule: >> >> CREATE RULE r1 AS ON INSERT RETUR

Re: [HACKERS] insert/update/delete returning and rules

2006-08-29 Thread Jaime Casanova
On 8/15/06, Tom Lane <[EMAIL PROTECTED]> wrote: I'm tempted to suggest that the RETURNING commands might need to be separate rule events, and that to support this you'd need to write an additional rule: CREATE RULE r1 AS ON INSERT RETURNING TO myview DO INSTEAD INSERT ...

Re: [HACKERS] insert/update/delete returning and rules

2006-08-17 Thread Jens-Wolfhard Schicke
--On Dienstag, August 15, 2006 16:33:27 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: I'm tempted to suggest that the RETURNING commands might need to be separate rule events, and that to support this you'd need to write an additional rule: CREATE RULE r1 AS ON INSERT RETURNING TO myview DO

Re: [HACKERS] insert/update/delete returning and rules

2006-08-15 Thread Jonah H. Harris
On 8/15/06, Tom Lane <[EMAIL PROTECTED]> wrote: But even this seems like it would fail in complicated cases. What if the view is a join, and your ON INSERT rule inserts into two different underlying tables in two commands? If you need fields from both tables to generate a full RETURNING list th

Re: [HACKERS] insert/update/delete returning and rules

2006-08-15 Thread Tom Lane
"Jaime Casanova" <[EMAIL PROTECTED]> writes: > On 8/15/06, Tom Lane <[EMAIL PROTECTED]> wrote: >> What are you testing exactly? I think this recent fix might be >> relevant: >> http://archives.postgresql.org/pgsql-committers/2006-08/msg00299.php > i have tested again against current HEAD... what

Re: [HACKERS] insert/update/delete returning and rules

2006-08-15 Thread Jaime Casanova
On 8/15/06, Tom Lane <[EMAIL PROTECTED]> wrote: "Jaime Casanova" <[EMAIL PROTECTED]> writes: > I'm doing some tests of Bernd's updatable views patch and found > something interesting about the RETURNING behavior > ... > but if i insert using the rules the returning clause is ignored > testing_uv=

Re: [HACKERS] insert/update/delete returning and rules

2006-08-15 Thread Tom Lane
"Jaime Casanova" <[EMAIL PROTECTED]> writes: > I'm doing some tests of Bernd's updatable views patch and found > something interesting about the RETURNING behavior > ... > but if i insert using the rules the returning clause is ignored > testing_uv=# insert into v_bar values (3), (4) returning *; >

[HACKERS] insert/update/delete returning and rules

2006-08-15 Thread Jaime Casanova
Hi, I'm doing some tests of Bernd's updatable views patch and found something interesting about the RETURNING behavior testing_uv=# create table bar (field1 integer); CREATE TABLE testing_uv=# create view v_bar as select * from bar; CREATE VIEW the rules are created as: "_DELETE" AS ON DELE