Re: SQL access to database attributes
От | Jim Nasby |
---|---|
Тема | Re: SQL access to database attributes |
Дата | |
Msg-id | 5380DCCF.3040608@nasby.net обсуждение исходный текст |
Ответ на | Re: SQL access to database attributes (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: SQL access to database attributes
|
Список | pgsql-hackers |
On 5/24/14, 8:14 AM, Tom Lane wrote: > Vik Fearing<vik.fearing@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 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. > (If you do shoot yourself in the foot that way, I think we ignore > datallowconn in standalone mode.) I think this is nannyism that would be well placed. Most people don't know about standalone, and I don't think we want tochange that. BTW, I think the race condition could be eliminated if we did something like (forgive the user-space semantics): SELECT datallowconn FROM pg_database WHERE datallowconn AND datname <> $$database we're disallowing connections on$$ LIMIT1 FOR UPDATE; If you don't get a record back from that you abort; meanwhile no one else can disallow connections on that database untilyou commit or rollback. -- Jim C. Nasby, Data Architect jim@nasby.net 512.569.9461 (cell) http://jim.nasby.net
В списке pgsql-hackers по дате отправления: