Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 23rd, 2005, 12:29 AM
Mark Lubratt
Guest
 
Posts: n/a
Default Orphaned trigger -- bug?

I just ran across a situation where I dropped a table that had a
trigger created on it. The system let me drop the table without
complaining and then I realized/remembered that the trigger also
existed. I tried dropping the trigger, but of course that couldn't be
done because the target relation no longer existed. Of course I
couldn't remake a relation because that would have a different OID.
The only way I found to drop the trigger was to drop the entire
database.

Shouldn't the system complain about triggers being dependent on
relations the same way that dropping a table that is used in a view
isn't allowed?

Thanks!
Mark


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

  #2  
Old November 23rd, 2005, 12:30 AM
Tom Lane
Guest
 
Posts: n/a
Default Re: Orphaned trigger -- bug?

Mark Lubratt <mark.lubratt@indeq.com> writes:[color=blue]
> I just ran across a situation where I dropped a table that had a
> trigger created on it. The system let me drop the table without
> complaining and then I realized/remembered that the trigger also
> existed.[/color]

Not any more --- triggers on a table certainly are dropped when the
table is dropped. The function called by a trigger wouldn't be
dropped though; is that what you meant?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles