In pipeline mode, an invalid \getresults argument could previously affect the next SQL command in the same pipeline. For example, after reporting an error for \getresults -1, psql could treat the following SQL command as a request to read pending pipeline results instead of sending it to the server, making the command appear to be skipped or causing missing results. This happened because psql marked \getresults as a request to read pipeline results before validating its optional argument. When validation failed, psql reported the error without running the normal cleanup path that clears the request. Fix this by validating the \getresults argument before marking the command as a request to read pipeline results. After an invalid argument, psql now reports the error and sends the following SQL command normally. Backpatch to v18, where psql pipeline meta-commands were introduced. Author: Fujii Masao <masao.fujii@gmail.com> Reviewed-by: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com> Discussion: https://postgr.es/m/CAHGQGwGkgM2HKZeig5hobEgUCjn7MMJux4UCcN=OfOzOEvRT0A@mail.gmail.com Backpatch-through: 18
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/19/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/19/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.