Archive for the ‘SQL’ Category

Setting Up Yet Another Debian Etch Server

Thursday, January 25th, 2007

A teacher e-mailed me the other day wondering if I could setup a server with Moodle on it for him to test. I was overjoyed at the request because the teacher had discovered Moodle, MySQL, PHP, and Linux (as well as their freeness) all by himself!

I used the Debian Etch Net Install Daily Image for today (1/25/2007), and everything went pretty smoothly.

Installation

I thought I had entered “installgui” at the boot prompt, but I still got the old text based setup. Everything went smoothly, so I have no complaints. Perhaps the net installation doesn’t have the GUI installer?

One scary thing did happen during installation: after the initial reboot Linux ran fsck on the new installation and found a number of errors! After another reboot everything appears to be working normally. This is an old PIII computer, so I’m immediately installing smartmontools.

Setup

GDM came up with a few colored vertical lines. One Google search later I discovered that the i810 Intel driver might do that at higher resolutions. I lowered my resolution to 1024 x 768 and everything works beautifully.

Upon updating my package lists in Synaptic, I got some strange errors from gpg, so Debian can’t validate a number of packages. A bit strange, but it doesn’t hurt anything.

apt-zeroconf

Thanks to apt-zeroconf I downloaded the 40+ megs of extra packages I needed mostly off of my other 2 local Debian boxes. Now if only I could configure the net install CD to use apt-zeroconf… hm… Sounds like a job for lazyweb!

I do get periodic 404 errors when using apt-zeroconf, but just trying again fixes it every time.

Summary

All things considered I didn’t see any reason not to release Etch immediately!

I still recommend Ubuntu or openSUSE for normal users or people new to Linux as Debian just doesn’t do enough hand holding for people not willing to spend some time learning Linux.

PostgreSQL 8.2 Released

Wednesday, December 6th, 2006

Just noticed PostgreSQL 8.2 was released yesterday. I chose PostgreSQL 8.x for a large project when MySQL 5 either wasn’t out or was too new for my comfort.

I learned database application programming on MySQL, but now I choose PostgreSQL whenever I have the option. PostrgeSQL is just packed with features that MySQL either doesn’t have or just recently implemented so you need a cutting edge version.

It seems to me that PostgreSQL has a much better user community as well. I know there are many excellent DBA’s using MySQL, but the MySQL community seems dominated by PHP hackers who found MySQL pre-installed on their $5/mo. shared hosting account.

If you’ve never tried PostgreSQL, I highly recommend it, especially if you’ve ever implemented autonumber tables in MySQL to get around flaky autonumber generation. PostgreSQL uses sequences which are basically single field/row tables for maintaining autonumbers. There are a number of sequence related functions in PostgreSQL that makes work with autonumbers not only easy, but also predictable.

Oh and pgAdmin III beats MySQL’s awkward and buggy GUI offerings any day.

When dealing with 1 GB databases…

Friday, November 17th, 2006

…create good indexes.

This should be obvious, but for some reason I was getting frustrated with MySQL for taking almost 30 seconds to query a 1 GB table that only had a worthless index on a surrogate key. With proper indexing, the same query takes less than 1/10th of a second.

ODBC Test Tool

Tuesday, September 12th, 2006

Today I find myself once again fighting Crystal Reports. It claims that it can’t connect to the ODBC datasource I created for it since it can’t use Npgsql. Just to prove it wrong I quick hacked together an ODBC Test Tool in SharpDevelop. Sure enough, the ODBC connection works just fine.

Here’s a zip of ODBCTestTool which contains the source code and compiled executables under the bin directory. It requires .NET 2.0, and I doubt it runs on Mono since it uses ODBC.

Oh and I didn’t include any license information, so I guess its public domain. Have fun.

SchoolWorks on Linux: Part 1 of Many

Wednesday, September 6th, 2006

Now that SchoolWorks has officially been released, I guess I can begin posting about my attempts to get it running on Linux.

First of all SchoolWorks is school administration software (or SIS) built using:

We also used the following support tools:

While Visual Studio and ASP.NET can be frustrating at times, the only part of SchoolWorks that I avoid like the plague is working with Crystal Reports.

Recently I’ve been trying to build SchoolWorks using Mono on Linux. I’ve successfully built Mono (libgdiplus + mono + mcs + xsp) on my personal Debian Etch, but I haven’t gotten much of SchoolWorks to compile yet.

The first missing feature was Decimal.TryParse which we use a lot in SchoolWorks. I submitted (my very first!) patch to the mono-devel mailing list in hopes of getting support for Decimal.TryParse added.

I’ll try to keep posting my progress as it should be interesting to SchoolWorks users as well as .NET/Mono developers.

Missing MySQL’s REPLACE (aka MERGE) in PostgreSQL

Thursday, July 13th, 2006

When Synthesys first decided to go with PostgreSQL as the database for a large web application, I was very excited to get away from our usual reliance on MySQL and move to a real database platform.

Once we figured out the whole MySQL auto_increment vs. PostgreSQL SERIAL, the first thing we really missed in PostgreSQL was the REPLACE statement. I understand why its missing, and it is kind of a hack of a SQL statement (its not in a SQL standard).

Turns out in the SQL 2003 Standard there is a statement similar to REPLACE called MERGE. Despite PostgreSQL’s excellent support for standards, they have not implemented MERGE. I would guess it has something to do with the ambiguity of the statement.

At any rate I still love working with PostgreSQL, and for what its worth Npgsql is an excellent PostgreSQL connector for Mono/.Net. (Even in RC/Beta state)