Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 515239FC5F5 for ; Wed, 31 Oct 2007 19:37:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 16848-01-5 for ; Wed, 31 Oct 2007 19:37:08 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.179]) by postgresql.org (Postfix) with ESMTP id E40359FC5F6 for ; Wed, 31 Oct 2007 18:38:59 -0300 (ADT) Received: by el-out-1112.google.com with SMTP id m34so92085ele for ; Wed, 31 Oct 2007 14:38:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=uHLncLChSgqdbdKz1z4xa42HXrZ2eckQ5eHnukP5P5s=; b=dLACAQGlMdV1j7V2MFSQxZPmKHvsKGJ0qkpc8FllA6hqCTEGA5ziS/q0hdLZpfkHCN26QmNrF15irU3uNVpYl+yxxBHFd6QTdwESumAw6UvwaHHr/UoA6JW/MtICBKvx+hqVNiEn8KtyC+q9Jr/hL1F2I1Pr1PW0uIT6MVh9Ya8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=i4zjjdKziWlgxGOMvOqVnjax6c/mt+0XRkVm5UzyiEOWDr8lzJ+fFVI0lcoIiH79WOeZ0I1LcVLZaK46lkdlfiHDTRVLMBp6owM4mPHbMuLdDU4nuXMbEnJUxvKsRCMbcASQWjPbIXiOB24p3rvcdF2rUVWGAUZfcST4CIQLwZw= Received: by 10.142.144.16 with SMTP id r16mr2245156wfd.1193866737355; Wed, 31 Oct 2007 14:38:57 -0700 (PDT) Received: by 10.142.212.20 with HTTP; Wed, 31 Oct 2007 14:38:57 -0700 (PDT) Message-ID: <1c66bda80710311438l72daa6cam480ee63b52f98cb7@mail.gmail.com> Date: Thu, 1 Nov 2007 10:38:57 +1300 From: adey To: "Scott Marlowe" Subject: Re: how to check objects dependency?? Cc: "Jessica Richard" , pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4033_15765417.1193866737343" References: <906847.93368.qm@web56412.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/325 X-Sequence-Number: 27239 ------=_Part_4033_15765417.1193866737343 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Doesn't ownership also apply to views and stored procs... On 11/1/07, Scott Marlowe wrote: > > On 10/31/07, Jessica Richard wrote: > > 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? > > What version of pgsql are you running? In 8.2 I get a more useful > error message for a table that is owned by a user, i.e.: > > ERROR: role ... cannot be dropped ... > DETAIL: owner of table > > Have you looked in the logs to see if something like that shows up in > them? > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster > ------=_Part_4033_15765417.1193866737343 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Doesn't ownership also apply to views and stored procs...

On 11/1/07, Scott Marlowe <scott.marlowe@gmail.com> wrote:
On 10/31/07, Jessica Richard <rjessil@yahoo.com> wrote:
> 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?

What version of pgsql are you running?  In 8.2 I get a more useful
error message for a table that is owned by a user, i.e.:

ERROR: role ... cannot be dropped ...
DETAIL: owner of table <tablename>

Have you looked in the logs to see if something like that shows up in them?

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

------=_Part_4033_15765417.1193866737343--