RESET ROLE issue (Unreproduceable (so far) )

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: RESET ROLE issue (Unreproduceable (so far) )
Date: 2013-04-29 21:14:35
Message-ID: 517EE2BB.4050006@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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

Browse pgsql-bugs by date

  From Date Subject
Next Message Kanitchet Vaiassava 2013-04-30 02:01:46 Fw: [pgadmin-support] (Bug) Numeric fault calculation
Previous Message John R Pierce 2013-04-29 18:57:30 Re: BUG #8125: server connecting error