2 ms·
I know a lot of this will be up to the architecture and specific nature of each app... but has anyone recently compared a modern MySQL and Postgresql installati
by whalesalad 15y ago
I know a lot of this will be up to the architecture and specific nature of each app... but has anyone recently compared a modern MySQL and Postgresql installation on a few baseline metrics? I'd love to see the differences. I am starting to use it more and more, being a Django developer surrounded by Postgres users. But, so far the core differences are scaring me away. psql template1? It doesn't make as much sense to me.
- ryanbraganza 15y agoWhat's the equivalent of template1 in mysql?
- masklinn 15y agoI don't think there is one, mysql only creates empty databases it does not have a concept of db templates.
- obtu 15y agoWhy connect to template1? It should be invisible. Create a user and a database for your webapp. Matching the unix account name is the simplest way to do that. In pg_hba.conf, let unix users authenticate as matching PostgreSQL users: local all all peer The postgres user on Debian/Ubuntu can create users and databases: sudo -u postgres createuser -SRD webappuser sudo -u postgres createdb webappuser --owner=webappuser sudo -u webappuser psql
- masklinn 15y ago> psql template1? It doesn't make as much sense to me. What doesn't make sense about it? It opens a postgres shell to the `template1` database, that's all... And there should be very little reason to connect to `template1`: it is the default template for creating a database (it's copied to the new db file basically), so the only point in connecting to it is e.g. creating a few common tables or enabling extensions so that all the databases you create have them by default. I've yet to ever need that.