mirror of
https://github.com/postgres/postgres.git
synced 2025-06-25 01:02:05 +03:00
PL/Python: Fix crash when colnames() etc. called without result set
The result object methods colnames() etc. would crash when called after a command that did not produce a result set. Now they throw an exception. discovery and initial patch by Jean-Baptiste Quenot
This commit is contained in:
@ -935,6 +935,14 @@ foo = rv[i]["my_column"]
|
||||
Return a list of column names, list of column type OIDs, and list of
|
||||
type-specific type modifiers for the columns, respectively.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
These methods raise an exception when called on a result object from
|
||||
a command that did not produce a result set, e.g.,
|
||||
<command>UPDATE</command> without <literal>RETURNING</literal>, or
|
||||
<command>DROP TABLE</command>. But it is OK to use these methods on
|
||||
a result set containing zero rows.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
Reference in New Issue
Block a user