Re: Dropping and creating a trigger

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Dropping and creating a trigger
Date: 2019-01-05 10:16:06
Message-ID: 46b0ab1f-d072-43d1-603b-d3b18f24028a@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/5/19 3:59 AM, Mitar wrote:
> Hi!
>
> I am seeing such errors in logs:
>
> ERROR: trigger "myapp_assignments" for relation "assignments" already exists
> STATEMENT:
> BEGIN TRANSACTION;
> DROP TRIGGER IF EXISTS "myapp_assignments" ON "assignments";
> CREATE TRIGGER "myapp_assignments"
> AFTER INSERT OR UPDATE OR DELETE ON "assignments"
> FOR EACH ROW EXECUTE PROCEDURE "tblobs_myapp"();
> COMMIT;
>
> How is this possible? If I am inside a transaction, this should work, no?

I'd think it should.  Have you run the commands manually, one at a time,
from psql, and checking the table after the DROP TRIGGER, to verify that the
trigger actually gets dropped?

--
Angular momentum makes the world go 'round.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Farber 2019-01-05 16:43:30 Adding LEFT JOIN to a query has increased execution time 10 times
Previous Message Mitar 2019-01-05 09:59:06 Dropping and creating a trigger