pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: pgsql-bugs@postgresql.org
Subject: RESET ROLE issue (Unreproduceable (so far) )
Date: Mon, 29 Apr 2013 14:14:35 -0700
Message-ID: <517EE2BB.4050006@agliodbs.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



Message-ID: <517EE2BB.4050006@agliodbs.com>
Permalink:  ../517EE2BB.4050006@agliodbs.com/
Also on:    postgresql.org/message-id/517EE2BB.4050006@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: josh@agliodbs.com
  Subject: Re: RESET ROLE issue (Unreproduceable (so far) )
  In-Reply-To: <517EE2BB.4050006@agliodbs.com>
  References: <517EE2BB.4050006@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox