008 Postgres Command Line : psql : Another function example

As per 007 lets try and create our own function to calculate centigrade from fahrenheit and call it calcf

CREATE FUNCTION calcf(integer) RETURNS integer AS 'SELECT ($1 - 32) * 5/9' LANGUAGE SQL RETURNS NULL ON NULL INPUT;

Next lets see if I can write the same function using Python.

Author: Mark

Mark Brooks a forty something individual working and living in and around Edinburgh