Re: [HACKERS] SQL access to database attributes

2014-07-01 Thread Tom Lane
Vik Fearing 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 the changes to expose

Re: [HACKERS] SQL access to database attributes

2014-06-30 Thread Pavel Stehule
2014-06-29 21:09 GMT+02:00 Tom Lane : > Vik Fearing 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? > >

Re: [HACKERS] SQL access to database attributes

2014-06-29 Thread Tom Lane
Vik Fearing 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 grammar still ac

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 >: > > On 06/23/2014 06:21 PM, Robert Haas wrote: > > On Sun, Jun 22, 2014 at 2:59 PM, Pavel Stehule > mailto:pavel.steh...@gmail.com>> wrote: > >> I found

Re: [HACKERS] SQL access to database attributes

2014-06-23 Thread Robert Haas
On Mon, Jun 23, 2014 at 12:39 PM, Vik Fearing wrote: > On 06/23/2014 06:21 PM, Robert Haas wrote: >> On Sun, Jun 22, 2014 at 2:59 PM, Pavel Stehule >> wrote: >>> I found only one problem - first patch introduce a new property >>> CONNECTION_LIMIT and replace previously used "CONNECTION LIMIT" in

Re: [HACKERS] SQL access to database attributes

2014-06-23 Thread Pavel Stehule
2014-06-23 18:39 GMT+02:00 Vik Fearing : > On 06/23/2014 06:21 PM, Robert Haas wrote: > > On Sun, Jun 22, 2014 at 2:59 PM, Pavel Stehule > wrote: > >> I found only one problem - first patch introduce a new property > >> CONNECTION_LIMIT and replace previously used "CONNECTION LIMIT" in > >> docum

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 > 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

Re: [HACKERS] SQL access to database attributes

2014-06-23 Thread Robert Haas
On Sun, Jun 22, 2014 at 2:59 PM, Pavel Stehule 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 for some readers i

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 and

Re: [HACKERS] SQL access to database attributes

2014-06-21 Thread Pavel Stehule
2014-06-21 23:14 GMT+02:00 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

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 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 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 : > Hello > > I am looking createdb_alterdb_grammar_refactoring.v1.patch > >

[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 compatibilit

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

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 ignori

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, Step

Re: [HACKERS] SQL access to database attributes

2014-05-24 Thread Tom Lane
Jim Nasby 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 think the r

Re: [HACKERS] SQL access to database attributes

2014-05-24 Thread Jim Nasby
On 5/24/14, 8:14 AM, Tom Lane wrote: Vik Fearing 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.

Re: [HACKERS] SQL access to database attributes

2014-05-24 Thread Tom Lane
Vik Fearing 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 to have a safet

Re: [HACKERS] SQL access to database attributes

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

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 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 conn

Re: [HACKERS] SQL access to database attributes

2014-05-23 Thread Jaime Casanova
On Fri, May 23, 2014 at 10:53 PM, Vik Fearing 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 (how else do you

[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 CONNECTIONS