![]() One of the more interesting to me relates right back to those template databases. The CREATE DATABASE command has a number of options, as you can see in the documentation. Also, when you restore a database, PostgreSQL uses template0 to start that process (I’ll explain how and why once I learn).Īnd what about that postgres database? Well, that’s a default built into PostgreSQL so that tools always connect to a default database. What’s that? Well, in the event you completely mess up template1, template0 acts as a baseline. ![]() However, there’s more going on in PostgreSQL. You can add objects to template1, and then they will automatically exist in any other new database you create. The table template1 operates very similarly to model. In PostgreSQL, the same thing happens, but the database is called template1. In SQL Server, you have a system database called model used as a template when you create a new database. Since I know SQL Server, I’m going to compare what’s going on here, to what’s going on there. ![]() The command to create a database is quite simple:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |