Latest articles under Database category

Floyd-Warshal algorithm in PostgreSQL PL/pgSQL.

This article is an extension of my previous article . This time, however, I will write the algorithm completely in PostgreSQL’s PL/pgSQL. For background information and to understand the premise of this post, please glance through my previous post. Ok now that you’re familiar with what we’re working towards, here’s my assumption of your database […]

Posted on January 24th, 2009 under General / Algorithm, PostgreSQL, Programming  •  1 Comment

MySQL : Too many connection errors.

I was trying to connect to a MySQL server at work and I got connection fail “Too many connections”. Here’s the screen shot that I took using Navicat Lite client and Sequel Pro. I did Googling a bit and I found that most common problem is because MySQL has too many open client being connected […]

Posted on January 23rd, 2009 under MySQL  •  13 Comments

Querying database structure.

There are times when we want to query a database structure for a particular table name. Or you want to find which tables a particular column name is defined. Or in my case, I wanted to find all tables that has column A and column B defined … how do I do it? If you […]

Posted on January 15th, 2009 under MySQL  •  No Comments

MySQL Error Code 150

Error can’t create table … I was trying to add new table and alter another table to add new column and foreign key to the new table. Here’s basically what I had When I execute the code, I got an error message something like Error can’t create table … (errno: 150). It turned out that […]

Posted on January 8th, 2009 under MySQL  •  1 Comment

Optimizing SQL that selects the max/min/etc from a group.

How would you like to optimize a 10 minute query down to 24 seconds? This was an optimization I had to do at work and I thought I’d share this with anyone. Even though I was using MySQL as an example, I think the technique should work on any database. Let’s say you have a […]

Posted on January 8th, 2009 under General SQL  •  3 Comments

Page 3 of 3123