Thread: PGAdmin 4: session detail case long SQL
Hi,
In PG Admin 4, I use the dashboard, server activity to explore sessions on PG v12.1.
In the Details panel of the session, I can see the start of the SQL, but when it's a long text query on multiple lines, How can I access the entire SQL command ?
In PGAdmin 3 (on oldest PG v9.4), in tool server state, I was using for that purpose, the button that launch the query editor for the selected session with the entire SQL command.
Thanks for your suggestions !
Hi Alain,
You can scroll it. Please check the screenshot below:
![Screenshot 2019-12-16 at 17.45.49.png](/media/maillist_attaches/pgadmin-support/2019/12/16/CAM9w-_nNcmj8RmvYtJN-h+Dg9DRu8a+5Q6Bvc8V96h8NBrgxDA@mail.gmail.com/Screenshot 2019-12-16 at 17.45.49.png)
On Mon, Dec 16, 2019 at 3:32 PM Alain Dupeyron <adupeyron@yahoo.fr> wrote:
Hi,In PG Admin 4, I use the dashboard, server activity to explore sessions on PG v12.1.In the Details panel of the session, I can see the start of the SQL, but when it's a long text query on multiple lines, How can I access the entire SQL command ?In PGAdmin 3 (on oldest PG v9.4), in tool server state, I was using for that purpose, the button that launch the query editor for the selected session with the entire SQL command.Thanks for your suggestions !
Thanks and Regards,
Aditya Toshniwal
Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Attachment
Hi Aditya,
I have "very" long queries formatted on multilines. See screenshot below with 23 lines but SQL is truncated...
I have just updated to PGAdmin 4.16, SQL field seem to be longuer but still truncated in my case
![Image en ligne Image en ligne](/media/maillist_attaches/pgadmin-support/2019/12/16/2055900424.24986262.1576504819260@mail.yahoo.com/1576504531644blob.jpg)
Thanks
Alain
Le lundi 16 décembre 2019 à 13:19:48 UTC+1, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> a écrit :
Hi Alain,
You can scroll it. Please check the screenshot below:
![Screenshot 2019-12-16 at 17.45.49.png](/media/maillist_attaches/pgadmin-support/2019/12/16/2055900424.24986262.1576504819260@mail.yahoo.com/Screenshot 2019-12-16 at 17.45.49.png)
On Mon, Dec 16, 2019 at 3:32 PM Alain Dupeyron <adupeyron@yahoo.fr> wrote:
Hi,In PG Admin 4, I use the dashboard, server activity to explore sessions on PG v12.1.In the Details panel of the session, I can see the start of the SQL, but when it's a long text query on multiple lines, How can I access the entire SQL command ?In PGAdmin 3 (on oldest PG v9.4), in tool server state, I was using for that purpose, the button that launch the query editor for the selected session with the entire SQL command.Thanks for your suggestions !
Thanks and Regards,
Aditya Toshniwal
Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Attachment
Hi,
On Mon, Dec 16, 2019 at 7:30 PM Alain Dupeyron <adupeyron@yahoo.fr> wrote:
Hi Aditya,I have "very" long queries formatted on multilines. See screenshot below with 23 lines but SQL is truncated...I have just updated to PGAdmin 4.16, SQL field seem to be longuer but still truncated in my case
OK. So I guess the param track_activity_query_size might be less for you DB. Refer - https://www.postgresql.org/docs/12/runtime-config-statistics.html
pgAdmin uses pg_stat_activity to fetch the query. It depends on track_activity_query_size how much size of the query is tracked.
pgAdmin uses pg_stat_activity to fetch the query. It depends on track_activity_query_size how much size of the query is tracked.
To check, execute show track_activity_query_size in query tool.
![image.png](/media/maillist_attaches/pgadmin-support/2019/12/16/CAM9w-_m2Ki_MkDnBtjyK68f6iJ1g+WAN0QWmGyGZQhcdhT4ysw@mail.gmail.com/image.png)
ThanksAlainLe lundi 16 décembre 2019 à 13:19:48 UTC+1, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> a écrit :Hi Alain,You can scroll it. Please check the screenshot below:On Mon, Dec 16, 2019 at 3:32 PM Alain Dupeyron <adupeyron@yahoo.fr> wrote:Hi,In PG Admin 4, I use the dashboard, server activity to explore sessions on PG v12.1.In the Details panel of the session, I can see the start of the SQL, but when it's a long text query on multiple lines, How can I access the entire SQL command ?In PGAdmin 3 (on oldest PG v9.4), in tool server state, I was using for that purpose, the button that launch the query editor for the selected session with the entire SQL command.Thanks for your suggestions !--Thanks and Regards,Aditya ToshniwalSr. Software Engineer | EnterpriseDB India | Pune"Don't Complain about Heat, Plant a TREE"
Thanks and Regards,
Aditya Toshniwal
Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Attachment
executing "show track_activity_query_size" give me "1KB" the default value.
I will try to increase this setting but it require db restart...
In PGAdmin 3 (on oldest PG v9.4), in tool server state, I was using for that purpose, the button that launch the query editor for the selected session and the entire SQL command was displayed.
Le lundi 16 décembre 2019 à 15:57:47 UTC+1, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> a écrit :
Hi,
On Mon, Dec 16, 2019 at 7:30 PM Alain Dupeyron <adupeyron@yahoo.fr> wrote:
Hi Aditya,I have "very" long queries formatted on multilines. See screenshot below with 23 lines but SQL is truncated...I have just updated to PGAdmin 4.16, SQL field seem to be longuer but still truncated in my case
OK. So I guess the param track_activity_query_size might be less for you DB. Refer - https://www.postgresql.org/docs/12/runtime-config-statistics.html
pgAdmin uses pg_stat_activity to fetch the query. It depends on track_activity_query_size how much size of the query is tracked.
pgAdmin uses pg_stat_activity to fetch the query. It depends on track_activity_query_size how much size of the query is tracked.
To check, execute show track_activity_query_size in query tool.
![image.png](/media/maillist_attaches/pgadmin-support/2019/12/16/1147433681.25112325.1576509342835@mail.yahoo.com/image.png)
ThanksAlainLe lundi 16 décembre 2019 à 13:19:48 UTC+1, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> a écrit :Hi Alain,You can scroll it. Please check the screenshot below:On Mon, Dec 16, 2019 at 3:32 PM Alain Dupeyron <adupeyron@yahoo.fr> wrote:Hi,In PG Admin 4, I use the dashboard, server activity to explore sessions on PG v12.1.In the Details panel of the session, I can see the start of the SQL, but when it's a long text query on multiple lines, How can I access the entire SQL command ?In PGAdmin 3 (on oldest PG v9.4), in tool server state, I was using for that purpose, the button that launch the query editor for the selected session with the entire SQL command.Thanks for your suggestions !--Thanks and Regards,Aditya ToshniwalSr. Software Engineer | EnterpriseDB India | Pune"Don't Complain about Heat, Plant a TREE"
Thanks and Regards,
Aditya Toshniwal
Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Attachment
Le lun. 16 déc. 2019 à 16:15, Alain Dupeyron <adupeyron@yahoo.fr> a écrit :
executing "show track_activity_query_size" give me "1KB" the default value.I will try to increase this setting but it require db restart...In PGAdmin 3 (on oldest PG v9.4), in tool server state, I was using for that purpose, the button that launch the query editor for the selected session and the entire SQL command was displayed.
That's because your query was less than track_activity_query_size bytes. Or because track_activity_query_size was higher back then. Anyway, I don't know about pgAdmin4, but I guess it uses the same query than in pgAdmin3, and in pgAdmin3, we were using the pg_stat_activity view. This view shows the query, but only the track_activity_query_size first bytes.
In other words, increase track_activity_query_size. You can go much higher without any issue.
Le lundi 16 décembre 2019 à 15:57:47 UTC+1, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> a écrit :Hi,On Mon, Dec 16, 2019 at 7:30 PM Alain Dupeyron <adupeyron@yahoo.fr> wrote:Hi Aditya,I have "very" long queries formatted on multilines. See screenshot below with 23 lines but SQL is truncated...I have just updated to PGAdmin 4.16, SQL field seem to be longuer but still truncated in my caseOK. So I guess the param track_activity_query_size might be less for you DB. Refer - https://www.postgresql.org/docs/12/runtime-config-statistics.html
pgAdmin uses pg_stat_activity to fetch the query. It depends on track_activity_query_size how much size of the query is tracked.To check, execute show track_activity_query_size in query tool.ThanksAlainLe lundi 16 décembre 2019 à 13:19:48 UTC+1, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> a écrit :Hi Alain,You can scroll it. Please check the screenshot below:On Mon, Dec 16, 2019 at 3:32 PM Alain Dupeyron <adupeyron@yahoo.fr> wrote:Hi,In PG Admin 4, I use the dashboard, server activity to explore sessions on PG v12.1.In the Details panel of the session, I can see the start of the SQL, but when it's a long text query on multiple lines, How can I access the entire SQL command ?In PGAdmin 3 (on oldest PG v9.4), in tool server state, I was using for that purpose, the button that launch the query editor for the selected session with the entire SQL command.Thanks for your suggestions !--Thanks and Regards,Aditya ToshniwalSr. Software Engineer | EnterpriseDB India | Pune"Don't Complain about Heat, Plant a TREE"--Thanks and Regards,Aditya ToshniwalSr. Software Engineer | EnterpriseDB India | Pune"Don't Complain about Heat, Plant a TREE"
--
Guillaume.