Re: [HACKERS] User-friendliness for DROP RESTRICT/CASCADE

2002-06-26 Thread Christopher Kings-Lynne
> DROP TYPE widget RESTRICT; -- fail > NOTICE: operator <% depends on type widget > NOTICE: operator >% depends on type widget > NOTICE: operator >=% depends on type widget > ERROR: Cannot drop type widget because other objects depend on it > Use DROP ... CASCADE to drop the dependent objects

Re: [HACKERS] User-friendliness for DROP RESTRICT/CASCADE

2002-06-26 Thread Bruce Momjian
Rod Taylor wrote: > > David Kaplan reminded me that there is another UI issue to be > > considered: when we *are* doing a DROP CASCADE, should the dropped > > dependent objects be reported somehow? As it stands, Rod's patch emits > > elog(NOTICE) messages in this case, but I am wondering whether

Re: [HACKERS] User-friendliness for DROP RESTRICT/CASCADE

2002-06-26 Thread Rod Taylor
On Wed, 2002-06-26 at 22:30, Tom Lane wrote: > Joe Conway <[EMAIL PROTECTED]> writes: > > It would be nice if the recursive dependency checking function was > > available as an end user function too, so you could analyze dependencies > > before even trying to drop something, or even just to unde

Re: [HACKERS] User-friendliness for DROP RESTRICT/CASCADE

2002-06-26 Thread Tom Lane
Joe Conway <[EMAIL PROTECTED]> writes: > It would be nice if the recursive dependency checking function was > available as an end user function too, so you could analyze dependencies > before even trying to drop something, or even just to understand a > database schema you've inherited from som

Re: [HACKERS] User-friendliness for DROP RESTRICT/CASCADE

2002-06-26 Thread Joe Conway
Tom Lane wrote: > Also, would it be a good idea to make it *recursively* report all > the indirect as well as direct dependencies? The output might get > a little bulky, but if you really want to know what DROP CASCADE > will get you into, seems like that is the only way to know. > > To work rec

Re: [HACKERS] User-friendliness for DROP RESTRICT/CASCADE

2002-06-26 Thread Bruce Momjian
Tom Lane wrote: > > DROP TYPE widget RESTRICT; -- fail > NOTICE: operator <% depends on type widget > NOTICE: operator >% depends on type widget > NOTICE: operator >=% depends on type widget > ERROR: Cannot drop type widget because other objects depend on it > Use DROP ... CASCADE to dr

[HACKERS] User-friendliness for DROP RESTRICT/CASCADE

2002-06-26 Thread Tom Lane
I have been reviewing Rod Taylor's pg_depend patch, which among other things adds SQL-compliant DROP RESTRICT/CASCADE syntax and prevents you from dropping things that other things depend on, as in ye olde novice error of dropping a function used by a trigger. As submitted, the patch gives elog(E