Re: query that canceled isnt logged

Mariel Cherkassky <[email protected]> Sun, 8 Dec 2019 17:18:37 +0200
Newsgroups gmane.comp.db.postgresql.performance
Message-ID <CA+t6e1k+hP1tAVn=9u0-TxufrVZKEo2E2wBJ6X5BoCo1yKvm+g@mail.gmail.com>
--000000000000b55595059932cb35
Content-Type: text/plain; charset="UTF-8"

What do you mean by live queries ?
If I'll try to run the following query and cancel it manually(ctrl+c) :
select pg_sleep(10)
I will see in the logs the following messages :

2019-12-08 17:16:34 IST postgres 30797  LOG:  statement: select
pg_sleep(10);
2019-12-08 17:16:36 IST postgres 30797  ERROR:  canceling statement due to
user request
2019-12-08 17:16:36 IST postgres 30797  STATEMENT:  select pg_sleep(10);

The first message indicates that I run this query (logged because I set
log_statements to all) and the two next messages appear because I canceled
the query.
When it happens to my application I dont see the first message that
indicates that I run it and thats what I'm trying to understand.

>

--000000000000b55595059932cb35
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"rtl"><div dir=3D"rtl"><div style=3D"" dir=3D"ltr">What do you m=
ean by live queries ?=C2=A0</div><div style=3D"" dir=3D"ltr">If I&#39;ll tr=
y to run the following query and cancel it manually(ctrl+c)=C2=A0: select p=
g_sleep(10)</div><div style=3D"" dir=3D"ltr">I will see in the logs the fol=
lowing messages :=C2=A0</div><div style=3D"" dir=3D"ltr"><br>2019-12-08 17:=
16:34 IST postgres 30797 =C2=A0LOG: =C2=A0statement: select pg_sleep(10);<b=
r></div><div style=3D"" dir=3D"ltr">2019-12-08 17:16:36 IST postgres 30797 =
=C2=A0ERROR: =C2=A0canceling statement due to user request<br>2019-12-08 17=
:16:36 IST postgres 30797 =C2=A0STATEMENT: =C2=A0select pg_sleep(10);</div>=
<div style=3D"" dir=3D"ltr"><br></div><div style=3D"" dir=3D"ltr">The first=
 message indicates that I run this query (logged because I set log_statemen=
ts to all) and the two next messages appear because I canceled the query.</=
div><div style=3D"" dir=3D"ltr">When it happens=C2=A0to my application I do=
nt see the first message that indicates that I run it and thats what I&#39;=
m trying to understand.</div></div><div class=3D"gmail_quote"><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
d rgb(204,204,204);padding-left:1ex"><div dir=3D"auto"><blockquote type=3D"=
cite"><div dir=3D"ltr">
</div></blockquote></div></blockquote></div></div>

--000000000000b55595059932cb35--