I have defined a very simple trigger on the auth.u...
# sql
c
I have defined a very simple trigger on the auth.users table - all it does is insert a record into a logging table.
The only interesting part is that both the trigger function and the logging table are defined in a custom "private" schema
I've verified that inserting into the logging table using the postgres user works. The trigger and the table have been defined by the postgres user
However, I keep getting "Database error saving new user" when adding a new user
I tried granting all privileges to various users to the logging table (anon, authenticated, etc) but still get the error
Any ideas what might be the problem OR even better- how to go about diagnosing the problem?
g
Is the private schema in the search path, or do you use it in the call from the trigger (that is in auth).
like private.mytriggerfunction
c
I use in the call from the trigger
marking the trigger function as SECURITY DEFINER seems to have fixed the issue
not sure why it was necessary, since I had explicitly given rights to the owner of auth.user to the logging table