Re: [GENERAL] Update rule on a view - what am I doing wrong

2013-01-22 Thread Leif Jensen
Hi Marc, Thanks a lot. That works fine. The names 'NEW' and 'OLD' works fine. Leif - "Marc Schablewski" wrote: > Hi Leif, > > Am 22.01.2013 14:34, schrieb Leif Jensen: > > > CREATE update_rule_func( old record, new record ) AS ... I am told, > that I cannot use record for the

Re: [GENERAL] Update rule on a view - what am I doing wrong

2013-01-22 Thread Marc Schablewski
Hi Leif, Am 22.01.2013 14:34, schrieb Leif Jensen: > CREATE update_rule_func( old record, new record ) AS ... I am told, that I > cannot use record for the parameter type. Could you please You should use your view instead of 'record' as parameter type, i.e. CREATE update_rule_func( old V_YOUR

Re: [GENERAL] Update rule on a view - what am I doing wrong

2013-01-22 Thread Leif Jensen
Hi Jasen. Thank you for your response (also thank you to Tom). I have now tried your suggestion, but I'm not sure how you have implemented the plpgsql function. When I create the function: CREATE update_rule_func( old record, new record ) AS ... I am told, that I cannot use record for

Re: [GENERAL] Update rule on a view - what am I doing wrong

2013-01-18 Thread Jasen Betts
On 2013-01-18, Leif Jensen wrote: >I have been fighting a problem with an update rule on a view. I > have a view that combines two tables where the 'sub' table (scont) can > have several rows per row in the 'top' table (icont). The view > combines these to show only one record per row in the

Re: [GENERAL] Update rule on a view - what am I doing wrong

2013-01-18 Thread Tom Lane
Leif Jensen writes: >I have been fighting a problem with an update rule on a view. I have a > view that combines two tables where the 'sub' table (scont) can have several > rows per row in the 'top' table (icont). The view combines these to show only > one record per row in the top table. T

[GENERAL] Update rule on a view - what am I doing wrong

2013-01-18 Thread Leif Jensen
Hello, I have been fighting a problem with an update rule on a view. I have a view that combines two tables where the 'sub' table (scont) can have several rows per row in the 'top' table (icont). The view combines these to show only one record per row in the top table. To be able to updat

[GENERAL] RE: [GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails the WHERE predicate ?‏

2012-09-06 Thread John Lumby
> Date: Mon, 3 Sep 2012 09:31:21 +0100 > Subject: Re: [GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails > the WHERE predicate ?‏ > From: dean.a.rash...@gmail.com > To: johnlu...@hotmail.com > CC: pgsql-general@postgresq

[GENERAL] Re: [GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails the WHERE predicate ?‏

2012-09-03 Thread Dean Rasheed
On 2 September 2012 22:42, johnlumby wrote: > On 09/01/12 03:46, Dean Rasheed wrote: >> What you are trying to do cannot be achieved rules, and doing it this >> way with triggers is likely to be messy. I think you need to consider >> a different approach. >> >> It sounds like what you really want

[GENERAL] RE: [GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails the WHERE predicate ?‏

2012-09-02 Thread johnlumby
On 09/01/12 03:46, Dean Rasheed wrote: On 31 August 2012 16:32, John Lumby wrote: ___ From: pavan.deola...@gmail.com Date: Fri, 31 Aug 2012 11:09:42 +0530 Subject: Re: [GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails the WHERE predicate ?‏ On Thu

[GENERAL] Re: [GENERAL] RE: [GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails the WHERE predicate ?‏

2012-09-01 Thread Dean Rasheed
On 31 August 2012 16:32, John Lumby wrote: > > ___ >> From: pavan.deola...@gmail.com >> Date: Fri, 31 Aug 2012 11:09:42 +0530 >> Subject: Re: [GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails >> the WHERE predicate ?‏ >>

[GENERAL] RE: [GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails the WHERE predicate ?‏

2012-08-31 Thread John Lumby
___ > From: pavan.deola...@gmail.com > Date: Fri, 31 Aug 2012 11:09:42 +0530 > Subject: Re: [GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails > the WHERE predicate ?‏ > > On Thu, Aug 30, 2012 at 6:31 PM, John Lumby > mailto:

[GENERAL] Re: [GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails the WHERE predicate ?‏

2012-08-30 Thread Pavan Deolasee
On Thu, Aug 30, 2012 at 6:31 PM, John Lumby wrote: > > I would like to use an UPDATE RULE to modify the action performed > when any UPDATE is attempted on a certain table, > *including* an UPDATE which would fail because of no rows matching the > WHERE. > > Is this at all possible?I have trie

[GENERAL] UPDATE RULE to be invoked when UPDATE .. WHERE fails the WHERE predicate ?‏

2012-08-30 Thread John Lumby
I would like to use an UPDATE RULE to modify the action performed when any UPDATE is attempted on a certain table, *including* an UPDATE which would fail because of no rows matching the WHERE. Is this at all possible?    I have tried with variations of ALSO|INSTEAD etc but the RULE is never inv

Re: [GENERAL] Update rule

2004-12-31 Thread Secrétariat
déric Caillaud" <[EMAIL PROTECTED]> To: "Secrétariat" <[EMAIL PROTECTED]>; Sent: Thursday, December 30, 2004 7:08 PM Subject: Re: [GENERAL] Update rule You get infinite recursion because your ON UPDATE rule does another UPDATE which of course calls the rule ; so no, it

Re: [GENERAL] Update rule

2004-12-30 Thread Pierre-Frédéric Caillaud
You get infinite recursion because your ON UPDATE rule does another UPDATE which of course calls the rule ; so no, it's not a bug ; also your UPDATE updates almost the whole table so it won't do what you had in mind in the first place. You should rather change the NEW row in your update so

[GENERAL] Update rule

2004-12-30 Thread Secrétariat
Hello !   I wish to create a rule to write in records who and when modified them. I wrote : CREATE OR REPLACE RULE tarif_upd AS   ON UPDATE TO tarifs   DO ALSO   UPDATE tarifs    SET dmodtar = current_date, umodtar = current_user  WHERE dmodtar <> current_date AND umodtar