Full Text Search (FTS) in PostgreSQL 9.1 (Examples Included)

January 16th, 2012

This post is aimed at providing only the information necessary to rapidly understand and deploy Full Text Search into your PostgreSQL environment. For more documentation, I’d recommend checking out the following URLs:

  • http://linuxgazette.net/164/sephton.html
  • http://www.postgresql.org/docs/9.1/static/textsearch.html
  • http://www.slideshare.net/billkarwin/full-text-search-in-postgresql

Read the rest of this entry »

Generate a Dynamic Filename Based On Date / Timestamp in Talend

January 4th, 2012

If you’re working with Talend Open Studio and would like to dynamically specify the name of a file you’re attempting to consume or output, refer to the following.
Read the rest of this entry »

Using ConnectBot With Your Droid2

December 25th, 2011

If you’re having trouble working with some of the basic functionality of your ConnectBot terminal, this article is designed to help you quickly overcome some of the common issues you may face.
Read the rest of this entry »

Working with the hstore data type in PostgreSQL 9.0

November 30th, 2011

In these examples, we assume you have a table named “hstore_test” with a single column named “data” which is of the data type “hstore”.

Set the contents of an hstore
INSERT INTO hstore_test (data) VALUES ('"key1"=>"value1", "key2"=>"value2", "key3"=>"value3"')

Delete a key from an hstore
UPDATE hstore_test SET data = delete(data, 'key2')

Add a key/value to an hstore / replace the value of an existing key within an hstore
UPDATE hstore_test SET data = data || '"key4"=>"some value"'::hstore

Return records where hstore contains a specific key
SELECT * FROM hstore_test WHERE data ? 'key4'

Return records where hstore does not contain a specific key
SELECT * FROM hstore_test WHERE NOT data ? 'key5'

Returns records where a specific key/value are present within an hstore.
SELECT * FROM hstore_test WHERE data @> '"key4"=>"some value"'::hstore

Python’s Django – Database Interactions

October 4th, 2011

This post is a work in progress. Currently, we define what a couple views may look like and in those views, we perform various useful database interactions. Read the rest of this entry »

PostgreSQL and ODBC in 64-Bit Windows

September 20th, 2011

(This document has been modified to instruct the setup of not only 64-bit systems, but 32-bit set ups as well.)

This tutorial is for individuals who are interested in setting up a DSN entry in their Data Sources (ODBC) for PostgreSQL. We cover both 32-bit and 64-bit versions of Windows, as each must be configured slightly differently.
Read the rest of this entry »

Validate an uploaded image in PHP

July 12th, 2011

This is a quick copy and past, but you should get the idea. This script validates the form field “photo” file being upload is a valid photo.
Read the rest of this entry »

Generating Excel Documents With the xlwt Python Library (Examples)

April 25th, 2011

Here are some simple examples using Python’s xlwt library to dynamically generate Excel documents.

Please note a useful alternative may be ezodf, which allows you to generate ODS (Open Document Spreadsheet) files for LibreOffice / OpenOffice. You can check them out at: http://packages.python.org/ezodf/index.html
Read the rest of this entry »

Python and PostgreSQL: A Quick Reference to psycopg2

March 31st, 2011

As with most database technologies I interact with, I like to throw together a few simple examples as reminders on how to interface with that technology. In this case we’re interfacing with the PostgreSQL database through the Python programming language. Read the rest of this entry »

Implementing an Iterator in Python Example

March 22nd, 2011

I’ve had a incredibly difficult time tracking down useful examples of implementing iterators in Python. Up to this point all the examples I’ve found implement way more than is needed for a typical, simple iterator. Read the rest of this entry »