Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-07-07 Thread Heikki Linnakangas
On 05/16/2015 06:00 AM, Haribabu Kommi wrote: Regarding next version- are you referring to 9.6 and therefore we should go ahead and bounce this to the next CF, or were you planning to post a next version of the patch today? Yes, for 9.6 version. No new patch emerged that could be reviewed in

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-05-15 Thread Stephen Frost
* Haribabu Kommi (kommi.harib...@gmail.com) wrote: On Tue, May 5, 2015 at 6:48 AM, Peter Eisentraut pete...@gmx.net wrote: On 5/1/15 12:33 PM, Andres Freund wrote: On 2015-04-08 19:19:29 +0100, Greg Stark wrote: I'm not sure what the best way to handle the hand-off from patch contribution

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-05-15 Thread Haribabu Kommi
On Fri, May 15, 2015 at 11:24 PM, Stephen Frost sfr...@snowman.net wrote: * Haribabu Kommi (kommi.harib...@gmail.com) wrote: On Tue, May 5, 2015 at 6:48 AM, Peter Eisentraut pete...@gmx.net wrote: It still looks quite dubious to me. The more I test this, the more fond I grow of the idea of

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-05-14 Thread Haribabu Kommi
On Tue, May 5, 2015 at 6:48 AM, Peter Eisentraut pete...@gmx.net wrote: On 5/1/15 12:33 PM, Andres Freund wrote: On 2015-04-08 19:19:29 +0100, Greg Stark wrote: I'm not sure what the best way to handle the hand-off from patch contribution to reviewer/committer. If I start tweaking things then

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-05-04 Thread Peter Eisentraut
On 5/1/15 12:33 PM, Andres Freund wrote: On 2015-04-08 19:19:29 +0100, Greg Stark wrote: I'm not sure what the best way to handle the hand-off from patch contribution to reviewer/committer. If I start tweaking things then you send in a new version it's actually more work to resolve the

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-05-01 Thread Andres Freund
On 2015-04-08 19:19:29 +0100, Greg Stark wrote: I'm not sure what the best way to handle the hand-off from patch contribution to reviewer/committer. If I start tweaking things then you send in a new version it's actually more work to resolve the conflicts. I think at this point it's easiest if

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-04-08 Thread Greg Stark
I'm not sure what the best way to handle the hand-off from patch contribution to reviewer/committer. If I start tweaking things then you send in a new version it's actually more work to resolve the conflicts. I think at this point it's easiest if I just take it from here. I'm puzzled about the

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-04-04 Thread Pavel Stehule
2015-04-04 15:29 GMT+02:00 Haribabu Kommi kommi.harib...@gmail.com: On Sat, Apr 4, 2015 at 4:19 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi 2015-03-31 14:38 GMT+02:00 Haribabu Kommi kommi.harib...@gmail.com: keyword_databases - The database name can be all, replication,

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-04-04 Thread Haribabu Kommi
On Sat, Apr 4, 2015 at 4:19 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi 2015-03-31 14:38 GMT+02:00 Haribabu Kommi kommi.harib...@gmail.com: keyword_databases - The database name can be all, replication, sameuser, samerole and samegroup. keyword_roles - The role can be all and a

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-04-03 Thread Pavel Stehule
Hi 2015-03-31 14:38 GMT+02:00 Haribabu Kommi kommi.harib...@gmail.com: On Mon, Mar 30, 2015 at 4:34 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi I checked this patch. I like the functionality and behave. Thanks for the review. Here I attached updated patch with the following

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-31 Thread Haribabu Kommi
On Mon, Mar 30, 2015 at 4:34 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi I checked this patch. I like the functionality and behave. Thanks for the review. Here I attached updated patch with the following changes. 1. Addition of two new keyword columns keyword_databases - The

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-29 Thread Pavel Stehule
Hi I checked this patch. I like the functionality and behave. There is minor issue with outdated regress test test rules... FAILED I have no objections. Regards Pavel 2015-03-27 9:23 GMT+01:00 Haribabu Kommi kommi.harib...@gmail.com: On Fri, Mar 13, 2015 at 1:33 PM,

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-27 Thread Haribabu Kommi
On Fri, Mar 13, 2015 at 1:33 PM, Peter Eisentraut pete...@gmx.net wrote: On 3/4/15 1:34 AM, Haribabu Kommi wrote: On Wed, Mar 4, 2015 at 12:35 PM, Haribabu Kommi kommi.harib...@gmail.com wrote: + foreach(line, parsed_hba_lines) In the above for loop it is better to add check_for_interrupts

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-16 Thread Alvaro Herrera
Robert Haas wrote: On Wed, Mar 11, 2015 at 1:32 PM, Greg Stark st...@mit.edu wrote: I think what we have here is already a good semantic representation. It doesn't handle all the corner cases but those corner cases are a) very unlikely and b) easy to check for. A tool can check for any

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-16 Thread Greg Stark
On Mon, Mar 16, 2015 at 4:29 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: +1 what Robert said. I think the additional keyword columns are a good solution to the issue. Huh. Well I disagree but obviously I'm in the minority. I'll put fix it up accordingly today and post the resulting

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-16 Thread Robert Haas
On Wed, Mar 11, 2015 at 1:32 PM, Greg Stark st...@mit.edu wrote: I think what we have here is already a good semantic representation. It doesn't handle all the corner cases but those corner cases are a) very unlikely and b) easy to check for. A tool can check for any users starting with + or

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-16 Thread David G. Johnston
On Mon, Mar 16, 2015 at 9:29 AM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Robert Haas wrote: On Wed, Mar 11, 2015 at 1:32 PM, Greg Stark st...@mit.edu wrote: I think what we have here is already a good semantic representation. It doesn't handle all the corner cases but those corner

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-16 Thread Robert Haas
On Mon, Mar 16, 2015 at 1:46 PM, David G. Johnston david.g.johns...@gmail.com wrote: Why not just leave the double-quoting requirements intact. An unquoted any or sameuser (etc) would represent the special keyword while the quoted version would mean that the name is used literally. That would

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-16 Thread Greg Stark
On Mon, Mar 16, 2015 at 5:46 PM, David G. Johnston david.g.johns...@gmail.com wrote: ​Why not just leave the double-quoting requirements intact. An unquoted any or sameuser (etc) would represent the special keyword while the quoted version would mean that the name is used literally. For

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-16 Thread David G. Johnston
On Mon, Mar 16, 2015 at 11:11 AM, Greg Stark st...@mit.edu wrote: On Mon, Mar 16, 2015 at 5:46 PM, David G. Johnston david.g.johns...@gmail.com wrote: ​Why not just leave the double-quoting requirements intact. An unquoted any or sameuser (etc) would represent the special keyword while

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-05 Thread Peter Eisentraut
On 3/5/15 9:42 AM, Greg Stark wrote: Well if you want to read the file as is you can do so using the file reading functions which afaik were specifically intended for the purpose of writing config editing tools. Sure, but those things are almost never installed by default, and I don't want to

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-05 Thread Pavel Stehule
2015-03-04 22:41 GMT+01:00 Peter Eisentraut pete...@gmx.net: On 3/3/15 7:17 PM, Jim Nasby wrote: I think we're screwed in that regard anyway, because of the special constructs. You'd need different logic to handle things like +role and sameuser. We might even end up painted in a corner

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-05 Thread Greg Stark
On Wed, Mar 4, 2015 at 9:41 PM, Peter Eisentraut pete...@gmx.net wrote: everyone seems to have quite different uses for it. Greg wants to join against other catalog tables, Jim wants to reassemble a valid and accurate pg_hba.conf, Josh wants to write an editing tool. Personally, I'd like to

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-04 Thread Peter Eisentraut
On 3/3/15 7:17 PM, Jim Nasby wrote: I think we're screwed in that regard anyway, because of the special constructs. You'd need different logic to handle things like +role and sameuser. We might even end up painted in a corner where we can't change it in the future because it'll break

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-04 Thread Greg Stark
On Wed, Mar 4, 2015 at 1:35 AM, Haribabu Kommi kommi.harib...@gmail.com wrote: I feel there is no problem of current pg_hba reloads, because the check_for_interrupts doesn't reload the conf files. It will be done in the postgresMain function once the query finishes. Am I missing something?

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-03 Thread Greg Stark
On Mon, Jun 30, 2014 at 8:06 AM, Abhijit Menon-Sen a...@2ndquadrant.com wrote: After sleeping on it, I realised that the code would return '{all}' for 'all' in pg_hba.conf, but '{all}' for 'all'. So it's not exactly ambiguous, but I don't think it's especially useful for callers. Hm. Nope, it

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-03 Thread Jim Nasby
On 3/3/15 9:08 AM, Greg Stark wrote: On Mon, Jun 30, 2014 at 8:06 AM, Abhijit Menon-Sen a...@2ndquadrant.com wrote: After sleeping on it, I realised that the code would return '{all}' for 'all' in pg_hba.conf, but '{all}' for 'all'. So it's not exactly ambiguous, but I don't think it's

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-03 Thread Greg Stark
On Tue, Mar 3, 2015 at 6:05 PM, Jim Nasby jim.na...@bluetreble.com wrote: What about a separate column that's just the text from pg_hba? Or is that what you're opposed to? I'm not sure what you mean by that. There's a rawline field we could put somewhere but it contains the entire line.

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-03 Thread Haribabu Kommi
On Wed, Mar 4, 2015 at 12:35 PM, Haribabu Kommi kommi.harib...@gmail.com wrote: + foreach(line, parsed_hba_lines) In the above for loop it is better to add check_for_interrupts to avoid it looping if the parsed_hba_lines are more. Updated patch is attached with the addition of

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-03 Thread Greg Stark
On Wed, Mar 4, 2015 at 12:17 AM, Jim Nasby jim.na...@bluetreble.com wrote: I can make these changes if you want. Personally I'm just not convinced this is worth it. It makes the catalogs harder for people to read and use and only benefits people who have users named all or databases named all,

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-03 Thread Greg Stark
On Wed, Mar 4, 2015 at 12:34 AM, Haribabu Kommi kommi.harib...@gmail.com wrote: Out of curiosity, regarding the result materialize code addition, Any way the caller of hba_settings function ExecMakeTableFunctionResult also stores the results in tuple_store. Is there any advantage doing it in

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-03 Thread Josh Berkus
On 03/03/2015 05:07 PM, Greg Stark wrote: On Wed, Mar 4, 2015 at 12:17 AM, Jim Nasby jim.na...@bluetreble.com wrote: I can make these changes if you want. Personally I'm just not convinced this is worth it. It makes the catalogs harder for people to read and use and only benefits people who

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-03 Thread Haribabu Kommi
On Wed, Mar 4, 2015 at 12:18 PM, Greg Stark st...@mit.edu wrote: On Wed, Mar 4, 2015 at 12:34 AM, Haribabu Kommi kommi.harib...@gmail.com wrote: Out of curiosity, regarding the result materialize code addition, Any way the caller of hba_settings function ExecMakeTableFunctionResult also

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-03 Thread Jim Nasby
On 3/3/15 12:57 PM, Greg Stark wrote: On Tue, Mar 3, 2015 at 6:05 PM, Jim Nasby jim.na...@bluetreble.com wrote: What about a separate column that's just the text from pg_hba? Or is that what you're opposed to? I'm not sure what you mean by that. There's a rawline field we could put

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-03 Thread Haribabu Kommi
On Wed, Mar 4, 2015 at 5:57 AM, Greg Stark st...@mit.edu wrote: On further review I've made a few more changes attached. I think we should change the column names to users and databases to be clear they're lists and also to avoid the user SQL reserved word. I removed the dependency on

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-02 Thread Greg Stark
On Mon, Mar 2, 2015 at 7:51 PM, Greg Stark st...@mit.edu wrote: Nobody's allocating anything that big. It's a list of 25,000 pointers to 472-byte structs. That should add up to about 11MB. Instead the memory context is a total of 954606152 bytes which is still under a gigabyte and the database

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-02 Thread Greg Stark
​So earlier someone commented that using lists list_nth() seemed odd and a tuplestore might be better. In fact using lists this way is O(n^2). I've done some quick tests and it doesn't start being a problem until about 10,000 lines which obviously isn't a terribly common way to use

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-02 Thread Stephen Frost
Greg, * Greg Stark (st...@mit.edu) wrote: On Mon, Mar 2, 2015 at 6:36 AM, Haribabu Kommi kommi.harib...@gmail.com wrote: Loading pg_hba.conf during SIGHUP in the backends will solve the problem of displaying the data which is not yet loaded. This change may produce a warning if it

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-02 Thread Greg Stark
On Mon, Mar 2, 2015 at 6:36 AM, Haribabu Kommi kommi.harib...@gmail.com wrote: Loading pg_hba.conf during SIGHUP in the backends will solve the problem of displaying the data which is not yet loaded. This change may produce a warning if it fails to load pg_hba.conf in the backends. This

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-02 Thread Greg Stark
On Mon, Mar 2, 2015 at 1:42 PM, Greg Stark st...@mit.edu wrote: ​So earlier someone commented that using lists list_nth() seemed odd and a tuplestore might be better. In fact using lists this way is O(n^2). I've done some quick tests and it doesn't start being a problem until about 10,000

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-02 Thread Greg Stark
On Mon, Mar 2, 2015 at 4:36 PM, Greg Stark st...@mit.edu wrote: So I didn't get the memo about SFRM_Materialize. Here's a rewrite of this using that interface which seems to test ok up to 100k. At that point I start running into memory errors on reading the HBA file so I guess that's an

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-02 Thread Stephen Frost
* Greg Stark (st...@mit.edu) wrote: On Mon, Mar 2, 2015 at 4:36 PM, Greg Stark st...@mit.edu wrote: So I didn't get the memo about SFRM_Materialize. Here's a rewrite of this using that interface which seems to test ok up to 100k. At that point I start running into memory errors on

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-02 Thread Greg Stark
On Mon, Mar 2, 2015 at 7:42 PM, Stephen Frost sfr...@snowman.net wrote: Uh, maybe because it's trying to allocate over 1GB and palloc() doesn't support that? Nobody's allocating anything that big. It's a list of 25,000 pointers to 472-byte structs. That should add up to about 11MB. Instead the

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-02 Thread Alvaro Herrera
Greg Stark wrote: Hm. I'm wondering why I'm getting out of memory errors now with just 25k lines in pg_hba.conf. It looks like the HbaLine struct is only 472 bytes so the list should only be occupying about 11MB. In fact it's occupying about a gigabyte: Maybe it's leaking heavily while

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-03-01 Thread Haribabu Kommi
On Sat, Feb 28, 2015 at 11:41 AM, Stephen Frost sfr...@snowman.net wrote: Pavel, * Pavel Stehule (pavel.steh...@gmail.com) wrote: 2015-02-27 22:26 GMT+01:00 Tom Lane t...@sss.pgh.pa.us: Stephen Frost sfr...@snowman.net writes: Right, we also need a view (or function, or both) which

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Stephen Frost
* Josh Berkus (j...@agliodbs.com) wrote: On 02/27/2015 04:41 PM, Stephen Frost wrote: we can do copy of pg_hba.conf somewhere when postmaster starts or when it is reloaded. Please see my reply to Tom. There's no trivial way to reach into the postmaster from a backend- but we do get a

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Pavel Stehule
2015-02-28 3:12 GMT+01:00 Stephen Frost sfr...@snowman.net: * Josh Berkus (j...@agliodbs.com) wrote: On 02/27/2015 04:41 PM, Stephen Frost wrote: we can do copy of pg_hba.conf somewhere when postmaster starts or when it is reloaded. Please see my reply to Tom. There's no trivial

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Pavel Stehule
2015-02-28 1:41 GMT+01:00 Stephen Frost sfr...@snowman.net: Pavel, * Pavel Stehule (pavel.steh...@gmail.com) wrote: 2015-02-27 22:26 GMT+01:00 Tom Lane t...@sss.pgh.pa.us: Stephen Frost sfr...@snowman.net writes: Right, we also need a view (or function, or both) which provides what

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Pavel Stehule
2015-02-28 2:40 GMT+01:00 Tom Lane t...@sss.pgh.pa.us: Stephen Frost sfr...@snowman.net writes: I understand that there may be objections to that on the basis that it's work that's (other than for this case) basically useless, Got it in one. I'm also not terribly happy about leaving

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Tom Lane
Stephen Frost sfr...@snowman.net writes: I understand that there may be objections to that on the basis that it's work that's (other than for this case) basically useless, Got it in one. I'm also not terribly happy about leaving security-relevant data sitting around in backend memory 100% of

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: Stephen Frost sfr...@snowman.net writes: I understand that there may be objections to that on the basis that it's work that's (other than for this case) basically useless, Got it in one. Meh. It's hardly all that difficult and it's not useless if

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Josh Berkus
On 02/27/2015 04:41 PM, Stephen Frost wrote: we can do copy of pg_hba.conf somewhere when postmaster starts or when it is reloaded. Please see my reply to Tom. There's no trivial way to reach into the postmaster from a backend- but we do get a copy of whatever the postmaster had when we

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Stephen Frost
All, * Tomas Vondra (tomas.von...@2ndquadrant.com) wrote: On 28.1.2015 23:01, Jim Nasby wrote: On 1/28/15 12:46 AM, Haribabu Kommi wrote: Also, what happens if someone reloads the config in the middle of running the SRF? hba entries are reloaded only in postmaster process, not in every

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Pavel Stehule
2015-02-27 17:59 GMT+01:00 Stephen Frost sfr...@snowman.net: All, * Tomas Vondra (tomas.von...@2ndquadrant.com) wrote: On 28.1.2015 23:01, Jim Nasby wrote: On 1/28/15 12:46 AM, Haribabu Kommi wrote: Also, what happens if someone reloads the config in the middle of running the

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Tomas Vondra
On 27.2.2015 17:59, Stephen Frost wrote: All, * Tomas Vondra (tomas.von...@2ndquadrant.com) wrote: The other feature that'd be cool to have is a debugging function on top of the view, i.e. a function pg_hba_check(host, ip, db, user, pwd) showing which hba rule matched. But that's certainly

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Tomas Vondra
Hi, On 28.1.2015 23:01, Jim Nasby wrote: On 1/28/15 12:46 AM, Haribabu Kommi wrote: Also, what happens if someone reloads the config in the middle of running the SRF? hba entries are reloaded only in postmaster process, not in every backend. So there shouldn't be any problem with config

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Pavel Stehule
Hi It looks well, I have only one objection. I am not sure so function hba_settings should be in file guc.c - it has zero relation to GUC. Maybe hba.c file is better probably. Other opinions? 2015-02-27 7:30 GMT+01:00 Haribabu Kommi kommi.harib...@gmail.com: On Sat, Feb 7, 2015 at 8:26 PM,

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Josh Berkus
On 02/27/2015 10:35 AM, Stephen Frost wrote: From time to time I have to debug why are connection attempts failing, and with moderately-sized pg_hba.conf files (e.g. on database servers shared by multiple applications) that may be tricky. Identifying the rule that matched (and rejected) the

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Magnus Hagander
On Fri, Feb 27, 2015 at 12:48 PM, Tomas Vondra tomas.von...@2ndquadrant.com wrote: On 27.2.2015 17:59, Stephen Frost wrote: All, * Tomas Vondra (tomas.von...@2ndquadrant.com) wrote: The other feature that'd be cool to have is a debugging function on top of the view, i.e. a function

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Stephen Frost
* Pavel Stehule (pavel.steh...@gmail.com) wrote: 2015-02-27 17:59 GMT+01:00 Stephen Frost sfr...@snowman.net: I don't think we actually care what the current contents are from the backend's point of view- after all, when does an individual backend ever use the contents of pg_hba.conf after

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Stephen Frost
* Tomas Vondra (tomas.von...@2ndquadrant.com) wrote: On 27.2.2015 17:59, Stephen Frost wrote: All, * Tomas Vondra (tomas.von...@2ndquadrant.com) wrote: The other feature that'd be cool to have is a debugging function on top of the view, i.e. a function pg_hba_check(host, ip, db,

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Stephen Frost
* Pavel Stehule (pavel.steh...@gmail.com) wrote: this topic should be divided, please. One part - functions for loading pg_hba and translating to some table. Can be two, can be one with one parameter. It will be used probably by advanced user, and I am able to accept it like you or Tomas

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Pavel Stehule
2015-02-27 19:32 GMT+01:00 Stephen Frost sfr...@snowman.net: * Pavel Stehule (pavel.steh...@gmail.com) wrote: 2015-02-27 17:59 GMT+01:00 Stephen Frost sfr...@snowman.net: I don't think we actually care what the current contents are from the backend's point of view- after all, when does

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Tom Lane
Stephen Frost sfr...@snowman.net writes: Right, we also need a view (or function, or both) which provides what the *active* configuration of the running postmaster is. This is exactly what I was proposing (or what I was intending to, at least) with pg_hba_active, so, again, I think we're in

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Pavel Stehule
2015-02-27 22:26 GMT+01:00 Tom Lane t...@sss.pgh.pa.us: Stephen Frost sfr...@snowman.net writes: Right, we also need a view (or function, or both) which provides what the *active* configuration of the running postmaster is. This is exactly what I was proposing (or what I was intending to,

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: Stephen Frost sfr...@snowman.net writes: Right, we also need a view (or function, or both) which provides what the *active* configuration of the running postmaster is. This is exactly what I was proposing (or what I was intending to, at least) with

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-27 Thread Stephen Frost
Pavel, * Pavel Stehule (pavel.steh...@gmail.com) wrote: 2015-02-27 22:26 GMT+01:00 Tom Lane t...@sss.pgh.pa.us: Stephen Frost sfr...@snowman.net writes: Right, we also need a view (or function, or both) which provides what the *active* configuration of the running postmaster is. This is

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-26 Thread Haribabu Kommi
On Sat, Feb 7, 2015 at 8:26 PM, Pavel Stehule pavel.steh...@gmail.com wrote: Hi I am sending a review of this patch. Thanks for the review. sorry for the delay. 4. Regress tests test rules... FAILED -- missing info about new view Thanks. Corrected. My objections:

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-02-07 Thread Pavel Stehule
Hi I am sending a review of this patch. 1. We would this patch? yes. It is a good idea - checking internal view is more comfortable and faster than checking some (possibly longer) pg_hba.conf. There was no objections. 2. Scope - does this patch, what we need? yes. There was a discussion about

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-31 Thread Josh Berkus
On 01/30/2015 10:01 PM, Amit Kapila wrote: On Fri, Jan 30, 2015 at 10:58 PM, Robert Haas robertmh...@gmail.com mailto:robertmh...@gmail.com wrote: Yes. The contents of postgresql.conf are only mildly order-dependent. If you put the same setting in more than once, it matters which one is

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-30 Thread Robert Haas
On Thu, Jan 29, 2015 at 10:13 PM, Amit Kapila amit.kapil...@gmail.com wrote: I think the big problem you are mentioning can be resolved in a similar way as we have done for ALTER SYSTEM which is to have a separate file (.auto.conf) for settings done via ALTER SYSTEM command, do you see any

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-30 Thread Jim Nasby
On 1/29/15 9:13 PM, Amit Kapila wrote: Aside from Tom's concern about sets not being a good way to handle this (which I agree with), the idea of editing pg_hba.conf via SQL raises all the problems that were brought up when ALTER SYSTEM was being developed. One of the big problems is a question

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-30 Thread Amit Kapila
On Fri, Jan 30, 2015 at 10:58 PM, Robert Haas robertmh...@gmail.com wrote: On Thu, Jan 29, 2015 at 10:13 PM, Amit Kapila amit.kapil...@gmail.com wrote: I think the big problem you are mentioning can be resolved in a similar way as we have done for ALTER SYSTEM which is to have a separate

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-29 Thread Fabrízio de Royes Mello
On Wed, Jan 28, 2015 at 5:27 PM, Tom Lane t...@sss.pgh.pa.us wrote: =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= fabriziome...@gmail.com writes: But I'm thinking about this patch and would not be interesting to have a FDW to manipulate the hba file? Imagine if we are able to manipulate the HBA

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-29 Thread Jim Nasby
On 1/29/15 6:19 AM, Fabrízio de Royes Mello wrote: On Wed, Jan 28, 2015 at 5:27 PM, Tom Lane t...@sss.pgh.pa.us mailto:t...@sss.pgh.pa.us wrote: =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= fabriziome...@gmail.com mailto:fabriziome...@gmail.com writes: But I'm thinking about this patch and

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-28 Thread Jim Nasby
On 1/28/15 12:46 AM, Haribabu Kommi wrote: Also, what happens if someone reloads the config in the middle of running the SRF? hba entries are reloaded only in postmaster process, not in every backend. So there shouldn't be any problem with config file reload. Am i missing something? Ahh, good

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-28 Thread Fabrízio de Royes Mello
On Wed, Jan 28, 2015 at 4:46 AM, Haribabu Kommi kommi.harib...@gmail.com wrote: On Wed, Jan 28, 2015 at 9:47 AM, Jim Nasby jim.na...@bluetreble.com wrote: On 1/27/15 1:04 AM, Haribabu Kommi wrote: Here I attached the latest version of the patch. I will add this patch to the next

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-28 Thread Tom Lane
=?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= fabriziome...@gmail.com writes: But I'm thinking about this patch and would not be interesting to have a FDW to manipulate the hba file? Imagine if we are able to manipulate the HBA file using INSERT/UPDATE/DELETE. Since the HBA file is fundamentally

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-27 Thread Jim Nasby
On 1/27/15 1:04 AM, Haribabu Kommi wrote: On Mon, Jun 30, 2014 at 5:06 PM, Abhijit Menon-Sen a...@2ndquadrant.com wrote: I think having two columns would work. The columns could be called database and database_list and user and user_list respectively. The database column may contain one of

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-27 Thread Haribabu Kommi
On Wed, Jan 28, 2015 at 9:47 AM, Jim Nasby jim.na...@bluetreble.com wrote: On 1/27/15 1:04 AM, Haribabu Kommi wrote: Here I attached the latest version of the patch. I will add this patch to the next commitfest. Apologies if this was covered, but why isn't the IP address an inet instead of

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2015-01-26 Thread Haribabu Kommi
On Mon, Jun 30, 2014 at 5:06 PM, Abhijit Menon-Sen a...@2ndquadrant.com wrote: I think having two columns would work. The columns could be called database and database_list and user and user_list respectively. The database column may contain one of all, sameuser, samegroup, replication, but

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2014-06-30 Thread Abhijit Menon-Sen
At 2014-06-29 22:25:54 +0530, a...@2ndquadrant.com wrote: I think the really right thing to do would be to have two separate columns, one with all, sameuser, samerole, replication, or empty; and the other an array of database names. After sleeping on it, I realised that the code would return

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2014-06-29 Thread Abhijit Menon-Sen
Hi Vaishnavi. In addition to Jaime's comments about the functionality, here are are some comments about the code. Well, they were supposed to be comments about the code, but it turns out I have comments about the feature as well. We need to figure out what to do about the database and user

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2014-06-07 Thread Jaime Casanova
On Fri, Mar 14, 2014 at 12:30 AM, Prabakaran, Vaishnavi vaishna...@fast.au.fujitsu.com wrote: Hi, In connection to my previous proposal about providing catalog view to pg_hba.conf file contents , I have developed the attached patch . [...] [What this Patch does] Functionality of the

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2014-03-18 Thread Prabakaran, Vaishnavi
On Friday, Mar 14, 2014 at 9:33 PM, Maganus Hagander mag...@hagander.netmailto:mag...@hagander.net wrote: Hi, In connection to my previous proposal about providing catalog view to pg_hba.conf file contents , I have developed the attached patch . [Current situation] Currently, to view the

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2014-03-16 Thread Prabakaran, Vaishnavi
From: Magnus Hagander [mailto:mag...@hagander.net] Sent: Friday, 14 March 2014 9:33 PM To: Prabakaran, Vaishnavi Cc: PostgreSQL-development Subject: Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission On Fri, Mar 14, 2014 at 6:30 AM, Prabakaran, Vaishnavi vaishna

Re: [HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2014-03-14 Thread Magnus Hagander
On Fri, Mar 14, 2014 at 6:30 AM, Prabakaran, Vaishnavi vaishna...@fast.au.fujitsu.com wrote: Hi, In connection to my previous proposal about providing catalog view to pg_hba.conf file contents , I have developed the attached patch . [Current situation] Currently, to view the

[HACKERS] Providing catalog view to pg_hba.conf file - Patch submission

2014-03-13 Thread Prabakaran, Vaishnavi
Hi, In connection to my previous proposal about providing catalog view to pg_hba.conf file contents , I have developed the attached patch . [Current situation] Currently, to view the pg_hba.conf file contents, DB admin has to access the file from database server to read the settings. In