"David Fetter" <david(at)fetter(dot)org> writes:
> is there some way to let the right hand side of SET be the (TEXT) output of
> a function?
No. SET is a utility command and utility commands generally don't do
expression evaluation. (There are some specific reasons why not for
SET, but I won't get into that here.)
However, you can get the desired effect in various other ways; see the
set_config() function, or try updating the pg_settings view ...
regards, tom lane