Re: [SQL] FW: view derived from view doesn't use indexes

2012-07-27 Thread Russell Keane
Hi Tom, Thanks for that, that was exactly the issue. It absolutely is IMMUTABLE and changing it from VOLATILE has fixed the issue. Much appreciated, Russell, -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: 26 July 2012 16:52 To: Russell Keane Cc:

[SQL] join against a function-result fails

2012-07-27 Thread Andreas
Hi, I have a table with user ids and names. Another table describes some rights of those users and still another one describes who inherits rights from who. A function all_rights ( user_id ) calculates all rights of a user recursively and gives back a table with all userright_ids this user

Re: [SQL] join against a function-result fails

2012-07-27 Thread David Johnston
On Jul 27, 2012, at 21:57, Andreas maps...@gmx.net wrote Hi, I have a table with user ids and names. Another table describes some rights of those users and still another one describes who inherits rights from who. A function all_rights ( user_id ) calculates all rights of a user