[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: pgload: postgresql database loader for Stata 9

From   Andrew Chadwick <>
Subject   st: pgload: postgresql database loader for Stata 9
Date   Wed, 01 Oct 2008 11:11:04 +0100

Hash: SHA1

A pure-libpq database interface layer for querying postgresql databases
from within Stata 9 is now available from our webserver in source form:

This plugin interfaces to postgresql via its standard client library
rather than (additionally) through ODBC.

We wrote it because of a couple of annoying problems with the regular
"odbc load" command under stata-mp. We routinely use rather large
datasets here, and attempting to load views of these over the network
via ODBC used an unacceptably large amount of memory on the client
machine (10 - 16 GiB, and it wasn't being freed after "odbc load"
returned). Additionally, this plugin doesn't suffer from an (old, now
fixed) bug related to postgres integer types not fitting into Stata data
types. It's also a little faster for most data types.


  * It's load-only. There's no support for saving modified datasets
    back to postgres.

  * Some data types aren't fully supported: you'll be told when
    this happens with a "partially supported" message, and the
    postgres string representation will end up in a str244 var in
    the loaded dataset, possibly having been truncated.

  * It's heavily tied to a UNIXy environment, and you may have trouble
    persuading it to build under Windows. We've not tried doing that,
    but we'd certainly accept patches for making it build using
    Microsoft toolchains.

  * We don't have any plans right now to release in binary form.

We hope this will be of some use to postgres + stata users out there. If
anyone makes a patch that adds functionality or fixes bugs, we'd
certainly consider incorporating it into pgload. Please email sysadmin
at if you have any patches or queries, or follow up here.

- --
Andrew Chadwick, Computer Systems Administrator, Cancer Epidemiology,
Nuffield Department of Clinical Medicine, University of Oxford,
Postcode: OX3 7LF (or OX3 7DG for couriers and GPS)
Tel +44 1865 2 89 623  PGP: A9E830A4 9ECE93F7 65FDC0D1 030D7699 D0C02C4D
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla -

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index