How to write a function that manipulates a set of results

From: Ashley Moran <work(at)ashleymoran(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: How to write a function that manipulates a set of results
Date: 2007-03-14 17:25:16
Message-ID: F3DF9330-8992-4E71-A3EE-2A4094380FB2@ashleymoran.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

I'm passing this on second hand so forgive me if I'm a bit vague...

My boss is trying to write a function in PL/pgsql that manipulates a
small, temporary set of data. It fetches about 20 rows from a table
of approx 4 million, then it needs to do further calculations to
narrow them down further. Previously we have only written database
code for SQL Server, and there we would use a table variable.
Apparently temporary tables are not equivalent and not suitable for
this.

The closest I've come from reading the docs is functions that return
SETOF. However I can't see any way to query the result set like a
table. Can anyone offer any hints/links?

Thanks
Ashley

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2007-03-14 17:36:50 Re: quoted identifier behaviour
Previous Message Greg Sabino Mullane 2007-03-14 17:19:29 Re: quoted identifier behaviour