CommandStatus from insert returning when using a portal.

From: Dave Cramer <davecramer(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: CommandStatus from insert returning when using a portal.
Date: 2023-07-12 20:03:15
Message-ID: CADK3HHKn-7wghU7GzY3pSBuQsyXv2=w2_g7KKYm9cGRLfL=JtA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

With a simple insert such as

INSERT INTO test_table (cnt) VALUES (1), (2) RETURNING id

if a portal is used to get the results then the CommandStatus is not
returned on the execute only when the portal is closed. After looking at
this more it is really after all of the data is read which is consistent if
you don't use a portal, however it would be much more useful if we received
the CommandStatus after the insert was completed and before the data

Obviously I am biased by the JDBC API which would like to have

PreparedStatement.execute() return the number of rows inserted
without having to wait to read all of the rows returned

Dave Cramer

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2023-07-12 20:31:04 Re: CommandStatus from insert returning when using a portal.
Previous Message Robert Haas 2023-07-12 20:02:23 Re: 'ERROR: attempted to update invisible tuple' from 'ALTER INDEX ... ATTACH PARTITION' on parent index