Re: [HACKERS] SQL access to database attributes

2014-07-01 Thread Tom Lane
Vik Fearing vik.fear...@dalibo.com writes: Okay, here is version two of the refactoring patch that documents that the with-space version is deprecated but still accepted. The feature patch is not affected by this and so I am not attaching a new version of that. I've committed this without

Re: [HACKERS] SQL access to database attributes

2014-06-30 Thread Pavel Stehule
2014-06-29 21:09 GMT+02:00 Tom Lane t...@sss.pgh.pa.us: Vik Fearing vik.fear...@dalibo.com writes: On 06/21/2014 10:11 PM, Pavel Stehule wrote: Is any reason or is acceptable incompatible change CONNECTION_LIMIT instead CONNECTION LIMIT? Is decreasing parser size about 1% good enough for

Re: [HACKERS] SQL access to database attributes

2014-06-29 Thread Tom Lane
Vik Fearing vik.fear...@dalibo.com writes: On 06/21/2014 10:11 PM, Pavel Stehule wrote: Is any reason or is acceptable incompatible change CONNECTION_LIMIT instead CONNECTION LIMIT? Is decreasing parser size about 1% good enough for breaking compatibility? How is compatibility broken? The

Re: [HACKERS] SQL access to database attributes

2014-06-26 Thread Vik Fearing
On 06/23/2014 06:45 PM, Pavel Stehule wrote: 2014-06-23 18:39 GMT+02:00 Vik Fearing vik.fear...@dalibo.com mailto:vik.fear...@dalibo.com: On 06/23/2014 06:21 PM, Robert Haas wrote: On Sun, Jun 22, 2014 at 2:59 PM, Pavel Stehule pavel.steh...@gmail.com

Re: [HACKERS] SQL access to database attributes

2014-06-23 Thread Robert Haas
On Sun, Jun 22, 2014 at 2:59 PM, Pavel Stehule pavel.steh...@gmail.com wrote: I found only one problem - first patch introduce a new property CONNECTION_LIMIT and replace previously used CONNECTION LIMIT in documentation. But CONNECTION LIMIT is still supported, but it is not documented. So

Re: [HACKERS] SQL access to database attributes

2014-06-23 Thread Vik Fearing
On 06/23/2014 06:21 PM, Robert Haas wrote: On Sun, Jun 22, 2014 at 2:59 PM, Pavel Stehule pavel.steh...@gmail.com wrote: I found only one problem - first patch introduce a new property CONNECTION_LIMIT and replace previously used CONNECTION LIMIT in documentation. But CONNECTION LIMIT is

Re: [HACKERS] SQL access to database attributes

2014-06-23 Thread Pavel Stehule
2014-06-23 18:39 GMT+02:00 Vik Fearing vik.fear...@dalibo.com: On 06/23/2014 06:21 PM, Robert Haas wrote: On Sun, Jun 22, 2014 at 2:59 PM, Pavel Stehule pavel.steh...@gmail.com wrote: I found only one problem - first patch introduce a new property CONNECTION_LIMIT and replace previously

Re: [HACKERS] SQL access to database attributes

2014-06-23 Thread Robert Haas
On Mon, Jun 23, 2014 at 12:39 PM, Vik Fearing vik.fear...@dalibo.com wrote: On 06/23/2014 06:21 PM, Robert Haas wrote: On Sun, Jun 22, 2014 at 2:59 PM, Pavel Stehule pavel.steh...@gmail.com wrote: I found only one problem - first patch introduce a new property CONNECTION_LIMIT and replace

Re: [HACKERS] SQL access to database attributes

2014-06-22 Thread Pavel Stehule
Hello I returned to review this patch after sleeping - and I have to say, these patches doesn't break a compatibility. This feature has two patches: createdb_alterdb_grammar_refactoring.v1-1.patch and database_attributes.v2-1.patch. First patch do some cleaning in gram rules a CREATE DATABASE

[HACKERS] SQL access to database attributes

2014-06-21 Thread Pavel Stehule
Hello I am looking createdb_alterdb_grammar_refactoring.v1.patch http://www.postgresql.org/message-id/53868e57.3030...@dalibo.com Is any reason or is acceptable incompatible change CONNECTION_LIMIT instead CONNECTION LIMIT? Is decreasing parser size about 1% good enough for breaking

Re: [HACKERS] SQL access to database attributes

2014-06-21 Thread Pavel Stehule
Second question related to second patch: Must be new syntax ALLOW_CONNECTIONS? Should not be (ENABLE | DISABLE) CONNECTION ? This doesn't need any new keyword. Regards Pavel 2014-06-21 22:11 GMT+02:00 Pavel Stehule pavel.steh...@gmail.com: Hello I am looking

Re: [HACKERS] SQL access to database attributes

