In the final fallback poolOrConfig || {}:
we should check that poolOrConfig is a simple object (and not, for example, a pool returned from a different version of the pg module 馃槨 ) and throw with a helpful error if not.
Just stumbled upon this myself, a documentation page has pg-pool as an example, which isn't an instance of Pool from pg module, which causes errors. That documentation page should be fixed as well.
We have quacksLikePgPool now; so due to this duck-typing this shouldn't be an issue any more.
Most helpful comment
Just stumbled upon this myself, a documentation page has
pg-poolas an example, which isn't an instance ofPoolfrompgmodule, which causes errors. That documentation page should be fixed as well.