Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UWvPM-0006By-1Z for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Apr 2013 21:14:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UWvPL-0000ob-4z for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Apr 2013 21:14:47 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UWvPJ-0000oR-3J for pgsql-bugs@postgresql.org; Mon, 29 Apr 2013 21:14:45 +0000 Received: from outmail148158.authsmtp.com ([62.13.148.158]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UWvPF-0002Uk-1y for pgsql-bugs@postgresql.org; Mon, 29 Apr 2013 21:14:44 +0000 Received: from mail-c226.authsmtp.com (mail-c226.authsmtp.com [62.13.128.226]) by punt6.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id r3TLEdTK003791 for ; Mon, 29 Apr 2013 22:14:39 +0100 (BST) Received: from [172.47.23.103] (70-36-143-10.dsl.dynamic.sonic.net [70.36.143.10]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id r3TLEa9O030902 for ; Mon, 29 Apr 2013 22:14:37 +0100 (BST) Message-ID: <517EE2BB.4050006@agliodbs.com> Date: Mon, 29 Apr 2013 14:14:35 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: RESET ROLE issue (Unreproduceable (so far) ) X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Server-Quench: cca29ddd-b111-11e2-98a9-0025907ec6c5 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdyZgscClZXSx8a IioLCC5HRQ8+YBZL BAkbIhBDJB8DSAtK Gl5dNUZcKlAHXFUf XCRcFVZdTywxG3x3 awtSfQdfaEtKVQZi Hk9JXFFUCgRsAgIA BgEcUQZyOUdFHAIF NE8dXnNbVUR4O0d4 QUoaRj5XZ240PDQC AkFZdh5VcVZIYxZN O1liVHMPZGwHYS8z QQRuKQocBhhjYB5y ZixFLEkJXEtDXgM6 XR0aBzIjAEYITi83 IlRmMVlUEk8Lcw1z WQAA X-Authentic-SMTP: 61633136333939.1020:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 70.36.143.10/23 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Debuggers, Having an interesting issue with RESET ROLE. So far it's defied my ability to come up with a simpler test case so that I can diagnose the issue. Here's the situ: 1. plpgsql function create_data_tables() creates a bunch of tables. 2. as part of this, it uses SET ROLE to a role the calling user is a member of ("dbowner"). 3. create_data_tables then calls create_partitions() to partition the newly created tables, in a loop. 4. create_partitions() also does SET ROLE dbowner, and RESET ROLE at the end of the function. 5. If called, on the ~~ 8th iteration of create_partitions(), it has a permissions problem: "must be owner of table new_master_table" 6. If I remove the SET/RESET from the create_partitions function, it works fine. Anyway, I can't imagine how you could diagnose this without a valid test case, and my attempts to construct a very simple reproduceable one so far have met with failure. So I'm filing this bug *in case* we see other issues with repetitive RESET ROLE calls in the future. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs