Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 7F192475D4B for ; Mon, 27 May 2002 16:11:49 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id DDFED476166 for ; Mon, 27 May 2002 16:06:29 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g4RK6AW26964; Mon, 27 May 2002 16:06:10 -0400 (EDT) To: Marc SCHAEFER Cc: pgsql-sql@postgresql.org Subject: Re: Some additional PostgreSQL questions In-reply-to: References: Comments: In-reply-to Marc SCHAEFER message dated "Mon, 27 May 2002 16:12:28 +0200" Date: Mon, 27 May 2002 16:06:10 -0400 Message-ID: <26961.1022529970@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200205/282 X-Sequence-Number: 7917 Marc SCHAEFER writes: > compta=> DELETE FROM ecriture WHERE id = 1; > DELETE 0 > The funny thing is the DELETE not saying an error, but not deleting (which > is good, but I would like an error). Then make your trigger raise an error. Returning NULL out of the trigger means "silently suppress this operation". There's not much point in having the system report an error; it has no idea what the error condition is, while the trigger presumably knows why it's unhappy and so can give a useful error message. > How can I defer the trigger call til the end of the transaction ? AFAIK we don't currently have end-of-transaction triggers, only end-of-statement triggers. > EXECUTE ''INSERT INTO ecriture(libelle)'' > || '' SELECT '' > || quote_ident($2 || ''.libelle'') > || '' FROM '' > || quote_ident($2) > || '' ORDER BY '' > || quote_ident($2 || ''.id''); I think you want quote_ident($2) || ''.libelle'' and so forth. What you'll get from that is "tablename.libelle", what you want is "tablename".libelle, no? regards, tom lane