Re: Why is this function wrong - Mailing list pgsql-general

From shakahshakah@gmail.com
Subject Re: Why is this function wrong
Date
Msg-id 1130173257.448144.55500@g44g2000cwa.googlegroups.com
Whole thread Raw
In response to Re: Why is this function wrong  ("shakahshakah@gmail.com" <shakahshakah@gmail.com>)
List pgsql-general
slight modification to the previous post, sorry, see
http://www.postgresql.org/docs/8.0/interactive/plpgsql-structure.html
for the real docs.

CREATE OR REPLACE FUNCTION "public"."cproc_hli" (bgtemp NUMERIC,
humidity NUMERIC, wspeed NUMERIC) RETURNS NUMERIC AS $$
BEGIN
  IF ($1 < 25) THEN
    SELECT (10.66 * (0.28 * $2)+(1.3 * $1) - $3) ;
  ELSE
    SELECT (8.62 * (0.38 * $2) + (1.55 * $1) - (0.5 * $3) + (exp(- $3 +
2.4))) ;
  END IF ;
END ;
$$ LANGUAGE 'plpgsql' VOLATILE RETURNS NULL ON NULL INPUT SECURITY
INVOKER;


pgsql-general by date:

Previous
From: "shakahshakah@gmail.com"
Date:
Subject: Re: Why is this function wrong
Next
From: "Jan"
Date:
Subject: PostgreSQL vs mySQL, any performance difference for large queries?