Peter Eisentraut <pete...@gmx.net> writes: > The alternatives are now to introduce a new function like has_rows() > that returns True iff result rows exist and therefore result metadata > can be fetched, or go back to having coltypes() et al. return None when > no metadata exists. I'm in favor of the latter, because the former > would add somewhat needless complications and doesn't really add any > robustness or the like.
Seems sensible to me. We had better also document what nrows() really does. Should we also introduce a new function that is "number of rows in the resultset", rather than depending on len()? I think it might be useful, or at least consistent, to have a function defined as "number of rows, or None if the resultset does not contain rows". In particular, I think it is important to be able to distinguish between a command result (which cannot possibly contain rows) and a query result that happens to contain zero rows. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers