Business Machine

Technology, business
and innovation.

And, not least, about
the Mac.

Weblog Archive Cutedge

by: Bernard Teo

Creative Commons License

Copyright © 2003-2012
Bernard Teo
Some Rights Reserved.

Thu 19 Oct 2006

Luca & PostgreSQL - Client/Server - It Just Works

Category : Technology/LucaPostgreSQLClientServer.txt

I've got Luca on PostgreSQL largely done. Maybe a bit more testing is needed, just to be sure. But every Luca feature works on PostgreSQL.

A few things PostgreSQL does differently from MySQL and SQLite : (1) PostgreSQL "folds" all table and column names to lower-case. I've mentioned that before. (2) It doesn't support DROP TABLE IF EXISTS - so I had to find a way to check that a table exists before dropping (deleting) it in a script. And (3) It's very picky about dates - it won't accept invalid date values. But sometimes we don't yet know an exact date, like a date-of-birth field. Both MySQL and SQLite are much more accomodating and therefore more practical. Quite like the way Java is so dogmatic when compared to the wonderful pragmatism exhibited Objective-C. But other than that, all the SQL code behaved properly when ported over to PostgreSQL. This is better than I had ever dared hope it will be.

I copied this build of Luca over to a machine, my iBook, which doesn't yet have PostgreSQL installed on it. I started up Luca on the iBook, and pointed it towards the machine that does have PostgreSQL and is hosting the accounting database, i.e. my Intel iMac.

And ... it just works. Luca accesses the database over the network. All the magic is packed into the little connectivity framework bundled into Luca. You don't need anything else on the client machine. And the clients can be any Mac, anywhere on the Internet.

Note : MySQL uses port 3306, Oracle uses 1521, and PostgreSQL uses 5432. These are the ports I had to open in my firewall. The only other thing I had to do is to edit the PostgreSQL config file to give my particular Postgres user account the rights to access the database from any IP address. And that's about it.

And I'm thinking just how stupid Oracle is. You have to go to every Oracle client to install SQL*Net - a 20 to 30 minute installation on a PC - even if you just want to access Oracle via a GUI application.

A PostgreSQL or MySQL database installation is done in just minutes. By way of contrast, an Oracle database installation can take you at least half a day. And, believe me, at the end of it all, it doesn't work any better. In fact, you can get a lot more work done, a lot faster on PostgreSQL or MySQL. There are some config file editing for PostgreSQL and MySQL, e.g., for setting up user account access rights. But if I build a Postfix Enabler/DNS Enabler-type interface for this, it can be done in seconds.

All this speed adds up to a tremendous business advantage. You can pack up, go somewhere else, set up shop, and be operational in minutes. This is the holy grail of disaster recovery planning (provided you have off-site backup for your data). Use a Mac. It doesn't just look good. It's got muscles in all the right places.

Posted at 6:19PM UTC | permalink

Put your Mac to Work Now how would you do something like that?

Weblogs. Download and start a weblog of your own.

A Mac Business Toolbox
A survey of the possibilities

A Business Scenario
How we could use Macs in businesses

VPN Enabler for Mavericks

MailServe for Mavericks

DNS Enabler for Mavericks

DNS Agent for Mavericks

WebMon for Mavericks

Luca for Mavericks

Liya for Mountain Lion & Mavericks

Postfix Enabler for Tiger and Panther

Sendmail Enabler for Jaguar

Services running on this server, a Mac Mini running Mac OS X 10.9.2 Mavericks:

  • Apache 2 Web Server
  • Postfix Mail Server
  • Dovecot IMAP Server
  • Fetchmail
  • SpamBayes Spam Filter
  • Procmail
  • BIND DNS Server
  • DNS Agent
  • WebDAV Server
  • VPN Server
  • PHP-based weblog
  • MySQL database
  • PostgreSQL database

all set up using MailServe, WebMon, DNS Enabler, DNS Agent, VPN Enabler, Liya and our SQL installers, all on Mavericks.