Returning NULL from SRF

From: Magnus Persson <magnus(dot)e(dot)persson(at)gmail(dot)com>
To: PgSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Returning NULL from SRF
Date: 2014-01-05 14:40:27
Message-ID: 52C96EDB.1020201@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

My function is defined as:
CREATE OR REPLACE FUNCTION ta_f(
IN ta_in double precision[],
OUT ta_out double precision)
RETURNS SETOF double precision
AS 'pg_ta'
LANGUAGE C STRICT;

And for those cases where I have an actual number to return I do:
SRF_RETURN_NEXT(funcctx, ((Datum *) funcctx->user_fctx)[call_cntr]);

In those cases where I don't have a value to return, how do I express
that? As in, if I have the array [ NULL, 1.5, 2.5, NULL ]?

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Sameer Kumar 2014-01-05 14:43:59 Re: total time more than 24 hours
Previous Message Sameer Kumar 2014-01-05 14:37:54 Re: total time more than 24 hours