pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Johnston <polobo@yahoo.com>
To: Steve Northamer <stevenorthamer@gmail.com>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: plpgsql function executed multiple times for each return value
Date: Sat, 8 Oct 2011 11:50:21 -0400
Message-ID: <4852CB86-2376-4A88-9B60-255FD9CFCDC3@yahoo.com> (raw)
In-Reply-To: <4E8DEC80.3010706@gmail.com>
References: <4E8DEC80.3010706@gmail.com>


> So my questions are:  1) How do we cause the paymentcalc function to be executed only once?  and 2) How do we call a table returning function with inputs from a table?
> 
> Thank you very much!
> 
> Steve
> 

WITH func AS (
   SELECT FUNC(...) AS func_result FROM ...
)
SELECT (func.func_result).* FROM func

David J.

view thread (3+ messages)  latest in thread

Message-ID: <4852CB86-2376-4A88-9B60-255FD9CFCDC3@yahoo.com>
Permalink:  ../4852CB86-2376-4A88-9B60-255FD9CFCDC3@yahoo.com/
Also on:    postgresql.org/message-id/4852CB86-2376-4A88-9B60-255FD9CFCDC3@yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: polobo@yahoo.com, stevenorthamer@gmail.com
  Subject: Re: plpgsql function executed multiple times for each return value
  In-Reply-To: <4852CB86-2376-4A88-9B60-255FD9CFCDC3@yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox