Categories
Uncategorized

Google Musings

Aristotle is thinking laterally. This reminded me of a talk I saw last night by Jack Cohen. He presented a brilliant slide (which I appear to be utterly unable to locate) of a sign in some public place, with the same idea in two languages:

  • Lost Property
  • Objets Trouvée

Two completely different ways of thinking about exactly the same thing. Trying to think like this is a good habit to get into.

Categories
Uncategorized

Perl Improvements

I’m very pleased to see that Nicholas Clark has been given a grant for improving things in Perl. The stuff is useful and should bring big benefits to all Perl users.

The one thing that really catches my eye is “making Perl relocatable”. This is a large annoyance for us at work, where we have multiple Perl installations that are ever-rooted in the same directory. Because they live in directories that are versioned after their projects, it requires that when we perform a new release of our software, we have to rebuild Perl, and all its dependencies. This is irritating, although thanks to Moore’s Law, not too bad these days. But a relocatable Perl will make this a lot simpler.

Categories
Uncategorized

MySQL vs PostgreSQL

At work, we’ve just started converting one of our projects to use MySQL instead of the present PostgreSQL. Due to client orders, you understand. Unfortunately, after using PostgreSQL, coming up against MySQL reveals how bizarre, baroque and arbitrary it is.

  • CREATE TABLE automatically creates a transaction. So much for that schema loading script undoing its changes if it fails.
  • TEXT columns aren’t like PostgreSQL’s infinite length VARCHAR. They’re more like a 64k long blob. Heaven help us if we go over that by accident (which is not improbable).
  • Oh, and TEXT columns also can’t be primary keys. You have to switch to varchar for that. This is a minor (but seemingly gratuitous) incompatibility.
  • I defy anybody to make sense of MySQLs handling of date & time data types.
    • Firstly, you have to choose between datetime or timestamp, which appear to be different variations of the same thing. Except that there’s no choice because you can’t appear to set a default value on a datetime column. So you have to pick timestamp.
    • And then you have to understand 11.3.1.1. TIMESTAMP Properties as of MySQL 4.1. This is incredibly obtuse, but manages to just about make clear the utterly arbitrary limitation that only one column can have a default value. That’s just wrong. No, really.
  • DROP USER doesn’t drop a user unless they have no privileges. What’s the point in that? Thankfully, this seems to have been fixed in later versions.
  • One minor, but exceedingly annoying faux pas: ^W in the mysql command line doesn’t delete the previous word. It deletes the entire line. Strictly contrary to every other user of readline.

I’m using MySQL 5.0.16, which I thought had grown up beyond all this sort of thing. Oh well. None of this stuff is an impenetrable problem, but it’s also certainly not endearing me to us MySQL for future projects.

Update: Just for amusement, witness TeeJay having even more pain going in the opposite direction.