Re: [GENERAL] Rows are repeating by the trigger function

2016-10-31 Thread Adrian Klaver
On 10/31/2016 10:02 AM, Kiran wrote: Dear Adrian and Alban, Thanks for the suggestions. I revisited the entire tables, triggers related to the tables. I did not find anything strange. But, I removed all the rows from the* *cf_user_question_link and inserted relevant rows into the table from *cf_

Re: [GENERAL] Rows are repeating by the trigger function

2016-10-31 Thread Kiran
Dear Adrian and Alban, Thanks for the suggestions. I revisited the entire tables, triggers related to the tables. I did not find anything strange. But, I removed all the rows from the cf_user_question_link and inserted relevant rows into the table from *cf_question*. Also, I recreated the functi

Re: [GENERAL] Rows are repeating by the trigger function

2016-10-31 Thread Alban Hertroys
On 31 October 2016 at 14:41, Adrian Klaver wrote: > On 10/31/2016 02:06 AM, Kiran wrote: >> I know 94 = 1 + (3 * 31). >> I am just having a normal insert statement into cf_question table. > > Are there any other triggers on the tables? I'm fairly confident that the duplicates are from updates on

Re: [GENERAL] Rows are repeating by the trigger function

2016-10-31 Thread Adrian Klaver
On 10/31/2016 02:06 AM, Kiran wrote: Hi Adrian, I want the trigger function to insert a row in cf_user_question_link table with fields as show in the function once the there is a insert from in the cf_question table. If so and I think this was mentioned before, why the UPDATE in the trigger

Re: [GENERAL] Rows are repeating by the trigger function

2016-10-31 Thread Kiran
Hi Adrian, I want the trigger function to insert a row in cf_user_question_link table with fields as show in the function once the there is a insert from in the cf_question table. I know 94 = 1 + (3 * 31). I am just having a normal insert statement into cf_question table. regards Kiran On Sun

Re: [GENERAL] Rows are repeating by the trigger function

2016-10-30 Thread Adrian Klaver
On 10/30/2016 02:31 AM, Kiran wrote: Dear Folks, I have a table *cf_question *with 31 rows. I want to insert/update another table *cf_user_question_link* when cf_question table is inserted/updated with row(s). I have written trigger function for this as follows. CREATE FUNCTION user_question

Re: [GENERAL] Rows are repeating by the trigger function

2016-10-30 Thread Kiran
Hi Alban, I agree with you about the UPDATE. Thanks for pointing out. regards Kiran On Sun, Oct 30, 2016 at 12:49 PM, Alban Hertroys wrote: > > > On 30 Oct 2016, at 10:31, Kiran wrote: > > > > Dear Folks, > > > > I have a table cf_question with 31 rows. > > I want to insert/update another t

Re: [GENERAL] Rows are repeating by the trigger function

2016-10-30 Thread Alban Hertroys
> On 30 Oct 2016, at 10:31, Kiran wrote: > > Dear Folks, > > I have a table cf_question with 31 rows. > I want to insert/update another table cf_user_question_link when cf_question > table is inserted/updated with row(s). > I have written trigger function for this as follows. > > >

[GENERAL] Rows are repeating by the trigger function

2016-10-30 Thread Kiran
Dear Folks, I have a table *cf_question *with 31 rows. I want to insert/update another table *cf_user_question_link* when cf_question table is inserted/updated with row(s). I have written trigger function for this as follows. CREATE FUNCTION user_question_link() RETURNS trigger AS $user_questi