Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-28 Thread Alvaro Herrera
Excerpts from Pavel Stehule's message of dom jun 26 13:10:13 -0400 2011: Hello I have touched next_token() and next_token_expand() a bit more, because it seemed to me that they could be simplified further (the bit about returning the comma in the token, instead of being a boolean

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-28 Thread Pavel Stehule
2011/6/28 Alvaro Herrera alvhe...@commandprompt.com: Excerpts from Pavel Stehule's message of dom jun 26 13:10:13 -0400 2011: Hello I have touched next_token() and next_token_expand() a bit more, because it seemed to me that they could be simplified further (the bit about returning the

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-28 Thread Alvaro Herrera
Excerpts from Pavel Stehule's message of mar jun 28 16:19:02 -0400 2011: there should be a format (syntax) error. If somebody breaks a pg_ident and will do a reload, then all ident mapping is lost. No, the file is not actually parsed until the auth verification runs. The incorrect tokens are

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-28 Thread Pavel Stehule
2011/6/28 Alvaro Herrera alvhe...@commandprompt.com: Excerpts from Pavel Stehule's message of mar jun 28 16:19:02 -0400 2011: there should be a format (syntax) error. If somebody breaks a pg_ident and will do a reload, then all ident mapping is lost. No, the file is not actually parsed until

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-26 Thread Pavel Stehule
Hello I have touched next_token() and next_token_expand() a bit more, because it seemed to me that they could be simplified further (the bit about returning the comma in the token, instead of being a boolean return, seemed strange).  Please let me know what you think. I am thinking, so it

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-23 Thread Brendan Jurd
On 24 June 2011 03:48, Alvaro Herrera alvhe...@commandprompt.com wrote: I have touched next_token() and next_token_expand() a bit more, because it seemed to me that they could be simplified further (the bit about returning the comma in the token, instead of being a boolean return, seemed

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Alvaro Herrera
Excerpts from Pavel Stehule's message of mar jun 21 00:59:44 -0400 2011: yes - it has a sense. Quoting changes sense from keyword to literal. But then I see a significant inconsistency - every know keywords should be only tokens. else if (strcmp(token, pamservice) == 0) -

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Pavel Stehule
2011/6/21 Alvaro Herrera alvhe...@commandprompt.com: Excerpts from Pavel Stehule's message of mar jun 21 00:59:44 -0400 2011: yes - it has a sense. Quoting changes sense from keyword to literal. But then I see a significant inconsistency - every know keywords should be only tokens.        

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Alvaro Herrera
Excerpts from Pavel Stehule's message of mar jun 21 10:04:26 -0400 2011: 2011/6/21 Alvaro Herrera alvhe...@commandprompt.com: Excerpts from Pavel Stehule's message of mar jun 21 00:59:44 -0400 2011: yes - it has a sense. Quoting changes sense from keyword to literal. But then I see a

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Pavel Stehule
2011/6/21 Alvaro Herrera alvhe...@commandprompt.com: Excerpts from Pavel Stehule's message of mar jun 21 10:04:26 -0400 2011: 2011/6/21 Alvaro Herrera alvhe...@commandprompt.com: Excerpts from Pavel Stehule's message of mar jun 21 00:59:44 -0400 2011: yes - it has a sense. Quoting changes

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Ross J. Reedstrom
On Tue, Jun 21, 2011 at 10:15:50AM -0400, Alvaro Herrera wrote: Excerpts from Pavel Stehule's message of mar jun 21 10:04:26 -0400 2011: 2011/6/21 Alvaro Herrera alvhe...@commandprompt.com: Excerpts from Pavel Stehule's message of mar jun 21 00:59:44 -0400 2011: yes - it has a sense.

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Pavel Stehule's message of mar jun 21 00:59:44 -0400 2011: because pamservice - is known keyword, but 'pamservice' is some literal without any mean. You should to use a makro token_is_keyword more often. Yeah, I wondered about

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Pavel Stehule
2011/6/21 Tom Lane t...@sss.pgh.pa.us: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Pavel Stehule's message of mar jun 21 00:59:44 -0400 2011: because pamservice - is known keyword, but 'pamservice' is some literal without any mean. You should to use a makro token_is_keyword

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Alvaro Herrera
Excerpts from Pavel Stehule's message of mar jun 21 11:04:11 -0400 2011: 2011/6/21 Tom Lane t...@sss.pgh.pa.us: AFAICS, this is only important in places where the syntax allows either a keyword or an identifier.  If only a keyword is possible, there is no value in rejecting it because it's

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Pavel Stehule
2011/6/21 Alvaro Herrera alvhe...@commandprompt.com: Excerpts from Pavel Stehule's message of mar jun 21 11:04:11 -0400 2011: 2011/6/21 Tom Lane t...@sss.pgh.pa.us: AFAICS, this is only important in places where the syntax allows either a keyword or an identifier.  If only a keyword is

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Robert Haas
On Jun 21, 2011, at 12:41 PM, Alvaro Herrera alvhe...@commandprompt.com wrote: On the contrary -- we should support it but not document it. +1. ...Robert -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Brendan Jurd
On 22 June 2011 00:47, Tom Lane t...@sss.pgh.pa.us wrote: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Pavel Stehule's message of mar jun 21 00:59:44 -0400 2011: because pamservice - is known keyword, but 'pamservice' is some literal without any mean. You should to use a

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Pavel Stehule
2011/6/22 Brendan Jurd dire...@gmail.com: On 22 June 2011 00:47, Tom Lane t...@sss.pgh.pa.us wrote: Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Pavel Stehule's message of mar jun 21 00:59:44 -0400 2011: because pamservice - is known keyword, but 'pamservice' is some

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-21 Thread Brendan Jurd
On 22 June 2011 14:01, Pavel Stehule pavel.steh...@gmail.com wrote: ook, now is clean, so this is majority opinion. Please, can you send a final patch. I don't have any further changes to add to Alvaro's version 3, which is already up on the CF app. Cheers, BJ -- Sent via pgsql-hackers

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-20 Thread Pavel Stehule
Hello Brendan, I checked your patch, it is applied cleanly and I don't see any mayor problem. This patch does all what is expected. I have two minor comments a) you don't use macro token_matches consistently func: parse_hba_line --if (strcmp(token-string, local) == 0) should be if

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-20 Thread Pavel Stehule
sorry a) you don't use macro token_matches consistently should be a) you don't use macro token_is_keyword consistently it should be used for all keywords Regards Pavel Stehule -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-20 Thread Alvaro Herrera
Excerpts from Pavel Stehule's message of lun jun 20 11:34:25 -0400 2011: b) probably you can simplify a memory management using own two persistent memory context - and you can swap it. Then functions like free_hba_record, clean_hba_list, free_lines should be removed. Yeah, I reworked the

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-20 Thread Brendan Jurd
On 21 June 2011 06:06, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Alvaro Herrera's message of lun jun 20 12:19:37 -0400 2011: Excerpts from Pavel Stehule's message of lun jun 20 11:34:25 -0400 2011: b) probably you can simplify a memory management using own two

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-20 Thread Alvaro Herrera
Excerpts from Brendan Jurd's message of lun jun 20 20:06:39 -0400 2011: On 21 June 2011 06:06, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Alvaro Herrera's message of lun jun 20 12:19:37 -0400 2011: Excerpts from Pavel Stehule's message of lun jun 20 11:34:25 -0400 2011:

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-20 Thread Brendan Jurd
On 21 June 2011 11:11, Alvaro Herrera alvhe...@commandprompt.com wrote: I realize I took out most of the fun of this patch from you, but -- are you still planning to do some more exhaustive testing of it?  I checked some funny scenarios (including include files and groups) but it's not all

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-20 Thread Pavel Stehule
2011/6/20 Alvaro Herrera alvhe...@commandprompt.com: Excerpts from Alvaro Herrera's message of lun jun 20 12:19:37 -0400 2011: Excerpts from Pavel Stehule's message of lun jun 20 11:34:25 -0400 2011: b) probably you can simplify a memory management using own two persistent memory context -

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-20 Thread Brendan Jurd
On 21 June 2011 13:51, Pavel Stehule pavel.steh...@gmail.com wrote: I have one question. I can't find any rules for work with tokens, etc, where is quotes allowed and disallowed? I don't see any other issues. I'm not sure I understand your question, but quotes are allowed anywhere and they

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-20 Thread Pavel Stehule
2011/6/21 Brendan Jurd dire...@gmail.com: On 21 June 2011 13:51, Pavel Stehule pavel.steh...@gmail.com wrote: I have one question. I can't find any rules for work with tokens, etc, where is quotes allowed and disallowed? I don't see any other issues. I'm not sure I understand your question,

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-20 Thread Brendan Jurd
On 21 June 2011 14:34, Pavel Stehule pavel.steh...@gmail.com wrote: I don't understand to using a macro #define token_is_keyword(t, k)  (!t-quoted strcmp(t-string, k) == 0) because you disallowed a quoting? Well, a token can only be treated as a special keyword if it is unquoted. As an

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-20 Thread Pavel Stehule
2011/6/21 Brendan Jurd dire...@gmail.com: On 21 June 2011 14:34, Pavel Stehule pavel.steh...@gmail.com wrote: I don't understand to using a macro #define token_is_keyword(t, k)  (!t-quoted strcmp(t-string, k) == 0) because you disallowed a quoting? Well, a token can only be treated as a

[HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-17 Thread Brendan Jurd
On 16 June 2011 00:22, Pavel Stehule pavel.steh...@gmail.com wrote: I try to apply your patch, but it is finished with some failed hinks. Please, can you refresh your patch Hi Pavel, Thanks for taking a look.  I have attached v2 of the patch, as against current HEAD.  I've also added the new

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-17 Thread Alvaro Herrera
Excerpts from Brendan Jurd's message of vie jun 17 19:31:41 -0400 2011: On 16 June 2011 00:22, Pavel Stehule pavel.steh...@gmail.com wrote: I try to apply your patch, but it is finished with some failed hinks. Please, can you refresh your patch Hi Pavel, Thanks for taking a look.  I

Re: [HACKERS] Fwd: Keywords in pg_hba.conf should be field-specific

2011-06-17 Thread Brendan Jurd
On 18 June 2011 13:43, Alvaro Herrera alvhe...@commandprompt.com wrote: Is this really a WIP patch?  I'm playing a bit with it currently, seems fairly sane. In this case, the WIP designation is meant to convey warning: only casual testing has beeen done. I tried it out with various