tags:

views:

204

answers:

3

I'm using SELECT current_query FROM pg_stat_activity; to see the currently executing queries, but I noticed that the query is truncated. Is there any workaround or any other way to see the currently executing queries?

+2  A: 

I can't seem to find an easy solution to this but this post from 2002 suggests you need to adjust a setting and recompile: http://osdir.com/ml/db.postgresql.sql/2002-05/msg00088.html

Artem Russakovskii
Heh, I found a similar one from 2004. Was hoping it changed over all these years though. :(
ionut bizau
: (
Artem Russakovskii
+1  A: 

you can just enable statement logging in postgresql (log_statement), and check the logs.

depesz
+1  A: 

PostgreSQL 8.4 adds the parameter "track_activity_query_size". The value will still be truncated, but you can control at what length.

Magnus Hagander