Re: [HACKERS] pg_hba_file_settings view patch

2017-01-30 Thread Michael Paquier
On Tue, Jan 31, 2017 at 12:55 PM, Haribabu Kommi wrote: > > > On Tue, Jan 31, 2017 at 10:04 AM, Tom Lane wrote: >> >> Haribabu Kommi writes: >> > On Mon, Jan 30, 2017 at 5:18 PM, Michael Paquier >> > >> > wrote: >> >> #define USER_AUTH_LAST uaPeer >> >> StaticAssertStmt(lengthof(UserAuthName) =

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-30 Thread Haribabu Kommi
On Tue, Jan 31, 2017 at 10:04 AM, Tom Lane wrote: > Haribabu Kommi writes: > > On Mon, Jan 30, 2017 at 5:18 PM, Michael Paquier < > michael.paqu...@gmail.com> > > wrote: > >> #define USER_AUTH_LAST uaPeer > >> StaticAssertStmt(lengthof(UserAuthName) == USER_AUTH_LAST + 1, > >> "UserAuthName must

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-30 Thread Tom Lane
Haribabu Kommi writes: > On Mon, Jan 30, 2017 at 5:18 PM, Michael Paquier > wrote: >> #define USER_AUTH_LAST uaPeer >> StaticAssertStmt(lengthof(UserAuthName) == USER_AUTH_LAST + 1, >> "UserAuthName must include all user authentication names"); > Thanks for the review. Added the static assert st

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-30 Thread Haribabu Kommi
On Mon, Jan 30, 2017 at 5:18 PM, Michael Paquier wrote: > On Mon, Jan 30, 2017 at 11:20 AM, Haribabu Kommi > wrote: > > On Sun, Jan 29, 2017 at 9:18 AM, Tom Lane wrote: > >> tgl wrote: > >> > I spent awhile hacking on this, and made a lot of things better, but > >> > I'm still very unhappy abou

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-29 Thread Michael Paquier
On Mon, Jan 30, 2017 at 11:20 AM, Haribabu Kommi wrote: > On Sun, Jan 29, 2017 at 9:18 AM, Tom Lane wrote: >> tgl wrote: >> > I spent awhile hacking on this, and made a lot of things better, but >> > I'm still very unhappy about the state of the comments. >> >> I made another pass over this, work

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-29 Thread Haribabu Kommi
On Sun, Jan 29, 2017 at 9:18 AM, Tom Lane wrote: > I wrote: > > I spent awhile hacking on this, and made a lot of things better, but > > I'm still very unhappy about the state of the comments. > > I made another pass over this, working on the comments and the docs, > and changing the view name to

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-28 Thread Tom Lane
I wrote: > I spent awhile hacking on this, and made a lot of things better, but > I'm still very unhappy about the state of the comments. I made another pass over this, working on the comments and the docs, and changing the view name to "pg_hba_file_rules". I think this version is committable if

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-28 Thread Tom Lane
I wrote: > I'm still not very happy about the choice of view name ... After looking over this thread again, I think that we should go with pg_file_hba_rules or perhaps pg_hba_file_rules. I see that options like that were discussed and rejected earlier, but I feel the arguments against were based

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-27 Thread Tom Lane
Haribabu Kommi writes: > [ pg_hba_rules_13.patch ] I spent awhile hacking on this, and made a lot of things better, but I'm still very unhappy about the state of the comments. You changed the APIs of a bunch of functions, often into fairly subtle things, and you did not touch even one of their A

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-27 Thread Haribabu Kommi
On Sat, Jan 28, 2017 at 5:47 AM, Tom Lane wrote: > Haribabu Kommi writes: > > On Fri, Jan 27, 2017 at 1:36 AM, Tom Lane wrote: > >> It might make sense to proceed by writing a separate patch that just > >> refactors the existing code to have an API like that, and then revise > >> this patch to

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-27 Thread Robert Haas
On Fri, Jan 20, 2017 at 4:01 PM, Tom Lane wrote: > * I'm not really on board with patches modifying pgindent/typedefs.list > retail. To my mind that file represents the typedefs used the last > time we pgindent'd the whole tree, and if you want an up-to-date list > you should ask the buildfarm.

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-27 Thread Tom Lane
Haribabu Kommi writes: > On Fri, Jan 27, 2017 at 1:36 AM, Tom Lane wrote: >> It might make sense to proceed by writing a separate patch that just >> refactors the existing code to have an API like that, and then revise >> this patch to add an error message field to the per-line struct. Or >> may

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-27 Thread Haribabu Kommi
On Fri, Jan 27, 2017 at 1:36 AM, Tom Lane wrote: > Haribabu Kommi writes: > > This patch currently doesn't have the code for reporting the two log > > messages that can occur in tokenize_file function. To support the same, > > I am thinking of changing line_nums list to line_info list that can >

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-26 Thread Michael Paquier
On Thu, Jan 26, 2017 at 11:36 PM, Tom Lane wrote: > Haribabu Kommi writes: >> This patch currently doesn't have the code for reporting the two log >> messages that can occur in tokenize_file function. To support the same, >> I am thinking of changing line_nums list to line_info list that can >> c

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-26 Thread Tom Lane
Haribabu Kommi writes: > This patch currently doesn't have the code for reporting the two log > messages that can occur in tokenize_file function. To support the same, > I am thinking of changing line_nums list to line_info list that can > contain both line number and the error message that occurr

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-26 Thread Haribabu Kommi
On Thu, Jan 26, 2017 at 4:32 AM, Tom Lane wrote: > Ashutosh Bapat writes: > > On Wed, Jan 25, 2017 at 9:58 AM, Haribabu Kommi > > wrote: > >> All the ereport messages of level are LOG, because of this reason, > because > >> of this reason even if we use the TRY/CATCH, it doesn't work. As the >

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-25 Thread Michael Paquier
On Thu, Jan 26, 2017 at 2:32 AM, Tom Lane wrote: > The way I'd be inclined to make the individual reporting changes is like > > if (!EnableSSL) > +{ > - ereport(LOG, > + ereport(elevel, > (errcode(ERRCODE_CONFIG_FILE_ERR

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-25 Thread Tom Lane
Ashutosh Bapat writes: > On Wed, Jan 25, 2017 at 9:58 AM, Haribabu Kommi > wrote: >> All the ereport messages of level are LOG, because of this reason, because >> of this reason even if we use the TRY/CATCH, it doesn't work. As the >> messages gets printed to the logfile and continue to process

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-24 Thread Haribabu Kommi
On Tue, Jan 24, 2017 at 6:17 PM, Michael Paquier wrote: > On Mon, Jan 23, 2017 at 5:13 PM, Haribabu Kommi > wrote: > > On Sat, Jan 21, 2017 at 8:01 AM, Tom Lane wrote: > >> * I'm not exactly convinced that the way you approached the error > message > >> reporting, ie duplicating the logged mess

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-24 Thread Ashutosh Bapat
On Wed, Jan 25, 2017 at 9:58 AM, Haribabu Kommi wrote: > > > On Wed, Jan 25, 2017 at 2:50 PM, Ashutosh Bapat > wrote: >> >> On Wed, Jan 25, 2017 at 6:34 AM, Michael Paquier >> wrote: >> > On Tue, Jan 24, 2017 at 11:19 PM, Ashutosh Bapat >> > wrote: >> >> On Mon, Jan 23, 2017 at 1:43 PM, Haribab

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-24 Thread Haribabu Kommi
On Wed, Jan 25, 2017 at 2:50 PM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > On Wed, Jan 25, 2017 at 6:34 AM, Michael Paquier > wrote: > > On Tue, Jan 24, 2017 at 11:19 PM, Ashutosh Bapat > > wrote: > >> On Mon, Jan 23, 2017 at 1:43 PM, Haribabu Kommi > >> wrote: > >>> > >>> > >>

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-24 Thread Ashutosh Bapat
On Wed, Jan 25, 2017 at 6:34 AM, Michael Paquier wrote: > On Tue, Jan 24, 2017 at 11:19 PM, Ashutosh Bapat > wrote: >> On Mon, Jan 23, 2017 at 1:43 PM, Haribabu Kommi >> wrote: >>> >>> >>> On Sat, Jan 21, 2017 at 8:01 AM, Tom Lane wrote: Haribabu Kommi writes: > [ pg_hba_rules_1

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-24 Thread Michael Paquier
On Tue, Jan 24, 2017 at 11:19 PM, Ashutosh Bapat wrote: > On Mon, Jan 23, 2017 at 1:43 PM, Haribabu Kommi > wrote: >> >> >> On Sat, Jan 21, 2017 at 8:01 AM, Tom Lane wrote: >>> >>> Haribabu Kommi writes: >>> > [ pg_hba_rules_10.patch ] >>> >>> I took a quick look over this. >> >> >> Thanks for

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-24 Thread Ashutosh Bapat
On Mon, Jan 23, 2017 at 1:43 PM, Haribabu Kommi wrote: > > > On Sat, Jan 21, 2017 at 8:01 AM, Tom Lane wrote: >> >> Haribabu Kommi writes: >> > [ pg_hba_rules_10.patch ] >> >> I took a quick look over this. > > > Thanks for the review. > >> >> * I'm not exactly convinced that the way you approac

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-23 Thread Michael Paquier
On Mon, Jan 23, 2017 at 5:13 PM, Haribabu Kommi wrote: > On Sat, Jan 21, 2017 at 8:01 AM, Tom Lane wrote: >> * I'm not exactly convinced that the way you approached the error message >> reporting, ie duplicating the logged message, is good. In particular >> this results in localizing the strings

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-23 Thread Haribabu Kommi
On Sat, Jan 21, 2017 at 8:01 AM, Tom Lane wrote: > Haribabu Kommi writes: > > [ pg_hba_rules_10.patch ] > > I took a quick look over this. > Thanks for the review. > * I'm not exactly convinced that the way you approached the error message > reporting, ie duplicating the logged message, is go

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-20 Thread Tom Lane
Haribabu Kommi writes: > [ pg_hba_rules_10.patch ] I took a quick look over this. * I'm not exactly convinced that the way you approached the error message reporting, ie duplicating the logged message, is good. In particular this results in localizing the strings reported in pg_hba_rules.error,

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-19 Thread Ashutosh Bapat
On Fri, Jan 20, 2017 at 12:46 PM, Michael Paquier wrote: > On Fri, Jan 20, 2017 at 10:56 AM, Haribabu Kommi > wrote: >> The Assert case can be hit only, when the user added to new options to >> display >> to the user through view but not updating the macro to the max number of >> options then, it

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-19 Thread Michael Paquier
On Fri, Jan 20, 2017 at 10:56 AM, Haribabu Kommi wrote: > The Assert case can be hit only, when the user added to new options to > display > to the user through view but not updating the macro to the max number of > options then, it can lead to that assert. > > Updated patch attached including rev

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-19 Thread Haribabu Kommi
On Thu, Jan 19, 2017 at 11:28 PM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > On Thu, Jan 19, 2017 at 1:26 PM, Michael Paquier > wrote: > > On Thu, Jan 19, 2017 at 4:25 PM, Haribabu Kommi > > wrote: > >> Added the cleanup mechanism. But the tokenize_file() function call > >> prese

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-19 Thread Michael Paquier
On Thu, Jan 19, 2017 at 9:28 PM, Ashutosh Bapat wrote: > On Thu, Jan 19, 2017 at 1:26 PM, Michael Paquier > wrote: >> On Thu, Jan 19, 2017 at 4:25 PM, Haribabu Kommi >> wrote: >>> Added the cleanup mechanism. But the tokenize_file() function call >>> present in many places, But in one flow still

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-19 Thread Ashutosh Bapat
On Thu, Jan 19, 2017 at 1:26 PM, Michael Paquier wrote: > On Thu, Jan 19, 2017 at 4:25 PM, Haribabu Kommi > wrote: >> Added the cleanup mechanism. But the tokenize_file() function call >> present in many places, But in one flow still it is possible to have >> file descriptor leak because of pg_hb

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-18 Thread Michael Paquier
On Thu, Jan 19, 2017 at 4:25 PM, Haribabu Kommi wrote: > Added the cleanup mechanism. But the tokenize_file() function call > present in many places, But in one flow still it is possible to have > file descriptor leak because of pg_hba_rules view. Because of this > reason, added the cleanup everyw

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-18 Thread Haribabu Kommi
On Thu, Jan 19, 2017 at 4:08 PM, Michael Paquier wrote: > On Wed, Jan 18, 2017 at 4:11 PM, Haribabu Kommi > wrote: > > updated patch attached. > > Thanks for the new version. > > > Added tap tests patch also attached. > > This begins to look really nice. I am having fun torturing it :) > Thanks

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-18 Thread Michael Paquier
On Wed, Jan 18, 2017 at 4:11 PM, Haribabu Kommi wrote: > updated patch attached. Thanks for the new version. > Added tap tests patch also attached. This begins to look really nice. I am having fun torturing it :) Here are I think my last comments: + linecxt = tokenize_file(HbaFileName, file

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-17 Thread Haribabu Kommi
On Tue, Jan 17, 2017 at 5:24 PM, Michael Paquier wrote: > On Tue, Jan 17, 2017 at 10:19 AM, Haribabu Kommi > wrote: > > On Tue, Jan 10, 2017 at 6:35 PM, Michael Paquier < > michael.paqu...@gmail.com> > > wrote: > >> +/* LDAP supports 10 currently, keep this well above the most any > >> method ne

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-16 Thread Michael Paquier
On Tue, Jan 17, 2017 at 10:19 AM, Haribabu Kommi wrote: > On Tue, Jan 10, 2017 at 6:35 PM, Michael Paquier > wrote: >> +/* LDAP supports 10 currently, keep this well above the most any >> method needs */ >> +#define MAX_OPTIONS 12 >> Er, why? There is an assert already, that should be enough. > >

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-16 Thread Haribabu Kommi
On Tue, Jan 10, 2017 at 6:35 PM, Michael Paquier wrote: > On Thu, Jan 5, 2017 at 1:58 PM, Michael Paquier > wrote: > > Could you hold on a bit to commit that? I'd like to look at it in more > > details. At quick glance, there is for example no need to use > > CreateTemplateTupleDesc and list the

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-09 Thread Michael Paquier
On Thu, Jan 5, 2017 at 1:58 PM, Michael Paquier wrote: > Could you hold on a bit to commit that? I'd like to look at it in more > details. At quick glance, there is for example no need to use > CreateTemplateTupleDesc and list the columns both in pg_proc.h and the > C routine itself. And memset()

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-08 Thread Haribabu Kommi
On Tue, Nov 29, 2016 at 9:15 PM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > Here's backtrace and some debugging information > Program terminated with signal 11, Segmentation fault. > #0 0x007f96cd in shm_mq_sendv (mqh=0x121e998, > iov=0x7ffc9b7b79f0, iovcnt=2, nowait=1 '\0

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-04 Thread Michael Paquier
On Thu, Jan 5, 2017 at 5:10 AM, Simon Riggs wrote: > On 4 January 2017 at 03:54, Haribabu Kommi wrote: > >> Latest patch is attached. > > The "method" column should be called "auth" or "auth_method" or > "authentication" > > I think we should have some tests, but I'll hear your views on that. >

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-04 Thread Simon Riggs
On 4 January 2017 at 03:54, Haribabu Kommi wrote: > Latest patch is attached. The "method" column should be called "auth" or "auth_method" or "authentication" I think we should have some tests, but I'll hear your views on that. Perhaps we can include a test/sample pg_hba.conf for use in tests.

Re: [HACKERS] pg_hba_file_settings view patch

2017-01-03 Thread Haribabu Kommi
On Tue, Nov 29, 2016 at 9:15 PM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > Here's backtrace and some debugging information > Program terminated with signal 11, Segmentation fault. > #0 0x007f96cd in shm_mq_sendv (mqh=0x121e998, > iov=0x7ffc9b7b79f0, iovcnt=2, nowait=1 '\0

Re: [HACKERS] pg_hba_file_settings view patch

2016-11-29 Thread Ashutosh Bapat
Here's backtrace and some debugging information Program terminated with signal 11, Segmentation fault. #0 0x007f96cd in shm_mq_sendv (mqh=0x121e998, iov=0x7ffc9b7b79f0, iovcnt=2, nowait=1 '\001') at shm_mq.c:357 357Assert(mq->mq_sender == MyProc); (gdb) where #0 0x007f96cd

Re: [HACKERS] pg_hba_file_settings view patch

2016-11-29 Thread Haribabu Kommi
On Tue, Nov 22, 2016 at 9:46 PM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > > It could be because of some un-initialised variable, which is > initialized appropriately by default on your machine but not on my > machine. I first applied your pg_hba_rules... patch, ran regression. >

Re: [HACKERS] pg_hba_file_settings view patch

2016-11-22 Thread Ashutosh Bapat
On Fri, Nov 18, 2016 at 12:23 PM, Haribabu Kommi wrote: > > > On Thu, Nov 17, 2016 at 10:13 PM, Ashutosh Bapat > wrote: >> >> On Wed, Nov 16, 2016 at 4:40 PM, Ashutosh Bapat >> wrote: >> > make check run with this patch shows server crashes. regression.out >> > attached. I have run make check af

Re: [HACKERS] pg_hba_file_settings view patch

2016-11-17 Thread Haribabu Kommi
On Thu, Nov 17, 2016 at 10:13 PM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > On Wed, Nov 16, 2016 at 4:40 PM, Ashutosh Bapat > wrote: > > make check run with this patch shows server crashes. regression.out > > attached. I have run make check after a clean build, tried building it

Re: [HACKERS] pg_hba_file_settings view patch

2016-11-17 Thread Ashutosh Bapat
On Wed, Nov 16, 2016 at 4:40 PM, Ashutosh Bapat wrote: > make check run with this patch shows server crashes. regression.out > attached. I have run make check after a clean build, tried building it > after running configure, but the problem is always reproducible. Do > you see this problem? > > Al

Re: [HACKERS] pg_hba_file_settings view patch

2016-11-16 Thread Ashutosh Bapat
make check run with this patch shows server crashes. regression.out attached. I have run make check after a clean build, tried building it after running configure, but the problem is always reproducible. Do you see this problem? Also the patch has a white space error. git diff --check src/backend/

Re: [HACKERS] pg_hba_file_settings view patch

2016-11-09 Thread Haribabu Kommi
On Mon, Nov 7, 2016 at 3:36 PM, Michael Paquier wrote: > On Mon, Nov 7, 2016 at 12:36 PM, Haribabu Kommi > wrote: > > The added regression test fails for the cases where the server is loaded > > with > > different pg_hba.conf rules during installcheck verification. Updated > patch > > is > > att

Re: [HACKERS] pg_hba_file_settings view patch

2016-11-06 Thread Michael Paquier
On Mon, Nov 7, 2016 at 12:36 PM, Haribabu Kommi wrote: > The added regression test fails for the cases where the server is loaded > with > different pg_hba.conf rules during installcheck verification. Updated patch > is > attached with removing those tests. That's not a full review as I just glan

Re: [HACKERS] pg_hba_file_settings view patch

2016-11-06 Thread Haribabu Kommi
On Fri, Oct 28, 2016 at 4:55 PM, Haribabu Kommi wrote: > > > On Fri, Oct 28, 2016 at 4:17 AM, Alvaro Herrera > wrote: > >> Greg Stark wrote: >> >> > The fundamental problem is that the pga_hba.conf file has some bits of >> > complex structure that aren't easily captured by linear arrays. The >>

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-27 Thread Haribabu Kommi
On Fri, Oct 28, 2016 at 4:17 AM, Alvaro Herrera wrote: > Greg Stark wrote: > > > The fundamental problem is that the pga_hba.conf file has some bits of > > complex structure that aren't easily captured by linear arrays. The > > problem I struggled with most was the keywords like "all", "samerole"

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-27 Thread Alvaro Herrera
Greg Stark wrote: > The fundamental problem is that the pga_hba.conf file has some bits of > complex structure that aren't easily captured by linear arrays. The > problem I struggled with most was the keywords like "all", "samerole", > and "replication". A simple array of text makes it awkward to

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-26 Thread Greg Stark
On Wed, Oct 26, 2016 at 11:04 PM, Joshua D. Drake wrote: > On 10/26/2016 12:54 PM, Josh Berkus wrote: >> I mean, I'm not particularly in favor of using JSON for this (arrays >> seem OK), but that seems like an invalid reason not to. > > -1 to JSON for this. Sigh. Well I tried to review this patc

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-26 Thread Michael Paquier
On Thu, Oct 27, 2016 at 5:11 AM, Tom Lane wrote: > Josh Berkus writes: >> On 10/26/2016 12:24 PM, Tom Lane wrote: >>> I concur. JSON isn't a core datatype and I don't want to see it treated >>> as one. We should redesign this view so that it doesn't rely on anything >>> more advanced than array

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-26 Thread Tom Lane
Josh Berkus writes: > On 10/26/2016 12:24 PM, Tom Lane wrote: >> I concur. JSON isn't a core datatype and I don't want to see it treated >> as one. We should redesign this view so that it doesn't rely on anything >> more advanced than arrays. > Huh? Sure it is. Ships in PostgreSQL-core. To

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-26 Thread Joshua D. Drake
On 10/26/2016 12:54 PM, Josh Berkus wrote: On 10/26/2016 12:24 PM, Tom Lane wrote: Robert Haas writes: FWIW, I'm -1 on using JSON here. I don't believe that we should start using JSON all over the place just because we can. If we do that, we'll end up with a mishmash of styles, and maybe loo

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-26 Thread Josh Berkus
On 10/26/2016 12:24 PM, Tom Lane wrote: > Robert Haas writes: >> FWIW, I'm -1 on using JSON here. I don't believe that we should start >> using JSON all over the place just because we can. If we do that, >> we'll end up with a mishmash of styles, and maybe look silly when JSON >> is replaced by

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-26 Thread Tom Lane
Robert Haas writes: > FWIW, I'm -1 on using JSON here. I don't believe that we should start > using JSON all over the place just because we can. If we do that, > we'll end up with a mishmash of styles, and maybe look silly when JSON > is replaced by the new and much better SDGJHSDR format. I co

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-26 Thread Robert Haas
On Tue, Oct 25, 2016 at 3:23 AM, Alvaro Herrera wrote: > Haribabu Kommi wrote: >> On Mon, Oct 3, 2016 at 3:51 PM, Michael Paquier >> wrote: > >> Yes, I agree that adding these JSONB utility functions for this view >> is an overkill, but I thought that these are may be useful for some >> users if

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-25 Thread Alvaro Herrera
Haribabu Kommi wrote: > On Mon, Oct 3, 2016 at 3:51 PM, Michael Paquier > wrote: > Yes, I agree that adding these JSONB utility functions for this view > is an overkill, but I thought that these are may be useful for some > users if it is a JSONB type instead of array. Peter Eisentraut said he'd

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-24 Thread Haribabu Kommi
On Mon, Oct 3, 2016 at 3:51 PM, Michael Paquier wrote: > On Mon, Sep 5, 2016 at 4:09 PM, Haribabu Kommi > wrote: > > On Sun, Sep 4, 2016 at 1:44 AM, Simon Riggs > wrote: > >> On 15 August 2016 at 12:17, Haribabu Kommi > >> wrote: > >> > >> > comments? > >> > >> This looks like a good feature c

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-03 Thread Vitaly Burovoy
On 10/2/16, Michael Paquier wrote: > On Mon, Oct 3, 2016 at 3:25 PM, Vitaly Burovoy > wrote: >> I guess for ability to use filtering like: >> >> SELECT * FROM pg_hba_rules WHERE options->>radiusserver LIKE >> '%.example.com'; >> >> I think it would be harder if options is an array of strings... >

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-02 Thread Michael Paquier
On Mon, Oct 3, 2016 at 3:25 PM, Vitaly Burovoy wrote: > I guess for ability to use filtering like: > > SELECT * FROM pg_hba_rules WHERE options->>radiusserver LIKE '%.example.com'; > > I think it would be harder if options is an array of strings... With unnest() and a matching pattern, not that h

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-02 Thread Vitaly Burovoy
On 10/2/16, Michael Paquier wrote: > + push_jsonb_string_key(&parseState, "map"); > + push_jsonb_string_value(&parseState, hba->usermap); > [...] > + > + options > + jsonb > + Configuration options set for authentication method > + > Why is it an advantage to use js

Re: [HACKERS] pg_hba_file_settings view patch

2016-10-02 Thread Michael Paquier
On Mon, Sep 5, 2016 at 4:09 PM, Haribabu Kommi wrote: > On Sun, Sep 4, 2016 at 1:44 AM, Simon Riggs wrote: >> On 15 August 2016 at 12:17, Haribabu Kommi >> wrote: >> >> > comments? >> >> This looks like a good feature contribution, thanks. >> >> At present the patch doesn't apply cleanly, please

Re: [HACKERS] pg_hba_file_settings view patch

2016-09-05 Thread Haribabu Kommi
On Sun, Sep 4, 2016 at 1:44 AM, Simon Riggs wrote: > On 15 August 2016 at 12:17, Haribabu Kommi > wrote: > > > comments? > > This looks like a good feature contribution, thanks. > > At present the patch doesn't apply cleanly, please rebase. > Rebased patch is attached. > The patch doesn't con

Re: [HACKERS] pg_hba_file_settings view patch

2016-09-04 Thread Christoph Berg
Re: Simon Riggs 2016-09-03 > pg_hba_file_settings seems a clumsy name. I'd prefer pg_hba_settings, > since that name could live longer than the concept of pg_hba.conf, > which seems likely to become part of ALTER SYSTEM in future, so we > wouldn't really want the word "file" in there. IMHO "sett

Re: [HACKERS] pg_hba_file_settings view patch

2016-09-03 Thread Simon Riggs
On 15 August 2016 at 12:17, Haribabu Kommi wrote: > comments? This looks like a good feature contribution, thanks. At present the patch doesn't apply cleanly, please rebase. The patch doesn't contain any tests, which means I can't see what the output looks like, so I can't judge the exact usef

[HACKERS] pg_hba_file_settings view patch

2016-08-15 Thread Haribabu Kommi
Hi All, While working on pg_hba_lookup function that can be used to lookup for an client authentication that can be matched for given input parameters, Tom raised some concrete use case issues in the following mail [1]. In this same thread, he raised some advantages of having a view similar like p