pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kristis Makris <kristis.makris@datasoft.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: ERROR: deferredTriggerGetPreviousEvent: event for tuple (0,9) not found
Date: 11 Jul 2001 09:04:45 -0700
Message-ID: <200107111604.f6BG4ka39360@postgresql.org> (raw)
In-Reply-To: <18395.994864895@sss.pgh.pa.us>
References: <200107110034.f6B0YX879575@hub.org>
	<18395.994864895@sss.pgh.pa.us>

Hi Tom, thanks for your feedback on this.

On 11 Jul 2001 11:21:35 -0400, Tom Lane wrote:
> pgsql-bugs@postgresql.org writes:
> > ERROR:  deferredTriggerGetPreviousEvent: event for tuple (0,9) not
found
> 
> Hmm, are you trying to create triggers on pg_shadow?  It's hard to see
> how that message could come from an "UPDATE pg_shadow" otherwise.

I'm not trying to explicitly create triggers on pg_shadow. None of the
triggers/tables/sequences/functions I've created so far try to reference
the pg_shadow in any way, so I don't *believe* (but I could be wrong)
that I've even implicitly created a trigger on pg_shadow;
 
> Triggers on system catalogs don't work very well, because they won't
> be invoked as a side effect of system-initiated operations.  In this
> situation, it appears that the trigger code sees that the pg_shadow
row
> was inserted in the current transaction, so it tries to look up the
row
> in the list of pending trigger events --- and doesn't find an entry,
> because CREATE USER didn't invoke the trigger code.

Before I came across this error, the approach I was following was:

-Call the WATSUSer_iou() plpgsql function that contained "CREATE USER"
statements to create the new user
-Call a plpgsql function after that, that contained "UPDATE pg_shadow"
statements to update the "valuntil" field from the pg_shadow table.

This approach was working fine. I get the feeling that this approach had
the effect of each function call being considered a separate
transaction, thus there were no errors when the "UPDATE pg_shadow"
statement was called (the "CREATE USER" transaction was commited by that
time)
 
> In a perfect world we'd support user-defined triggers on the system
> catalogs, but given the potential circularity problems, I doubt it's
> going to happen real soon.  I'd suggest finding another approach.

Sounds reasonable. I can stick to the old approach. In case you guys
ever need to debug/ look into this I have a schema and a sequence of
commands executed that I'll keep around.

Thanks for your help.
-Kristis






view thread (9+ messages)  latest in thread

Message-ID: <200107111604.f6BG4ka39360@postgresql.org>
Permalink:  ../200107111604.f6BG4ka39360@postgresql.org/
Also on:    postgresql.org/message-id/200107111604.f6BG4ka39360@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: kristis.makris@datasoft.com, tgl@sss.pgh.pa.us, pgsql-bugs@postgresql.org
  Subject: Re: ERROR: deferredTriggerGetPreviousEvent: event for tuple (0,9) not found
  In-Reply-To: <200107111604.f6BG4ka39360@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox