Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 20FDC6331C5 for ; Wed, 21 Apr 2010 12:23:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 12434-10 for ; Wed, 21 Apr 2010 15:23:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 68F71632971 for ; Wed, 21 Apr 2010 12:23:23 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o3LFNCUo024031; Wed, 21 Apr 2010 11:23:12 -0400 (EDT) To: Scott Marlowe cc: Gonzalo Aguilar Delgado , pgsql-sql@postgresql.org Subject: Re: Problem with insert related to different schemas In-reply-to: References: <1271233402.10390.5.camel@azul1> <1271781155.6136.57.camel@azul1> <15360.1271782885@sss.pgh.pa.us> <1271856300.29798.4.camel@azul1> Comments: In-reply-to Scott Marlowe message dated "Wed, 21 Apr 2010 07:31:07 -0600" Date: Wed, 21 Apr 2010 11:23:12 -0400 Message-ID: <24030.1271863392@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.109 tagged_above=-10 required=5 tests=AWL=-0.199, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/81 X-Sequence-Number: 34008 Scott Marlowe writes: > On Wed, Apr 21, 2010 at 7:25 AM, Gonzalo Aguilar Delgado > wrote: >> Maybe but I ran even grant all on schema public for this user to check >> if this was the problem. > That doesn't do what you think it does. You need to grant on the actual object. The error he was getting was about permissions for the schema, though. One thought: if you're running any moderately recent version of PG, the FK check query will be run as though by the owner of the table, not whoever issued the INSERT. Maybe that user doesn't have the right permissions? regards, tom lane