Re: Understanding setof - Mailing list pgsql-general

From Jeff Janes
Subject Re: Understanding setof
Date
Msg-id CAMkU=1w2Gh-14Lm30W7Ccz5Q1nH0EhXQx=WKNw+x2ZnGVHayEw@mail.gmail.com
Whole thread Raw
In response to Understanding setof  (Robert James <srobertjames@gmail.com>)
List pgsql-general
On Fri, Apr 4, 2014 at 12:42 PM, Robert James <srobertjames@gmail.com> wrote:
I'm having trouble with setof returning functions

Let's say I have function x() returning setof integers.  I want to do
SELECT x(), but only keep the values which meet a criteria.  Something
like: SELECT x() as xval WHERE xval = 10.

How can I do that?

In general, is there a way to "unroll" a setof into a regular query?

Just add a FROM:

select * from x() as xval where xval=10;

Cheers,

Jeff

pgsql-general by date:

Previous
From: Torsten Förtsch
Date:
Subject: Re: Indices and Foreign Tables
Next
From: Merlin Moncure
Date:
Subject: Re: SSD Drives