Re: functions returning sets

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Alex du Plessis <alexdup01(at)telkomsa(dot)net>
Cc: Postgres novice mailing list <pgsql-novice(at)postgresql(dot)org>
Subject: Re: functions returning sets
Date: 2006-06-15 13:40:50
Message-ID: 20060615134050.GA4198@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Jun 15, 2006 at 03:18:05PM +0200, Alex du Plessis wrote:
> Section 32.4.5 SQL Functions Returning sets.
>
> This is paragraph +-3
>
> "Currently, functions returning sets may also be called in the select
> list of a query. For each row that the query generates by itself, the
> function returning set is invoked, and an output row is generated for
> each element of the function's result set. Note, however, that this
> capability is deprecated and may be removed in future releases. The
> following is an example function returning a set from the select list: "

This paragraph refers to using the set-returning function in the
select list instead of the FROM list. Do you need that functionality,
or can you use "SELECT * FROM function_name(args)" instead?

> I dearly need to set up a function with my selection criteria and then
> run a slightly complex query because my client does not want to parse
> the SQL properly and causes the application to crash.

What do you mean by "parse the SQL properly"? Do you mean your
client doesn't want to embed a complex query in their application
code? Or something else? It's not clear what they'd be doing that
would cause the application to crash.

> A function returning a set of rows would solve the problem elegantly,
> but I do not want to use something that will disappear suddenly. Now
> is the time to look for alternatives (If I read the paragraph correctly)

Do you really need a function, or would writing the complex query
as a view work? In any case, I don't think that set-returning
functions themselves are deprecated, but just a particular way of
calling an SQL-language set-returning function.

--
Michael Fuhr

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Alex du Plessis 2006-06-15 13:52:24 Re: functions returning sets
Previous Message Alex du Plessis 2006-06-15 13:18:05 [Fwd: Re: functions returning sets]