I successfully pulled the logs by calling http://localhost:8080/debug/logspy?count=10000&duration=10s&grep=.&flatten=1&vmodule=*=2 .
The stmt is executed by this code; it uses psycopg 3.
import psycopg
import time
dburl = "postgres://root@crlMBP-C02D64WKMD6TMjg5.local:26257/defaultdb?sslmode=disable"
with psycopg.connect(dburl, autocommit=True) as conn:
time.sleep(2)
with conn.cursor() as cur0:
cur0.execute("""delete from t where id = any (%s, %s)""", (155, 233), prepare=True)
time.sleep(2)
I purposely sleep between conn creation, stmt exec and termination to identify them later in the log, nicely spaced 2s apart. Note: it's a prepared stmt; it's auto-committed.
In wireshark, the message flow is very clear once I filter for PGSQL (omitted the conn creation messages):
I successfully pulled the logs by calling
http://localhost:8080/debug/logspy?count=10000&duration=10s&grep=.&flatten=1&vmodule=*=2
.The stmt is executed by this code; it uses psycopg 3.
I purposely sleep between conn creation, stmt exec and termination to identify them later in the log, nicely spaced 2s apart. Note: it's a prepared stmt; it's auto-committed.
In wireshark, the message flow is very clear once I filter for PGSQL (omitted the conn creation messages):
In the logs, I see when the connection is created
I see the inbound Parse/Sync
But don't see the outbound
1/Z
that is, the ParseCompletion and ReadyForQuery.Similarly, I see the
B/D/E/S
but don't see the outbound
2/n/C/Z
i.e. BindCompletion, No-data, CommandCompletion, ReadyForQuery.Upon inspecting the code - within my limited understanding of Go - I see that we print out incoming messages https://github.com/cockroachdb/cockroach/blob/v22.2.2/pkg/sql/pgwire/conn.go#L440 (i'm using v22.2.2 locally..) but for example don't see the same line of code for the ReadyForQuery or CommandComplete .
slack
Jira issue: CRDB-25718