Thursday, 4 December 2008

Going mobile with a Linux netbook

A friend of mine bought a Linux based Acer Aspire One netbook, and asked me to help get it working with her Three (a UK 3G network) mobile broadband dongle. It's not entirely straightforward to figure out, but is pretty easy once you know how.

Initial setup


- Click on Settings and run the Aspire's Live Update program to update the operating system with the latest patches. Reboot when prompted. Keep doing this until Live Update reports that all updates have been installed.


- Shutdown the Aspire, and plug in the Three modem.


- Boot the Aspire, and select the Mobile Partner app on the Connect tab.


- Wait for Mobile Partner to detect the modem.


- Select Tools -> Options, and the click the New button.


- Give the profile a name, such as 'Three mobile broadband' and configure the following options:


  APN type: Static

  APN name: three.co.uk

  Access number: *99#

  Username: three

  Password: three

  Protocol: chap


- Save the profile.


Daily use


- Boot the Aspire, and plug in the modem. If a file browser window opens, close it.


- Run the Mobile Partner app on the Connect tab.


- Wait for Mobile Partner to detect the modem.


- Click the Connect button.


- When Mobile Partner has connected, minimise (don't close) it, fire up the web browser and away you go!


And what's the PostgreSQL angle you might ask? There isn't one. Sorry.


Monday, 17 November 2008

More StackBuilder apps available for Linux & Mac

If you've ever used PostgreSQL 8.3 on Windows, you'll be aware of StackBuilder, the package management tool that's included for downloading and installing additional tools, drivers and applications to work with PostgreSQL. Designed to be really easy to use, you simply run StackBuilder, choose the applications you wish to install (any dependencies will be automatically installed as well), and it will download them and set them up to work with your PostgreSQL installation.
With the release of PostgreSQL 8.3.5 a few of weeks ago, we (the excellent team I work with at EnterpriseDB) added Linux and Mac ports of StackBuilder to the PostgreSQL 'one click' installers that we maintain, and as of Friday have an almost identical set of applications available via StackBuilder on Windows, Mac and Linux (32 and 64 bit).

So, currently available for all four platforms, we have:
  • PostgreSQL 8.3.5
  • psqlODBC
  • pgJDBC
  • PostGIS
  • Slony
  • Apache + PHP
  • Drupal*
  • mediaWiki
  • phpBB
  • phpPgAdmin
  • phpWiki
In addition, we also published our own Tuning Wizard and MySQL Migration Wizard apps. We're working on additional updates and new apps all the time, so fire up StackBuilder regularly to check for new packages.

* Note: The Drupal release for 64 bit Linux has been delayed due to a last minute issue found during testing.

Ladies and gentlemen, normal service has been resumed...

As you may have heard, there was recently a major disaster with planetpostgresql.org. After a subtle nudge from Magnus, I figured I'd better sort out a new home for my blog as apparently I'm one of few remaining 404's on the PostgreSQL blog aggregator.

So, here we go. As a fairly heavy user of Google products already, it made sense to use Blogger, which despite the expected issues with the WYSIWYG editor and copy/paste on the Mac, so far seems pretty good. I've managed to scrape together most of the old posts thanks to the WayBack Machine which is good. A few have probably gone forever, but such is life.

Anyway, more later - I'll post a news update on some PostgreSQL work shortly...

Monday, 27 October 2008

LinuxLive Report

PostgreSQL had a booth in the .Org Village at LinuxLive/MacLive on Thursday, Friday and Saturday of last week.

Greg Stark and I attended all three days, and brought badges, pins and shirts from the UK conference, as well as signs, flyers and demo hardware from our office. Mark Cave-Ayland split his time between our booth and his companies on all three days. Simon Riggs joined us on the Friday, during which time he was interviewed by the Ubuntu guys for their regular podcast. Gianni Ciolli joined us on the Saturday.

The show was pretty quiet, with both .Org and commercial stands commenting similarly. We did see a fairly steady stream of people throughout all three days however, with roughly a 50/50 split between existing users stopping for a chat, advice or to find out what's going to be in 8.4, and potential new users. By far the most popular question asked was 'why should I use PostgreSQL instead of MySQL', second to which were questions about replication (ie. when will we see PostgreSQL RAC? !!).

Things we should have taken but don't have include:

- PG vs. MySQL flyers
- PG.EU flyers. What is it, mailing lists, conferences etc.
- 'Famous users' poster
- 'What's new in 8.4' poster
- Usage example posters (eg. company Foo use PG + Slony to do whizz bang stuff).
- Elephant Juice (after seeing people getting merry on 'Drupal Drops'!)

Thanks to all those who helped out, and 'hi' to anyone that stopped by the booth, and to the guys from Debian, OpenBSD/OpenSSH, UKUUG, Bongo, OpenNMS and anyone else we were hanging out with!

Dodgy pics from the phone at http://www.flickr.com/photos/29058417@N03/

Thursday, 21 February 2008

UK PostgreSQL Conference 2008

So finally after years of on-off discussions at the pub, Simon Riggs and I have finally got the first ever UK PostgreSQL Conference organised! It will be on April the 2nd, in central Birmingham. The theme is 'PostgreSQL in the UK'.

So, to avoid disappointment, visit the conference website and book your place today!

Thursday, 27 September 2007

Setting up Slony-I with pgAdmin

pgAdmin has had the ability to create and manage Slony-I replication clusters for some time, however it is designed to allow the user to work directly with the lower-level Slony concepts such as listens and paths. This is pretty flexible, but isn't particularly user-friendly. We are hoping to include some wizards in the future to make it much easier to setup and modify clusters, but in the meantime here's a long overdue walkthrough using the existing features to create a 3 node replication cluster.

In this example, a master server is setup with two direct slaves. This example was written and tested using Slony-I v1.2.11 and PostgreSQL 8.2.5, running on a single Windows XP machine. The PostgreSQL pgbench utility is used to generate the test schema and workload.

1) Create 3 databases, master, slave1 and slave2 and ensure pl/pgsql is setup in each.

