Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-20 Thread Eliot Gable
On Wed, Apr 18, 2012 at 3:47 PM, Tom Lane wrote: > Eliot Gable writes: > > On Wed, Apr 18, 2012 at 1:01 PM, Tom Lane wrote: > >> However, there still might be an issue, because the CONTEXT trace that > >> you showed certainly seemed to point where you thought it did. > > > After re-reading the

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Eliot Gable
On Wed, Apr 18, 2012 at 3:47 PM, Tom Lane wrote: > Eliot Gable writes: > > On Wed, Apr 18, 2012 at 1:01 PM, Tom Lane wrote: > >> However, there still might be an issue, because the CONTEXT trace that > >> you showed certainly seemed to point where you thought it did. > > > After re-reading the

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Tom Lane
Eliot Gable writes: > On Wed, Apr 18, 2012 at 1:01 PM, Tom Lane wrote: >> However, there still might be an issue, because the CONTEXT trace that >> you showed certainly seemed to point where you thought it did. > After re-reading the LOCK modes and realizing that ACCESS SHARE is not the > same a

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Eliot Gable
On Wed, Apr 18, 2012 at 1:01 PM, Tom Lane wrote: > Eliot Gable writes: > > While attempting to reproduce this issue in a sanitized set of tables, > > functions, and triggers, I was able to locate the issue. Apparently I did > > have another function call in there inside my summarize_individuals(

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Tom Lane
Eliot Gable writes: > While attempting to reproduce this issue in a sanitized set of tables, > functions, and triggers, I was able to locate the issue. Apparently I did > have another function call in there inside my summarize_individuals() > function and that other function was marked as STABLE w

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Eliot Gable
On Wed, Apr 18, 2012 at 10:18 AM, Eliot Gable < egable+pgsql-gene...@gmail.com> wrote: > On Tue, Apr 17, 2012 at 7:11 PM, Tom Lane wrote: > >> Eliot Gable writes: >> > When the trigger fires, I get this in my postgres.log file: >> > 2012-04-17 16:57:15 >> EDT|test_db|169.254.5.138(56783)||[u

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Eliot Gable
On Tue, Apr 17, 2012 at 7:11 PM, Tom Lane wrote: > Eliot Gable writes: > > When the trigger fires, I get this in my postgres.log file: > > 2012-04-17 16:57:15 EDT|test_db|169.254.5.138(56783)||[unknown]|30474 > > WARNING: Failed to materialize the live_user_activity table; code > 0A000: >

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-18 Thread Eliot Gable
No, I have lots of calls to current_timestamp inside volatile functions which lock tables without complaints. I am beginning to think I hit some sort of bug. This is PostgreSQL 9.0.1. On Tue, Apr 17, 2012 at 5:55 PM, Michael Nolan wrote: > > > On Tue, Apr 17, 2012 at 5:20 PM, Eliot Gable wrote

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-17 Thread Tom Lane
Eliot Gable writes: > When the trigger fires, I get this in my postgres.log file: > 2012-04-17 16:57:15 EDT|test_db|169.254.5.138(56783)||[unknown]|30474 > WARNING: Failed to materialize the live_user_activity table; code 0A000: > LOCK TABLE is not allowed in a non-volatile function > I can

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-17 Thread Michael Nolan
On Tue, Apr 17, 2012 at 5:20 PM, Eliot Gable wrote: > > > > I cannot find a single non-volatile function in the call path; so I am > baffled on where this error message is coming from. I would be thankful for > any ideas anyone might have on where this error message might be coming > from or how

[GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-17 Thread Eliot Gable
I have a table which has a trigger on it. It is basically a log of user activity. The trigger is created like this: CREATE TRIGGER user_log_user_activity_call_in_trig AFTER INSERT ON bbx_cdr.user_log FOR EACH ROW WHEN ( NEW.user_log_action = 'ringing' ) EXECUTE PROCEDURE user_log_user_activity_cal

[GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-17 Thread Eliot Gable
I have a table which has a trigger on it. It is basically a log of user activity. The trigger is created like this: CREATE TRIGGER user_log_user_activity_call_in_trig AFTER INSERT ON bbx_cdr.user_log FOR EACH ROW WHEN ( NEW.user_log_action = 'ringing' ) EXECUTE PROCEDURE user_log_user_activity_cal