Optimizing policies

Hi! When writing policies I often find myself calling certain helper functions to get more detailed information about a user and their privileges. Is there some way I can optimize this so that the SELECT query in the function is only called once and the same row is returned for that user throughout the transaction/query? Would a STABLE function or something similar work? Thanks!
Was this page helpful?