Ubuntu, postgresql, show whole running sql command
You would want to query the query column of pg_stat_activity with a query like

SELECT query
FROM pg_stat_activity
WHERE state = 'active';


This will show the first 1024 characters of the query.

If that is not enough, raise the track_activity_query_size parameter.