Pass where clause to a function

From: Andrew Bartley <ambartley(at)gmail(dot)com>
To: Pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Pass where clause to a function
Date: 2014-08-14 05:08:21
Message-ID: CAA3RN+wQQijWyNND3B5Az2HNpSCv8ZsC3eBA5nt19TDbptNRGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

Is it possible to create a view or foreign table that will do something
like this

select * from table_x
where x_id = 10;

passing the where "x_id = 10" to a function

sorta like this

select * from api_function('x = 10')

or

select * from api_function(10)

passing the result set back to the original select....

Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2014-08-14 05:20:31 Re: Pass where clause to a function
Previous Message John R Pierce 2014-08-14 04:18:11 Re: Trigger function cannot reference field name with capital letter