dbTalk Databases Forums  

Trigger Related Problems Inserting to Table

comp.databases.postgresql comp.databases.postgresql


Discuss Trigger Related Problems Inserting to Table in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
StiltzkinMognet
 
Posts: n/a

Default Trigger Related Problems Inserting to Table - 12-11-2007 , 03:26 PM






I am having a bit of a problem inserting to a table when a trigger is
applied to that table. The thing that I am a bit confused about, is
that there are several other tables that use this same trigger, and my
application is able to insert into these other tables without a
problem.

Note that this table in question is newly created. I had thought that
maybe it was an issue with permissions, so I granted permissions for
everything to proot (this is the user that application itself uses).
This did not seem to solve the problem. The trigger itself looks
something like this:

updatenotes AFTER INSERT OR UPDATE ON notificationcardio FOR EACH ROW
EXECUTE updatenotes('cardio')

The aforementioned new table is notificationcardio, and updatenotes is
a routine that is called as a result of the trigger. The routine
itself is very generic, and does not have any limitations as to what
the parameters are that are passed into it.

Also, as soon as I remove the trigger on this table, the application
is able to insert/update into the notificationcardio table without a
problem.

If anyone has any thoughts of anything that I have no tried yet,
please let me know. Thank you.

Reply With Quote
  #2  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: Trigger Related Problems Inserting to Table - 12-12-2007 , 03:07 AM






StiltzkinMognet <bclark (AT) mognet (DOT) net> wrote:
Quote:
I am having a bit of a problem inserting to a table when a trigger is
applied to that table. The thing that I am a bit confused about, is
that there are several other tables that use this same trigger, and my
application is able to insert into these other tables without a
problem.

Note that this table in question is newly created. I had thought that
maybe it was an issue with permissions, so I granted permissions for
everything to proot (this is the user that application itself uses).
This did not seem to solve the problem. The trigger itself looks
something like this:

updatenotes AFTER INSERT OR UPDATE ON notificationcardio FOR EACH ROW
EXECUTE updatenotes('cardio')

The aforementioned new table is notificationcardio, and updatenotes is
a routine that is called as a result of the trigger. The routine
itself is very generic, and does not have any limitations as to what
the parameters are that are passed into it.

Also, as soon as I remove the trigger on this table, the application
is able to insert/update into the notificationcardio table without a
problem.

If anyone has any thoughts of anything that I have no tried yet,
please let me know. Thank you.
Do you get an error message? If yes, what is it?
If not, what is the unexpected behaviour?

It would be easiest to find out what is wrong if you share:
- The trigger function definition
- The table creation statement
- The insert statement

Then maybe somebody can reproduce and analyze the problem.

Yours,
Laurenz Albe


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.