Running queries or functions stored in a table.

From: Matthew Schumacher <matt(dot)s(at)aptalaska(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Running queries or functions stored in a table.
Date: 2005-03-03 23:58:51
Message-ID: 112f95sevl6gd81@corp.supernews.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

List,

I have a requirement to write a query that lists a set of
attribute/value pairs, but the values need to be dynamically created on
the fly from another query or function. Is it possible to have a table
like this:

Attribute | Value
-------------------------
Attrib1 | select val1, val1 from table;
Attrib2 | func()

return this:

Attribute | Value
-------------------------
Attrib1 | result1
Attrib2 | result2

If this is possible? How would I go about it? I'm thinking pl/pgsql
and execute() but I'm not sure.

Any thoughts?

schu

Browse pgsql-general by date

  From Date Subject
Next Message Geoffrey 2005-03-04 02:28:22 Re: Disabling triggers in a transaction
Previous Message Robby Russell 2005-03-03 23:53:22 Re: GUI