Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 934959FA216 for ; Fri, 2 Nov 2007 09:50:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 09063-08 for ; Fri, 2 Nov 2007 09:50:24 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from web56411.mail.re3.yahoo.com (web56411.mail.re3.yahoo.com [216.252.111.90]) by postgresql.org (Postfix) with SMTP id 1A03F9FA215 for ; Fri, 2 Nov 2007 09:50:22 -0300 (ADT) Received: (qmail 55478 invoked by uid 60001); 2 Nov 2007 12:50:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=YH6fNnFukX35Kz9twSo/pIy6tZB5pCCyJO2NLIfGgH5PjzdIX0CJyDJN2xnJB4mPXCwxQ7pwLYYNC50HQpwGHo08NHRVN9cjASVn81VqLLSsDm9vtpCvmkHY8g8ZHlfyKlNVTtqiYufU594oyXjyPqTPPy8CY4v5MFc4u9b8jsU=; X-YMail-OSG: 4CY2UAEVM1lF8DdlA.1n2w7zPkspgNG5LHeTIIdbKWQlPZUXFz9hOAeMzU9lBJpET0zJGlE0zD3rbraIpLXJMVakWMb5C1j.yVWj6gZ9wilKTTyhgKyRKu9y.3vZ4Q-- Received: from [198.119.134.32] by web56411.mail.re3.yahoo.com via HTTP; Fri, 02 Nov 2007 05:50:20 PDT Date: Fri, 2 Nov 2007 05:50:20 -0700 (PDT) From: Jessica Richard Subject: Re: how to check objects dependency?? To: Tom Lane Cc: pgsql-admin@postgresql.org In-Reply-To: <18966.1193860699@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-613765845-1194007820=:53951" Content-Transfer-Encoding: 8bit Message-ID: <365368.53951.qm@web56411.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/20 X-Sequence-Number: 27263 --0-613765845-1194007820=:53951 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Instead of using drop user username, I used drop user "username" with double quotes, then the error message told me more detail about a specific user defined function. Then I was able to drop that function, then drop this user. My next question, How do I check the ownership of the functions. I can't tell the difference between system functions and the user defined functions. I am sure in the future there will be times that I need to check the ownership of the functions but not allowed to drop users to see check the dependencies. Thanks a lot, Jessica Tom Lane wrote: Jessica Richard writes: > I am trying to drop a user but it complained with the following message: > ERROR: role "joe" cannot be dropped because some objects depend on it > DETAIL: 1 objects in database Jan_test > 1 objects in database Jan > this user does not own any tables in those two databases. Is there any command I can use to check all the dependencies on this user? Try to do the DROP ROLE within those databases. You'll get more detail about owned objects within the current database, but from outside that database the info isn't reachable ... regards, tom lane __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --0-613765845-1194007820=:53951 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Instead of using drop user username, I used drop user "username" with double quotes, then the error message told me more detail about a specific user defined function. Then I was able to drop that function, then drop this user.

My next question,

How do I check the ownership of the functions. I can't tell the difference between system functions and the user defined functions.

I am sure in the future there will be times that I need to check the ownership of the functions but not allowed to drop users to see check the dependencies.


Thanks a lot,
Jessica


Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jessica Richard writes:
> I am trying to drop a user but it complained with the following message:
> ERROR: role "joe" cannot be dropped because some objects depend on it
> DETAIL: 1 objects in database Jan_test
> 1 objects in database Jan

> this user does not own any tables in those two databases. Is there any command I can use to check all the dependencies on this user?

Try to do the DROP ROLE within those databases. You'll get more detail
about owned objects within the current database, but from outside that
database the info isn't reachable ...

regards, tom lane

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com --0-613765845-1194007820=:53951--