Creating a function

From: Glenn Schultz <glenn(at)bondlab(dot)io>
To: pgsql-general(at)postgresql(dot)org
Subject: Creating a function
Date: 2018-11-28 09:35:09
Message-ID: CAE-4=KGDXZSLsU+TZMs1qBjbA8ChtB97+v73LEHtfyWU2V+pbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am trying to create a function to bin based on user value and I am
stuck. I followed the
postgres create function tutoriall but I am missing something. Any help
would be appreciated as I think I am just going further off course at this
point

Glenn

CREATE FUNCTION "IncentiveBin"(in Gwac double precision,
in MtgRaate double precision,
in BinSize double precision)
RETURNS double precision
LANGUAGE 'sql'
VOLATILE PARALLEL SAFE
AS
$function$
BEGIN
ceiling((Gwac - MtgRate)/BinSize) * BinSize;
END
$function$

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Křehula 2018-11-28 10:00:17 Re: Creating a function
Previous Message Sergei Agalakov 2018-11-27 21:47:37 Re: pg_stat_statements: can we extend the object names to the qualified names?