Allow CREATE/ALTER DATABASE to manipulate datistemplate and datallowconn.
Tom Lane <tgl@sss.pgh.pa.us>
Allow CREATE/ALTER DATABASE to manipulate datistemplate and datallowconn. Historically these database properties could be manipulated only by manually updating pg_database, which is error-prone and only possible for superusers. But there seems no good reason not to allow database owners to set them for their databases, so invent CREATE/ALTER DATABASE options to do that. Adjust a couple of places that were doing it the hard way to use the commands instead. Vik Fearing, reviewed by Pavel Stehule
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_upgrade/pg_upgrade.c | modified | +4 −6 |
| doc/src/sgml/ref/alter_database.sgml | modified | +22 −0 |
| doc/src/sgml/ref/create_database.sgml | modified | +24 −0 |
| src/backend/commands/dbcommands.c | modified | +77 −9 |
| src/bin/initdb/initdb.c | modified | +1 −5 |
| src/bin/pg_dump/pg_dumpall.c | modified | +3 −7 |
| src/bin/psql/tab-complete.c | modified | +4 −3 |