pg_tty -- Returns the tty name
pg_tty() will return the tty name that server side debugging output is sent to on the given PostgreSQL connection identifier.