2) Create a pgbench schema in the master database:
> pgbench -i -U postgres master
3) Add a primary key called history_pkey to the history table on the tid, bid and aid columns.

4) Create a schema-only dump of the master database, and load it into slave1 and slave2:
> pg_dump -s -U postgres master > schema.sql
> psql -U postgres slave1 < psql -U postgres slave2
5) Create Slony config files for each slon engine (daemon on *nix). The files should contain just the following two lines:
cluster_name='pgbench'
conn_info='host=127.0.0.1 port=5432 user=postgres dbname=master'
Create a file for each database, adjusting the dbname parameter as required and adding any other connection options that may be needed. (Windows only) Install the Slony-I service: > slon -regservice Slony-I

6) Register each of the engines (this is only necessary on Windows - on *nix the slon daemons may be started individually and given the path to the config file on the command line using the -f option):
> slon -addengine Slony-I C:\slony\master.conf
> slon -addengine Slony-I C:\slony\slave1.conf
> slon -addengine Slony-I C:\slony\slave2.conf
7) In pgAdmin under the Replication node in the master database, create a new Slony-I cluster using the following options:
Join existing cluster: Unchecked
Cluster name: pgbench
Local node: 1 Master node
Admin node: 99 Admin node
8) Under the Replication node, create a Slony-I cluster in each of the slave databases using the following options:
Join existing cluster: Checked
Server: <Select the server containing the master database>
Database: master
Cluster name: pgbench
Local node: 10 Slave node 1
Admin node: 99 - Admin node
Join existing cluster: Checked
Server: <Select the server containing the master database>
Database: master
Cluster name: pgbench
Local node: 20 Slave node 2
Admin node: 99 - Admin node
9) Create Paths on the master to both slaves, and on each slave back to the master. Create the paths under each node on the master, using the connection strings specified in the slon config files. Note that future restructuring of the cluster may require additional paths to be defined.

10) Create a Replication Set on the master using the following settings:
ID: 1
Comment: pgbench set
11) Add the tables to the replication set using the following settings:
Table: public.accounts
ID: 1
Index: accounts_pkey

Table: public.branches
ID: 2
Index: branches_pkey

Table: public.history
ID: 3
Index: history_pkey

Table: public.tellers
ID: 4
Index: tellers_pkey
12) On the master node, create a new subscription for each slave using the following options:
Origin: 1
Provider: 1 - Master node
Receiver: 10 - Slave node 1

Origin: 1
Provider: 1 - Master node
Receiver: 20 - Slave node 2
13) Start the slon service (or daemons on *nix):
> net start Slony-I
14) Initial replication should begin and can be monitored on the statistics tab in pgAdmin for each node. The pgbench utility may be run against the master database to generate a test workload.

Monday, 6 August 2007

OpenSSL on Windows

OK, to get the usual intro over and done with - blog, neglected, back now, very sorry, won't do it again.


And now onto business... Ben West reported a problem with pgAdmin III v.1.8.0 Beta 2 on Windows which seems to have gained a dependency on MSVCR71.DLL (that's the Visual C++ runtime library for VC++ 7.1). pgAdmin is built with VC++ 8 these days so we really don't want to ship the 7.1 runtimes. After a little investigation, it seems that the latest builds of OpenSSL from Shining Light Productions are built using VC++ 7.1 :-(


So, it seems we need to build OpenSSL ourselves now to avoid this issue. I struggled to find the details of how to do that, so after finding the relevant info elsewhere, I'll repeat it here for future reference...


So, here's how it's done. You will need something to unpack the OpenSSL source code (such as tar with gzip support), and a perl installation, as well as VC++.


  1. Download the OpenSSL Source.

  2. Start a Visual Studio command prompt for the version of Visual C++ you need to compile against (8.0 for us, otherwise known as 2005).

  3. Unpack the OpenSSL source, and CD into the source directory.

  4. Configure the source code:

    C:\openssl-0.9.8e> perl configure VC-WIN32

  5. Generate assembler code for speed:

    C:\openssl-0.9.8e> ms\do_masm

  6. Finally, the libraries can be built:

    C:\openssl-0.9.8e> nmake -f ms\ntdll.mak

And that's it! The OpenSSL DLLs should be found in the out32dll directory.