Markus Bertheau <twanger(at)bluetwanger(dot)de> writes:
> Is there a backend id available or something similar that would allow
> me to define a view like this:
IIRC there is a function to get your backend's PID. It was meant for
identifying rows relevant to you in the pg_stat views, so look in that
part of the documentation.
regards, tom lane