Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-11-06 Thread Dmitry Yemanov
07.11.2011 11:23, Thomas Steinmaurer wrote: > With all the discussion, is it worth to create a JIRA issue for this > feature request? I don't mind :-) Dmitry -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-11-06 Thread Thomas Steinmaurer
> is there any plan for supporting conditional trigger firing as in Oracle > when specifying an optional WHEN clause in the trigger DDL syntax? > > Currently in Firebird, to omit trigger code execution, one can wrap the > entire trigger body into an IF block, but the trigger still fires, but > no P

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Björn Reimer
Hi, It's not only Oracle having a when, PostgreSQL has something similar: http://www.postgresql.org/docs/9.1/interactive/sql-createtrigger.html > If a WHEN clause implies that the trigger gets fired anyway, then right, > this wouldn't make a difference. ;-) I think an aspect would be a t

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Adriano dos Santos Fernandes
On 10/10/2011 07:43, Dimitry Sibiryakov wrote: > 10.10.2011 12:36, Adriano dos Santos Fernandes wrote: >> Wrong reason, as Oracle doesn't support external triggers. > Oracle SQL Reference for version 10 has other opinion: > > -- quote --- > CREATE TRIGGER sal

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Alex Peshkoff
On 10/10/11 14:36, Adriano dos Santos Fernandes wrote: > On 10/10/2011 04:47, Dimitry Sibiryakov wrote: >> b) trigger body can be in Java. Firebird don't have both these problems. > Wrong reason, as Oracle doesn't support external triggers. > > You would just need to code a PL/SQL trigger that ca

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Dmitry Yemanov
10.10.2011 14:43, Dimitry Sibiryakov wrote: >> Wrong reason, as Oracle doesn't support external triggers. > > Oracle SQL Reference for version 10 has other opinion: > > -- quote --- > CREATE TRIGGER salary_check > BEFORE INSERT OR UPDATE OF salary, job_id ON

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Dimitry Sibiryakov
10.10.2011 12:36, Adriano dos Santos Fernandes wrote: > Wrong reason, as Oracle doesn't support external triggers. Oracle SQL Reference for version 10 has other opinion: -- quote --- CREATE TRIGGER salary_check BEFORE INSERT OR UPDATE OF salary, job_id ON em

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Adriano dos Santos Fernandes
On 10/10/2011 06:48, Vlad Khorsun wrote: > Seems conditional triggers have sence only for external (non-PSQL) > triggers. > > Moreover, only when the call is cost (like Java, but not for C++). Adriano -- All the d

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Adriano dos Santos Fernandes
On 10/10/2011 04:47, Dimitry Sibiryakov wrote: > b) trigger body can be in Java. Firebird don't have both these problems. Wrong reason, as Oracle doesn't support external triggers. You would just need to code a PL/SQL trigger that calls an external procedure/function, so you would be able to us

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Mark Rotteveel
On Mon, 10 Oct 2011 12:48:51 +0300, "Vlad Khorsun" wrote: >> 10.10.2011 12:26, Vlad Khorsun wrote: >> >>> If such clause is inside trigger code then it not affects security >>> checks and >>> *whole* trigger code is checked. SQL standard says something about >>> security >>> checks for conditiona

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Alex Peshkoff
On 10/10/11 13:48, Vlad Khorsun wrote: >> 10.10.2011 12:26, Vlad Khorsun wrote: >> >>> If such clause is inside trigger code then it not affects security checks >>> and >>> *whole* trigger code is checked. SQL standard says something about security >>> checks for conditional triggers ? >> I belie

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Vlad Khorsun
> 10.10.2011 12:26, Vlad Khorsun wrote: > >> If such clause is inside trigger code then it not affects security checks and >> *whole* trigger code is checked. SQL standard says something about security >> checks for conditional triggers ? > > I believe the rules are the same. In general, it's imp

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Dmitry Yemanov
10.10.2011 12:54, Alex Peshkoff wrote: > It says nothing about conditional triggers at all - at least I've failed > to find such mention. Search for . Dmitry -- All the data continuously generated in your IT infrastru

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Alex Peshkoff
On 10/10/11 12:26, Vlad Khorsun wrote: >> On 10/10/11 11:53, Vlad Khorsun wrote: At the first glance it's possible to avoid loading trigger's body with WHEN clause. >>> Should we check permissions of trigger's code ? If yes - we will load >>> it anyway at query (insert\update\delet

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Dmitry Yemanov
10.10.2011 12:26, Vlad Khorsun wrote: > If such clause is inside trigger code then it not affects security checks and > *whole* trigger code is checked. SQL standard says something about security > checks for conditional triggers ? I believe the rules are the same. In general, it's impossible to

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Vlad Khorsun
> On 10/10/11 11:53, Vlad Khorsun wrote: >>> At the first glance it's possible to avoid loading trigger's body with >>> WHEN clause. >> Should we check permissions of trigger's code ? If yes - we will load >> it anyway at query (insert\update\delete) prepare time. > > We should not check per

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Alex Peshkoff
On 10/10/11 11:53, Vlad Khorsun wrote: >> At the first glance it's possible to avoid loading trigger's body with >> WHEN clause. > Should we check permissions of trigger's code ? If yes - we will load > it anyway at query (insert\update\delete) prepare time. We should not check permissions

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Thomas Steinmaurer
> On 10/10/11 11:47, Dimitry Sibiryakov wrote: >> 10.10.2011 9:41, Alex Peshkoff wrote: >>> But telling true I do not think that such game >>> is worth playing - too many conditions should be met. >> It is worth for Oracle because >> a) condition is evaluated in SQL machine and let it avoid s

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Alex Peshkoff
On 10/10/11 11:47, Dimitry Sibiryakov wrote: > 10.10.2011 9:41, Alex Peshkoff wrote: >> But telling true I do not think that such game >> is worth playing - too many conditions should be met. >It is worth for Oracle because > a) condition is evaluated in SQL machine and let it avoid switching

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Vlad Khorsun
> At the first glance it's possible to avoid loading trigger's body with > WHEN clause. Should we check permissions of trigger's code ? If yes - we will load it anyway at query (insert\update\delete) prepare time. Regards, Vlad --

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Dimitry Sibiryakov
10.10.2011 9:41, Alex Peshkoff wrote: > But telling true I do not think that such game > is worth playing - too many conditions should be met. It is worth for Oracle because a) condition is evaluated in SQL machine and let it avoid switching to PL/SQL machine if the condition doesn't met. (Su

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Alex Peshkoff
On 10/10/11 11:24, Mark Rotteveel wrote: > On Mon, 10 Oct 2011 09:11:40 +0200, Thomas Steinmaurer > wrote: >>> I think that the Oracle WHEN-clause is simply syntactic sugar for >>> wrapping >>> the entire body in an IF-condition. I don't think there would be much >>> difference performance-wise.

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Mark Rotteveel
On Mon, 10 Oct 2011 09:11:40 +0200, Thomas Steinmaurer wrote: >> I think that the Oracle WHEN-clause is simply syntactic sugar for >> wrapping >> the entire body in an IF-condition. I don't think there would be much >> difference performance-wise. > > If a WHEN clause implies that the trigger get

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Thomas Steinmaurer
> On Mon, 10 Oct 2011 08:17:19 +0200, Thomas Steinmaurer > wrote: >> Hello, >> >> is there any plan for supporting conditional trigger firing as in Oracle > >> when specifying an optional WHEN clause in the trigger DDL syntax? >> >> Currently in Firebird, to omit trigger code execution, one can w

Re: [Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-10 Thread Mark Rotteveel
On Mon, 10 Oct 2011 08:17:19 +0200, Thomas Steinmaurer wrote: > Hello, > > is there any plan for supporting conditional trigger firing as in Oracle > when specifying an optional WHEN clause in the trigger DDL syntax? > > Currently in Firebird, to omit trigger code execution, one can wrap the >

[Firebird-devel] Support conditional trigger firing (WHEN clause ala Oracle)

2011-10-09 Thread Thomas Steinmaurer
Hello, is there any plan for supporting conditional trigger firing as in Oracle when specifying an optional WHEN clause in the trigger DDL syntax? Currently in Firebird, to omit trigger code execution, one can wrap the entire trigger body into an IF block, but the trigger still fires, but no P