From: | Dave Cramer <davecramer(at)gmail(dot)com> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: CommandStatus from insert returning when using a portal. |
Date: | 2023-07-12 21:09:27 |
Message-ID: | CADK3HHK7wS=wLxN8oyVdxK=-pYR=A0r2yFSNuG_BvK+2KtTcpA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Dave Cramer
On Wed, 12 Jul 2023 at 16:31, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
wrote:
> On Wed, Jul 12, 2023 at 1:03 PM Dave Cramer <davecramer(at)gmail(dot)com> wrote:
>
>>
>> INSERT INTO test_table (cnt) VALUES (1), (2) RETURNING id
>>
>> if a portal is used to get the results then the CommandStatus
>>
>
> IIUC the portal is not optional if you including the RETURNING clause.
>
From my testing it isn't required.
>
> There is no CommandStatus message in the protocol, the desired information
> is part of the command tag returned in the CommandComplete message. You
> get that at the end of the command, which has been defined as when any
> portal produced by the command has been fully executed.
>
I could argue that the insert is fully completed whether I read the data or
not.
>
> You probably should add your desire to the Version 4 protocol ToDo on the
> wiki.
>
> https://wiki.postgresql.org/wiki/Todo#Wire_Protocol_Changes_.2F_v4_Protocol
>
thx, will do.
Dave
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2023-07-12 21:49:23 | Re: CommandStatus from insert returning when using a portal. |
Previous Message | Gurjeet Singh | 2023-07-12 20:37:14 | Re: CommandStatus from insert returning when using a portal. |