PyGreSQL icon indicating copy to clipboard operation
PyGreSQL copied to clipboard

Consistent handling of disabled features

Open Cito opened this issue 6 years ago • 0 comments

PyGreSQL has some preprocessor macros such as SSL_INFO that control which features are enabled. Some features may be disabled when they are not supported by the installed PostgreSQL version.

The behavior for features that are not enabled should be consistent: Either these methods/attributes should simply not be provided (using them will raise AttributeErrors) or they should be always available, but using them should raise NotSupportedError.

Currently the behavior is mostly the former, but not very consistent. The latter has the advantage that the behavior will be the same when an old version of libpq is installed and used at runtime, and applications need only one type of check to safeguard against old libpq versions.

Cito avatar Mar 28 '20 17:03 Cito