Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a trigger associated to a table. When i drop it via

DROP TRIGGER IF EXISTS myTrigger on dummytable;  

postgres tells me

NOTICE:  trigger "mytrigger" for table "dummytable" does not exist, skipping
DROP TRIGGER  

When i use a dummy table for tests this works. I've tried:

  • changing CaSe,
  • making the trigger name longer (the real trigger is 17 chars long)

When testing it always drops without issue.

This is Postgres 8.2 on Linux. What does work is adding quotation marks:

DROP TRIGGER IF EXISTS "myTrigger" on dummytable;  

Why this is so is beyond me, there's nothing in the docs that mentions the name must be in quotation marks.

Am i missing something obvious?

share|improve this question
    
Looks like your trigger has been created with a mixed-case name using a name enclosed in double quotes. –  Colin 't Hart Oct 2 '14 at 9:48

2 Answers 2

up vote 1 down vote accepted

The behaviour you've described is correct and documented : http://www.postgresql.org/docs/8.2/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

If the trigger have been created with double quote and special char, it must be used with the same syntax.

share|improve this answer

Remove the "" - so it will be case insensitive. Please also remove the "" when creating the trigger.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.