Re: Wrong usage of pqMsg_Close message code?

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: Wrong usage of pqMsg_Close message code?
Date: 2023-08-28 12:00:26
Message-ID: CAJ7c6TPYi5cvMpptYhr+DqBhPcVhciAG-n9kxBro_Q5=NXbY7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Pavel,

> There is message PqMsgClose, but this should be used from client side. Here should be used PqMsg_CommandComplete instead?

It seems so. This change was introduced in f4b54e1ed98 [1]:

```
--- a/src/backend/tcop/dest.c
+++ b/src/backend/tcop/dest.c
@@ -176,7 +176,7 @@ EndCommand(const QueryCompletion *qc, CommandDest
dest, bool force_undecorated_o

len = BuildQueryCompletionString(completionTag, qc,

force_undecorated_output);
- pq_putmessage('C', completionTag, len + 1);
+ pq_putmessage(PqMsg_Close, completionTag, len + 1);

case DestNone:
case DestDebug
```

It should have been PqMsg_CommandComplete.

[1]: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=f4b54e1ed98

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2023-08-28 12:09:37 Re: Return value of pg_promote()
Previous Message Pavel Stehule 2023-08-28 11:58:55 Re: proposal: psql: show current user in prompt