On Sun, 2014-06-01 at 04:12 -0600, Warren Young wrote:
> On Jun 1, 2014, at 2:18 AM, Quentin Armitage <quentin@stripped> wrote:
> > Revised patch:
> Thanks, it's applied.
> > Would you be interested in a patch that
> > adds checks for connected?
> Not really.
> I think the explicit checks are the problem, rather than the inverse. Attempting to
> execute a query on a disconnected object will cause an error, so it’s not like the
> problem will go unnoticed.
> But, I can’t just remove them — or ask you to remove them — in case
> someone is depending on the current behavior. For all I know, someone is doing a string
> check on the exact error message, and their code will break if we remove the explicit
> I think I will remove them in 4.0, though.
My initial reaction was to agree with this, but on reflection I think it
is helpful to have the checks. When developing code, occasionally I have
a bug where I attempt to execute a query on a closed connection, and the
application then coredumps (if coredumps are enabled). I feel it would
be more helpful for debugging purposes for an exception to be thrown
which can then be cleanly reported/handled.