Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-10-14 Thread Robert Haas
On Wed, Oct 12, 2011 at 7:07 PM, Tom Lane wrote: > Phil Sorber writes: >> Then there is a separate section of code that is called as a separate >> function 'dumpUserConfig()' that does other role attributes like >> 'ALTER ROLE bob SET role TO charlie'. These are the ALTER's that can >> have depen

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-10-13 Thread Martijn van Oosterhout
On Wed, Oct 12, 2011 at 02:27:51PM -0400, Phil Sorber wrote: > My proposal would be to table the discussion about the 'ALTER DATABASE > SET ROLE' case because there seems to be a bit of a philosophical > debate behind this that needs to be sorted out first. Note: "to table the discussion" means op

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-10-12 Thread Tom Lane
Phil Sorber writes: > Then there is a separate section of code that is called as a separate > function 'dumpUserConfig()' that does other role attributes like > 'ALTER ROLE bob SET role TO charlie'. These are the ALTER's that can > have dependencies on other roles. Right. Phrased that way, this

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-10-12 Thread Phil Sorber
On Wed, Oct 12, 2011 at 3:48 PM, Robert Haas wrote: > On Wed, Oct 12, 2011 at 2:27 PM, Phil Sorber wrote: >> I am going to remove that patch from the commit fest because we all >> agree that it does not solve the problem satisfactorily. I would like >> to re-iterate a few points, and submit a new

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-10-12 Thread Robert Haas
On Wed, Oct 12, 2011 at 2:27 PM, Phil Sorber wrote: > I am going to remove that patch from the commit fest because we all > agree that it does not solve the problem satisfactorily. I would like > to re-iterate a few points, and submit a new patch. > > First off, there are two distinct problems her

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-10-12 Thread Phil Sorber
On Mon, Oct 10, 2011 at 11:54 AM, Robert Haas wrote: > On Thu, Aug 4, 2011 at 2:04 PM, Robert Haas wrote: >> On Thu, Aug 4, 2011 at 1:53 PM, Phil Sorber wrote: >>> Ok, here is the patch that just moves the ALTER/SET pieces to the end. >>> Can we get this included in the next commit fest? >> >> Y

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-10-10 Thread Robert Haas
On Mon, Oct 10, 2011 at 12:14 PM, Tom Lane wrote: > Robert Haas writes: >> I don't really >> understand why it's not OK to just have pg_dump issue RESET ROLE at >> appropriate points in the process; that seems like it would be >> sufficient and not particularly ugly. > > Well, it was alleged that

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-10-10 Thread Tom Lane
Robert Haas writes: > I don't really > understand why it's not OK to just have pg_dump issue RESET ROLE at > appropriate points in the process; that seems like it would be > sufficient and not particularly ugly. Well, it was alleged that that would fix this problem: http://archives.postgresql.org

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-10-10 Thread Robert Haas
On Thu, Aug 4, 2011 at 2:04 PM, Robert Haas wrote: > On Thu, Aug 4, 2011 at 1:53 PM, Phil Sorber wrote: >> Ok, here is the patch that just moves the ALTER/SET pieces to the end. >> Can we get this included in the next commit fest? > > Yep, just make yourself an account and add it. Unfortunately,

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-08-04 Thread Robert Haas
On Thu, Aug 4, 2011 at 1:53 PM, Phil Sorber wrote: > Ok, here is the patch that just moves the ALTER/SET pieces to the end. > Can we get this included in the next commit fest? Yep, just make yourself an account and add it. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-08-04 Thread Phil Sorber
On Tue, Aug 2, 2011 at 5:05 PM, Tom Lane wrote: > Phil Sorber writes: >> I have included two patches in this email. The first >> (dump_user_config_last_with_set_role.patch) is an extension of my >> first patch. In addition to moving the ALTER ROLE statements after the >> CREATE ROLE statements it

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-08-02 Thread Tom Lane
Phil Sorber writes: > I have included two patches in this email. The first > (dump_user_config_last_with_set_role.patch) is an extension of my > first patch. In addition to moving the ALTER ROLE statements after the > CREATE ROLE statements it also inserts a SET ROLE after every connect. > It take

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-08-02 Thread Phil Sorber
I have included two patches in this email. The first (dump_user_config_last_with_set_role.patch) is an extension of my first patch. In addition to moving the ALTER ROLE statements after the CREATE ROLE statements it also inserts a SET ROLE after every connect. It takes the role parameter from the -

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-07-28 Thread Tom Lane
Robert Haas writes: > On Wed, Jul 27, 2011 at 7:51 PM, Tom Lane wrote: >> I think pg_dumpall is the very least of your problems if you do >> something like that.  We probably ought to forbid it entirely. > Well, we had a long discussion of that on the thread Phil linked to, > and I don't think t

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-07-28 Thread Robert Haas
On Wed, Jul 27, 2011 at 7:51 PM, Tom Lane wrote: > Phil Sorber writes: >> Currently if you use 'ALTER ROLE rolename SET ROLE', pg_dumpall will >> dump an 'ALTER ROLE' out right after the 'CREATE ROLE' statement. > > I think pg_dumpall is the very least of your problems if you do > something like

Re: [HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-07-27 Thread Tom Lane
Phil Sorber writes: > Currently if you use 'ALTER ROLE rolename SET ROLE', pg_dumpall will > dump an 'ALTER ROLE' out right after the 'CREATE ROLE' statement. I think pg_dumpall is the very least of your problems if you do something like that. We probably ought to forbid it entirely.

[HACKERS] patch: move dumpUserConfig call in dumpRoles function of pg_dumpall.c

2011-07-27 Thread Phil Sorber
Hello, The attached patch changes the location of the dumpUserConfig call in the dumpRoles function of pg_dumpall. This is related to this thread: http://archives.postgresql.org/pgsql-hackers/2011-02/msg02359.php Currently if you use 'ALTER ROLE rolename SET ROLE', pg_dumpall will dump an 'ALTER