I’m a Postgres user, as it turns out
Someone recently posted this to an email list as a sample of an interesting SHOW INNODB STATUS output:
mysql> SHOW ENGINE INNODB STATUS\G
_______ _______
|\ /|( ____ \( ____ \
| ) ( || ( \/| ( \/
| | | || (_____ | (__
| | | |(_____ )| __)
| | | | ) || (
| (___) |/\____) || (____/\
(_______)\_______)(_______/
_______ _______ _______ _________ _______ _______ _______ _______
( ____ )( ___ )( ____ \\__ __/( ____ \( ____ )( ____ \( ____ \
| ( )|| ( ) || ( \/ ) ( | ( \/| ( )|| ( \/| ( \/
| (____)|| | | || (_____ | | | | | (____)|| (__ | (_____
| _____)| | | |(_____ ) | | | | ____ | __)| __) (_____ )
| ( | | | | ) | | | | | \_ )| (\ ( | ( ) |
| ) | (___) |/\____) | | | | (___) || ) \ \__| (____/\/\____) |
|/ (_______)\_______) )_( (_______)|/ \__/(_______/\_______)
I thought it was worth trying out, so I gave it a shot:
mysql> use postgres
ERROR 1049 (42000): Unknown database 'postgres'
Clearly I just need to create the database. Short work:
mysql> create database postgres;
Query OK, 1 row affected (0.00 sec)
mysql> use postgres
Database changed
So now I’m using Postgres. I still feel like I’m missing something, though. It feels a lot like reading XKCD comics. Where’s the tooltip?


Wow, I never realized how easy it was to use Postgres!
Mike Hillyer
3 Nov 09 at 5:05 pm
I lol’d.
Mahmoud
3 Nov 09 at 5:28 pm
Well now that you are a postgres user you can DROP DATABASE mysql;
Robin
3 Nov 09 at 6:09 pm
Cool… I think it might also work for “use oracle”
David Holoboff
3 Nov 09 at 6:10 pm
@David: Why would you want to do that?
Robin
3 Nov 09 at 6:13 pm
@Robin: Did I say I *wanted* to do that? :)
David Holoboff
3 Nov 09 at 7:06 pm
mysql> drop database mysql;Query OK, 17 rows affected (0.01 sec)
mysql> use mysql
ERROR 1049 (42000): Unknown database 'mysql'
It seems to have worked.
Xaprb
3 Nov 09 at 7:16 pm
Using postgresql there isn’t a way to change focus from one database to another without dropping a connection and opening a new one. So the closest thing in Pg to MySQL’s USE would be SET search_path.
broersr=> set search_path = mysql;
ERROR: schema “mysql” does not exist
broersr=> create schema mysql;
CREATE SCHEMA
broersr=> set search_path = mysql;
SET
broersr=>
Richard Broersma Jr.
3 Nov 09 at 7:32 pm
Richard, but you’re only using a schema. I’m using a WHOLE NEW DATABASE ZOMG!
Xaprb
3 Nov 09 at 7:40 pm
Now it shouldn’t be too difficult to write a mysql storage engine that embeds a postgresql client to expose a remote postgresql table within mysql. Could be useful. For something.
Robin
3 Nov 09 at 7:42 pm
Baron, you’re using a schema. You can call it a database, if you like.
mysql> create schema postgres;
Query OK, 1 row affected (0.06 sec)
mysql> use postgres;
Database changed
mysql> select version();
+—————————+
| version() |
+—————————+
| 5.0.88-valgrind-max-debug |
+—————————+
1 row in set (0.00 sec)
Konstantin
3 Nov 09 at 8:30 pm
I know, but it’s more fun to pretend there is a difference. I see I’ve converted you to Postgres, too! Karma++ for me, right?
Xaprb
3 Nov 09 at 8:35 pm
[...] On xaprdb, Baron Schwartz confesses, I’m a Postgres user, as it turns out. [...]
Log Buffer #168: a Carnival of the Vanities for DBAs | Pythian Group Blog
6 Nov 09 at 1:48 pm
On a serious note, has anyone used PostgreSQL database software and compared it to MySQL experience.
Allan
5 Jan 10 at 2:45 am