Xaprb

Stay curious!

I’m a Postgres user, as it turns out

with 14 comments

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?

Written by Xaprb

November 3rd, 2009 at 4:05 pm

Posted in PostgreSQL, SQL

Tagged with , ,

14 Responses to 'I’m a Postgres user, as it turns out'

Subscribe to comments with RSS or TrackBack to 'I’m a Postgres user, as it turns out'.

  1. Wow, I never realized how easy it was to use Postgres!

    Mike Hillyer

    3 Nov 09 at 5:05 pm

  2. I lol’d.

    Mahmoud

    3 Nov 09 at 5:28 pm

  3. Well now that you are a postgres user you can DROP DATABASE mysql;

    Robin

    3 Nov 09 at 6:09 pm

  4. Cool… I think it might also work for “use oracle”

    David Holoboff

    3 Nov 09 at 6:10 pm

  5. @David: Why would you want to do that?

    Robin

    3 Nov 09 at 6:13 pm

  6. @Robin: Did I say I *wanted* to do that? :)

    David Holoboff

    3 Nov 09 at 7:06 pm

  7. 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

  8. 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=>

  9. Richard, but you’re only using a schema. I’m using a WHOLE NEW DATABASE ZOMG!

    Xaprb

    3 Nov 09 at 7:40 pm

  10. 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

  11. 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

  12. 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

  13. [...] On xaprdb, Baron Schwartz confesses, I’m a Postgres user, as it turns out. [...]

  14. On a serious note, has anyone used PostgreSQL database software and compared it to MySQL experience.

    Allan

    5 Jan 10 at 2:45 am

Leave a Reply