Re: [PATCH] Add result_types column to pg_prepared_statements view
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2022-07-05T09:20:53Z
Lists: pgsql-hackers
On 05.07.22 09:31, Dagfinn Ilmari Mannsåker wrote: > On Tue, 5 Jul 2022, at 06:34, Peter Eisentraut wrote: >> On 01.07.22 14:27, Dagfinn Ilmari Mannsåker wrote: >>> Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes: >>> >>>> On 19.05.22 17:34, Dagfinn Ilmari Mannsåker wrote: >>>>> Prompted by a question on IRC, here's a patch to add a result_types >>>>> column to the pg_prepared_statements view, so that one can see the types >>>>> of the columns returned by a prepared statement, not just the parameter >>>>> types. >>>>> I'm not quite sure about the column name, suggestions welcome. >>>> >>>> I think this patch is sensible. >> >>> The arguments about client-side type-specific value handling for >>> RowDescription don't apply here IMO, since this view is more >>> user-facing. >> >> I agree. It's also easy to change if needed. Committed as is. > > Thanks! There was a problem that we didn't cover: Not all prepared statements have result descriptors (e.g., DML statements), so that would crash as written. I have changed it to return null for result_types in that case, and added a test case.
Commits
-
Add result_types column to pg_prepared_statements view
- 84ad713cf85a 16.0 landed
-
In RowDescription messages, report columns of domain datatypes as having
- d9b679c13a82 7.4.1 cited