Systems

Geocoding Python function for PostgreSQL

Gratefully making use of what others have provided, i.e. geopy, Google and plpythonu. Type to hold result of geocoding: CREATE TYPE geocoding AS ( place text, latitude DOUBLE PRECISION, longitude DOUBLE PRECISION );CREATE TYPE geocoding AS ( place text, latitude double precision, longitude double precision ); Function that does the actual geocoding (to be extended …

Geocoding Python function for PostgreSQL Read More »

A stop watch for Postgres

To time the execution of various stages of a long transaction, I’m using the following function: CREATE OR REPLACE FUNCTION CVL_TimerLap() RETURNS double precision AS $$ import time now = time.time() if not SD.has_key(’t_last’): SD[’t_last’] = now elapsed = now – SD[’t_last’] SD[’t_last’] = now return elapsed $$ LANGUAGE plpythonu;CREATE OR REPLACE FUNCTION CVL_TimerLap() RETURNS …

A stop watch for Postgres Read More »