Fábio Santana <fabio3c@terra.com.br> writes:
> I need to do a application that listen the port of Postgresql
> and return all commands actually in process in Postgresql.
In 7.2 beta, try select * from pg_stat_activity (note you need
to enable collection of query strings...)
regards, tom lane