I try to run pgadmin3 as user postgres and I get following error:
No protocol specified Error: Unable to initialize gtk, is DISPLAY set properly?
pgadmin3 runs well under pavel (my main user account).
The answers of a question on this suggested either some server connection magic (not my case - I try to run it on localhost), or setting DISPLAY variable. I checked it through printenv both under pavel and postgres, and it's :0 for both. I used the trick to find which processes have DISPLAY variable set under both users. For pavel, there's very long list with the DISPLAY values :0 (for most processes, including pgadmin) or :0.0 (for some). But for postgres, there are just three or four processes in the list.
Here's where I'm stuck: how to set an environment variable (DISPLAY, in this case) for a process? Or better, for application/user combination, so that the process would see the DISPLAY setting from the very start. I already tried to hardcode DISPLAY in ETC/ENVIRONMENT, but nothing changed - it affects the DISPLAY value where it is set (for users and processes), but not its visibility for processes run by the users.