Re: Trigger isn't fired
От | Együd Csaba |
---|---|
Тема | Re: Trigger isn't fired |
Дата | |
Msg-id | 016601c45c14$136a9570$230a0a0a@compaq обсуждение исходный текст |
Ответ на | Re: Trigger isn't fired (Stephan Szabo <sszabo@megazone.bigpanda.com>) |
Список | pgsql-general |
Hi Stephan, it was the problem, but not realy understand the reason. The documentetion sais that perform doesn't porvide the return value and I thought I do not need that. But I read absently, and didn't realized that the query to perform must be a SELECT. Thank you for opening my eyes. :) Now the trigger does its task. Thank you very much. Best regards, -- Csaba Együd > -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Stephan Szabo > Sent: 2004. június 26. 22:32 > To: Együd Csaba > Cc: Pgsql-General@Postgresql.Org (E-mail) > Subject: Re: [GENERAL] Trigger isn't fired > > > On Sat, 26 Jun 2004, [iso-8859-2] Együd Csaba wrote: > > > Hi, > > I created a trigger function and a trigger with that > function on a table. It > > is an "after insert or update or delete" trigger, in which > I want to modify > > a second table regardless of the current modifications. > > > > Everything seems to be good on modifying the table, no > error messages. After > > the modifications the second table isn't modified at all. > Should anybody > > suggest me what I'm doing wrong? Does a trigger functon > send error messages > > if it fails? > > > > My statements: > > -------------- > > CREATE OR REPLACE FUNCTION trg_upd_prod_instock() RETURNS > trigger AS ' > > BEGIN > > perform ''update t_products set > > > getup_instock=get_stock_getup(''||quote_literal(NEW.productid) > ||'',1) where > > id=''||quote_literal(NEW.productid); > > I don't think this is going to do what you want. Are you > sure you didn't > want EXECUTE rather than PERFORM? > > ---------------------------(end of > broadcast)--------------------------- > TIP 8: explain analyze is your friend > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.707 / Virus Database: 463 - Release Date: 2004. 06. 15. > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.707 / Virus Database: 463 - Release Date: 2004. 06. 15.
В списке pgsql-general по дате отправления: