Read only templates, PDXPUG March 20th, 2008
I was at PDXPUG last night. While everyone was introducing themselves, they also mentioned one of their least favorite items about PostgreSQL. It was interesting to hear everyone's experiences. Selena was frustated because:
\e foo(text);
Won't open the foo(text) function declaration in her editor. Jeff Davis was frustrated because there is no way to get rules to return an accurate number of tuples that are modified when the rule executes. Another individual (I don't recall the name, sorry) was frustrated with the database template1. For those that don't know, template1 is the default template database. Any database you create in PostgreSQL by default will use the template1 database as a template. This means that if you create 40 tables in template1 and then create database foo, those 40 tables will also exist in template1. I believe it was David Wheeler that brought up it would be cool if you could set a template database read only or "static". The idea being that you configure your template and run a command like:
Which would prevent any further modifications to that database until you unset the static keyword. This would be particularly useful in preventing accidental creations. Lastly, my main complain is the postgresql.conf. I still feel it is completely silly that all but a handful of the parameters are even in the file. They should be configured from the database.