Re: Trigger usecase

2024-07-30 Thread Alban Hertroys
> On 30 Jul 2024, at 17:16, sud wrote: > > Hello, > > We have a streaming application (using apache flink and kafka) which > populates data in the tables of a postgres database version 15.4. > > Now while loading transactions data we also get some reference data > information from source (

Re: Trigger usecase

2024-07-30 Thread Adrian Klaver
On 7/30/24 13:28, David G. Johnston wrote: On Tue, Jul 30, 2024 at 11:46 AM sud > wrote: Not sure of the exact pros and cons, but we were following certain rules like , if it's business logic which needs to be implemented in Database, then it should not be

Re: Trigger usecase

2024-07-30 Thread David G. Johnston
On Tue, Jul 30, 2024 at 11:46 AM sud wrote: > > Not sure of the exact pros and cons, but we were following certain rules > like , if it's business logic which needs to be implemented in Database, > then it should not be done using triggers but rather should be done through > database procedure/fu

Re: Trigger usecase

2024-07-30 Thread Adrian Klaver
On 7/30/24 11:46, sud wrote: On Tue, Jul 30, 2024 at 10:54 PM Laurenz Albe > wrote: It is largely a matter of taste. The advantage of a trigger is that it works even if somebody bypasses the application to insert data. I think that trigge

Re: Trigger usecase

2024-07-30 Thread sud
On Tue, Jul 30, 2024 at 10:54 PM Laurenz Albe wrote: > > It is largely a matter of taste. > > The advantage of a trigger is that it works even if somebody bypasses the > application > to insert data. > > I think that triggers are easy to debug, but again, that's a matter of > taste. > > > Thank y

Re: Trigger usecase

2024-07-30 Thread Laurenz Albe
On Tue, 2024-07-30 at 20:46 +0530, sud wrote: > Now while loading transactions data we also get some reference data > information from > source (for example customer information) and for these , we dont want to > modify or > override the existing customer data but want to keep the old data with a

Re: Trigger usecase

2024-07-30 Thread David G. Johnston
On Tue, Jul 30, 2024 at 8:16 AM sud wrote: > > I understand, technically its possible bith the way, but want to > understand experts opinion on this and pros ans cons? > > Have client code call a function that performs the relevant work directly instead of having a trigger perform similar work.

Trigger usecase

2024-07-30 Thread sud
Hello, We have a streaming application (using apache flink and kafka) which populates data in the tables of a postgres database version 15.4. Now while loading transactions data we also get some reference data information from source (for example customer information) and for these , we dont want