2014-06-21 Thread Vik Fearing
On 06/21/2014 10:11 PM, Pavel Stehule wrote: Hello I am looking createdb_alterdb_grammar_refactoring.v1.patch http://www.postgresql.org/message-id/53868e57.3030...@dalibo.com Thank you for looking at this. Is any reason or is acceptable incompatible change CONNECTION_LIMIT instead

Re: [HACKERS] SQL access to database attributes

2014-06-21 Thread Vik Fearing
On 06/21/2014 10:21 PM, Pavel Stehule wrote: Second question related to second patch: Must be new syntax ALLOW_CONNECTIONS? It doesn't *have* to be called that, but that's what the corresponding column in pg_database is called so why add confusion? (Actually, it's called datallowconn but

Re: [HACKERS] SQL access to database attributes

2014-06-21 Thread Pavel Stehule
2014-06-21 23:14 GMT+02:00 Vik Fearing vik.fear...@dalibo.com: On 06/21/2014 10:11 PM, Pavel Stehule wrote: Hello I am looking createdb_alterdb_grammar_refactoring.v1.patch http://www.postgresql.org/message-id/53868e57.3030...@dalibo.com Thank you for looking at this. Is any

Re: [HACKERS] SQL access to database attributes

2014-05-28 Thread Vik Fearing
On 05/26/2014 08:19 PM, Vik Fearing wrote: On 05/26/2014 07:10 AM, Stephen Frost wrote: * Tom Lane (t...@sss.pgh.pa.us) wrote: I don't really object to doing an unlocked check for another such database, but I'm not convinced that additional locking to try to prevent a race is worth its keep.

Re: [HACKERS] SQL access to database attributes

2014-05-26 Thread Vik Fearing
On 05/26/2014 07:10 AM, Stephen Frost wrote: * Tom Lane (t...@sss.pgh.pa.us) wrote: I don't really object to doing an unlocked check for another such database, but I'm not convinced that additional locking to try to prevent a race is worth its keep. +1 on the nannyism, and +1 to ignoring the

Re: [HACKERS] SQL access to database attributes

2014-05-25 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: I don't really object to doing an unlocked check for another such database, but I'm not convinced that additional locking to try to prevent a race is worth its keep. +1 on the nannyism, and +1 to ignoring the race. Thanks,

Re: [HACKERS] SQL access to database attributes

2014-05-24 Thread Tom Lane
Vik Fearing vik.fear...@dalibo.com writes: On 05/24/2014 12:03 AM, Jaime Casanova wrote: Which lead us to the question: you need to connect to the database to modify it, don't you? then, how do you change ALLOW CONNECTIONS to true? You can ALTER DATABASE from anywhere. Perhaps it'd be wise

Re: [HACKERS] SQL access to database attributes

2014-05-24 Thread Jim Nasby
On 5/24/14, 8:14 AM, Tom Lane wrote: Vik Fearingvik.fear...@dalibo.com writes: On 05/24/2014 12:03 AM, Jaime Casanova wrote: Which lead us to the question: you need to connect to the database to modify it, don't you? then, how do you change ALLOW CONNECTIONS to true? You can ALTER DATABASE

Re: [HACKERS] SQL access to database attributes

2014-05-24 Thread Tom Lane
Jim Nasby j...@nasby.net writes: On 5/24/14, 8:14 AM, Tom Lane wrote: Perhaps it'd be wise to have a safety check to disallow turning off datallowconn for the last connectable database? Although it couldn't be bulletproof due to race conditions, so maybe that'd just be nannyism. BTW, I

[HACKERS] SQL access to database attributes

2014-05-23 Thread Vik Fearing
We try to tell our clients not to update the catalogs directly, but there are at least two instances where it's not possible to do otherwise (pg_database.datistemplate and .datallowconn). This patch aims to remedy that. For example, it is now possible to say ALTER DATABASE d ALLOW

Re: [HACKERS] SQL access to database attributes

2014-05-23 Thread Jaime Casanova
On Fri, May 23, 2014 at 10:53 PM, Vik Fearing vik.fear...@dalibo.com wrote: It was suggested to me that these options should either error out if there are existing connections or terminate said connections. I don't agree with that because there is no harm in connecting to a template database

Re: [HACKERS] SQL access to database attributes

2014-05-23 Thread Vik Fearing
On 05/24/2014 12:03 AM, Jaime Casanova wrote: On Fri, May 23, 2014 at 10:53 PM, Vik Fearing vik.fear...@dalibo.com wrote: It was suggested to me that these options should either error out if there are existing connections or terminate said connections. I don't agree with that because there is

Re: [HACKERS] SQL access to database attributes

2014-05-23 Thread Jaime Casanova
On Fri, May 23, 2014 at 11:06 PM, Vik Fearing vik.fear...@dalibo.com wrote: On 05/24/2014 12:03 AM, Jaime Casanova wrote: On Fri, May 23, 2014 at 10:53 PM, Vik Fearing vik.fear...@dalibo.com wrote: It was suggested to me that these options should either error out if there are existing