/* Generated by Cython 3.0.0a11 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [],
        "include_dirs": [
            "/usr/include/postgresql"
        ],
        "libraries": [
            "pq"
        ],
        "library_dirs": [
            "/usr/lib/x86_64-linux-gnu"
        ],
        "name": "psycopg_c.pq",
        "sources": [
            "psycopg_c/pq.pyx"
        ]
    },
    "module_name": "psycopg_c.pq"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#if defined(CYTHON_LIMITED_API) && 0
  #ifndef Py_LIMITED_API
    #if CYTHON_LIMITED_API+0 > 0x03030000
      #define Py_LIMITED_API CYTHON_LIMITED_API
    #else
      #define Py_LIMITED_API 0x03030000
    #endif
  #endif
#endif

#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.7+ or Python 3.3+.
#else
#define CYTHON_ABI "3_0_0a11"
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
#define CYTHON_HEX_VERSION 0x030000AB
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
  #endif
#elif defined(CYTHON_LIMITED_API)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_CLINE_IN_TRACEBACK
  #define CYTHON_CLINE_IN_TRACEBACK 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 1
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
#elif defined(PY_NOGIL)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #ifndef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #if PY_VERSION_HEX < 0x030400a1
    #undef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #elif !defined(CYTHON_USE_TP_FINALIZE)
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #if PY_VERSION_HEX < 0x030600B1
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS 1
  #endif
  #if PY_VERSION_HEX < 0x030700A3
    #undef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 0
  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if !defined(CYTHON_VECTORCALL)
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_MAJOR_VERSION < 3
    #include "longintrepr.h"
  #endif
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
            typedef unsigned char     uint8_t;
            typedef unsigned short    uint16_t;
            typedef unsigned int      uint32_t;
        #else
            typedef unsigned __int8   uint8_t;
            typedef unsigned __int16  uint16_t;
            typedef unsigned __int32  uint32_t;
        #endif
    #endif
    #if _MSC_VER < 1300
        #ifdef _WIN64
            typedef unsigned long long  __pyx_uintptr_t;
        #else
            typedef unsigned int        __pyx_uintptr_t;
        #endif
    #else
        #ifdef _WIN64
            typedef unsigned __int64    __pyx_uintptr_t;
        #else
            typedef unsigned __int32    __pyx_uintptr_t;
        #endif
    #endif
#else
    #include <stdint.h>
    typedef uintptr_t  __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_DefaultClassType PyClass_Type
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if PY_VERSION_HEX >= 0x030B00A1
    static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
        PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
        PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
        const char *fn_cstr=NULL;
        const char *name_cstr=NULL;
        PyCodeObject* co=NULL;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        if (!(kwds=PyDict_New())) goto end;
        if (!(argcount=PyLong_FromLong(a))) goto end;
        if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
        if (!(posonlyargcount=PyLong_FromLong(p))) goto end;
        if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
        if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
        if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
        if (!(nlocals=PyLong_FromLong(l))) goto end;
        if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
        if (!(stacksize=PyLong_FromLong(s))) goto end;
        if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
        if (!(flags=PyLong_FromLong(f))) goto end;
        if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
        if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
        if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
        if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
        if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
        if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
        if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
        Py_XDECREF((PyObject*)co);
        co = (PyCodeObject*)call_result;
        call_result = NULL;
        if (0) {
            cleanup_code_too:
            Py_XDECREF((PyObject*)co);
            co = NULL;
        }
        end:
        Py_XDECREF(kwds);
        Py_XDECREF(argcount);
        Py_XDECREF(posonlyargcount);
        Py_XDECREF(kwonlyargcount);
        Py_XDECREF(nlocals);
        Py_XDECREF(stacksize);
        Py_XDECREF(replace);
        Py_XDECREF(call_result);
        Py_XDECREF(empty);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return co;
    }
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#endif
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#ifndef CO_COROUTINE
  #define CO_COROUTINE 0x80
#endif
#ifndef CO_ASYNC_GENERATOR
  #define CO_ASYNC_GENERATOR 0x200
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX < 0x030900B1
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if PY_MAJOR_VERSION < 3
    #if CYTHON_COMPILING_IN_PYPY
        #if PYPY_VERSION_NUM < 0x07030600
            #if defined(__cplusplus) && __cplusplus >= 201402L
                [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
            #elif defined(__GNUC__) || defined(__clang__)
                __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
            #elif defined(_MSC_VER)
                __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
            #endif
            static CYTHON_INLINE int PyGILState_Check(void) {
                return 0;
            }
        #else  // PYPY_VERSION_NUM < 0x07030600
        #endif  // PYPY_VERSION_NUM < 0x07030600
    #else
        static CYTHON_INLINE int PyGILState_Check(void) {
            PyThreadState * tstate = _PyThreadState_Current;
            return tstate && (tstate == PyGILState_GetThisThreadState());
        }
    #endif
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  (Py_TYPE(obj)->tp_iternext)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  PyIter_Next
#endif
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE(obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GetLength(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         ((int)sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
    #undef PyUnicode_Contains
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #if !defined(_USE_MATH_DEFINES)
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#define __PYX_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__psycopg_c__pq
#define __PYX_HAVE_API__psycopg_c__pq
/* Early includes */

#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
    typedef signed pid_t;
#else
    #include <fcntl.h>
#endif
    
#include "pg_config.h"
#include "libpq-fe.h"

/* Hack to allow the use of old libpq versions */
#if PG_VERSION_NUM < 100000
#define PQencryptPasswordConn(conn, passwd, user, algorithm) NULL
#endif

#if PG_VERSION_NUM < 120000
#define PQhostaddr(conn) NULL
#endif

#if PG_VERSION_NUM < 140000
#define PGRES_PIPELINE_SYNC 10
#define PGRES_PIPELINE_ABORTED 11
typedef enum {
    PQ_PIPELINE_OFF,
    PQ_PIPELINE_ON,
    PQ_PIPELINE_ABORTED
} PGpipelineStatus;
#define PQpipelineStatus(conn) PQ_PIPELINE_OFF
#define PQenterPipelineMode(conn) 0
#define PQexitPipelineMode(conn) 1
#define PQpipelineSync(conn) 0
#define PQsendFlushRequest(conn) 0
#endif


#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
    /* We don't need a real definition for this because Windows is not affected
     * by the issue caused by closing the fds after fork.
     */
    #define getpid() (0)
#else
    #include <unistd.h>
#endif
    
#include <string.h>
#include <stdio.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
{
    const wchar_t *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* #### Code section: filename_table ### */

static const char *__pyx_f[] = {
  "psycopg_c/pq/pgconn.pyx",
  "<stringsource>",
  "psycopg_c/pq.pyx",
  "psycopg_c/pq/pgresult.pyx",
  "psycopg_c/pq/pgcancel.pyx",
  "psycopg_c/pq/conninfo.pyx",
  "psycopg_c/pq/escaping.pyx",
  "psycopg_c/pq/pqbuffer.pyx",
  ".eggs/Cython-3.0.0a11-py3.9-linux-x86_64.egg/Cython/Includes/cpython/type.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()

/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* #### Code section: numeric_typedefs ### */
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_9psycopg_c_2pq_PGconn;
struct __pyx_obj_9psycopg_c_2pq_PGresult;
struct __pyx_obj_9psycopg_c_2pq_PGcancel;
struct __pyx_obj_9psycopg_c_2pq_Escaping;
struct __pyx_obj_9psycopg_c_2pq_PQBuffer;
struct __pyx_obj_9psycopg_c_2pq_ViewBuffer;
struct __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc;
typedef struct __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc;

/* "psycopg_c/pq.pxd":16
 * from psycopg_c.pq cimport libpq
 * 
 * ctypedef char *(*conn_bytes_f) (const libpq.PGconn *)             # <<<<<<<<<<<<<<
 * ctypedef int(*conn_int_f) (const libpq.PGconn *)
 * 
 */
typedef char *(*__pyx_t_9psycopg_c_2pq_conn_bytes_f)(PGconn const *);

/* "psycopg_c/pq.pxd":17
 * 
 * ctypedef char *(*conn_bytes_f) (const libpq.PGconn *)
 * ctypedef int(*conn_int_f) (const libpq.PGconn *)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef int (*__pyx_t_9psycopg_c_2pq_conn_int_f)(PGconn const *);

/* "psycopg_c/pq/pgconn.pyx":651
 * 
 * 
 * cdef (Py_ssize_t, libpq.Oid *, char * const*, int *, int *) _query_params_args(             # <<<<<<<<<<<<<<
 *     list param_values: Optional[Sequence[Optional[bytes]]],
 *     param_types: Optional[Sequence[int]],
 */
struct __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc {
  Py_ssize_t f0;
  Oid *f1;
  char *const *f2;
  int *f3;
  int *f4;
};

/* "psycopg_c/pq.pxd":20
 * 
 * 
 * cdef class PGconn:             # <<<<<<<<<<<<<<
 *     cdef libpq.PGconn* _pgconn_ptr
 *     cdef object __weakref__
 */
struct __pyx_obj_9psycopg_c_2pq_PGconn {
  PyObject_HEAD
  struct __pyx_vtabstruct_9psycopg_c_2pq_PGconn *__pyx_vtab;
  PGconn *_pgconn_ptr;
  PyObject *__weakref__;
  PyObject *notice_handler;
  PyObject *notify_handler;
  pid_t _procpid;
};


/* "psycopg_c/pq.pxd":33
 * 
 * 
 * cdef class PGresult:             # <<<<<<<<<<<<<<
 *     cdef libpq.PGresult* _pgresult_ptr
 * 
 */
struct __pyx_obj_9psycopg_c_2pq_PGresult {
  PyObject_HEAD
  struct __pyx_vtabstruct_9psycopg_c_2pq_PGresult *__pyx_vtab;
  PGresult *_pgresult_ptr;
};


/* "psycopg_c/pq.pxd":40
 * 
 * 
 * cdef class PGcancel:             # <<<<<<<<<<<<<<
 *     cdef libpq.PGcancel* pgcancel_ptr
 * 
 */
struct __pyx_obj_9psycopg_c_2pq_PGcancel {
  PyObject_HEAD
  struct __pyx_vtabstruct_9psycopg_c_2pq_PGcancel *__pyx_vtab;
  PGcancel *pgcancel_ptr;
};


/* "psycopg_c/pq.pxd":47
 * 
 * 
 * cdef class Escaping:             # <<<<<<<<<<<<<<
 *     cdef PGconn conn
 * 
 */
struct __pyx_obj_9psycopg_c_2pq_Escaping {
  PyObject_HEAD
  struct __pyx_vtabstruct_9psycopg_c_2pq_Escaping *__pyx_vtab;
  struct __pyx_obj_9psycopg_c_2pq_PGconn *conn;
};


/* "psycopg_c/pq.pxd":57
 * 
 * 
 * cdef class PQBuffer:             # <<<<<<<<<<<<<<
 *     cdef unsigned char *buf
 *     cdef Py_ssize_t len
 */
struct __pyx_obj_9psycopg_c_2pq_PQBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_9psycopg_c_2pq_PQBuffer *__pyx_vtab;
  unsigned char *buf;
  Py_ssize_t len;
};


/* "psycopg_c/pq.pxd":65
 * 
 * 
 * cdef class ViewBuffer:             # <<<<<<<<<<<<<<
 *     cdef unsigned char *buf
 *     cdef Py_ssize_t len
 */
struct __pyx_obj_9psycopg_c_2pq_ViewBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_9psycopg_c_2pq_ViewBuffer *__pyx_vtab;
  unsigned char *buf;
  Py_ssize_t len;
  PyObject *obj;
};



/* "psycopg_c/pq/pgconn.pyx":35
 * 
 * 
 * cdef class PGconn:             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):
 */

struct __pyx_vtabstruct_9psycopg_c_2pq_PGconn {
  struct __pyx_obj_9psycopg_c_2pq_PGconn *(*_from_ptr)(PGconn *);
  PyObject *(*notifies)(struct __pyx_obj_9psycopg_c_2pq_PGconn *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9psycopg_c_2pq_PGconn *__pyx_vtabptr_9psycopg_c_2pq_PGconn;


/* "psycopg_c/pq/pgresult.pyx":15
 * 
 * @cython.freelist(8)
 * cdef class PGresult:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         self._pgresult_ptr = NULL
 */

struct __pyx_vtabstruct_9psycopg_c_2pq_PGresult {
  struct __pyx_obj_9psycopg_c_2pq_PGresult *(*_from_ptr)(PGresult *);
};
static struct __pyx_vtabstruct_9psycopg_c_2pq_PGresult *__pyx_vtabptr_9psycopg_c_2pq_PGresult;


/* "psycopg_c/pq/pgcancel.pyx":8
 * 
 * 
 * cdef class PGcancel:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         self.pgcancel_ptr = NULL
 */

struct __pyx_vtabstruct_9psycopg_c_2pq_PGcancel {
  struct __pyx_obj_9psycopg_c_2pq_PGcancel *(*_from_ptr)(PGcancel *);
};
static struct __pyx_vtabstruct_9psycopg_c_2pq_PGcancel *__pyx_vtabptr_9psycopg_c_2pq_PGcancel;


/* "psycopg_c/pq/escaping.pyx":13
 * 
 * 
 * cdef class Escaping:             # <<<<<<<<<<<<<<
 *     def __init__(self, PGconn conn = None):
 *         self.conn = conn
 */

struct __pyx_vtabstruct_9psycopg_c_2pq_Escaping {
  PyObject *(*escape_literal)(struct __pyx_obj_9psycopg_c_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*escape_identifier)(struct __pyx_obj_9psycopg_c_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*escape_string)(struct __pyx_obj_9psycopg_c_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*escape_bytea)(struct __pyx_obj_9psycopg_c_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*unescape_bytea)(struct __pyx_obj_9psycopg_c_2pq_Escaping *, unsigned char const *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9psycopg_c_2pq_Escaping *__pyx_vtabptr_9psycopg_c_2pq_Escaping;


/* "psycopg_c/pq/pqbuffer.pyx":14
 * 
 * @cython.freelist(32)
 * cdef class PQBuffer:             # <<<<<<<<<<<<<<
 *     """
 *     Wrap a chunk of memory allocated by the libpq and expose it as memoryview.
 */

struct __pyx_vtabstruct_9psycopg_c_2pq_PQBuffer {
  struct __pyx_obj_9psycopg_c_2pq_PQBuffer *(*_from_buffer)(unsigned char *, Py_ssize_t);
};
static struct __pyx_vtabstruct_9psycopg_c_2pq_PQBuffer *__pyx_vtabptr_9psycopg_c_2pq_PQBuffer;


/* "psycopg_c/pq/pqbuffer.pyx":57
 * 
 * @cython.freelist(32)
 * cdef class ViewBuffer:             # <<<<<<<<<<<<<<
 *     """
 *     Wrap a chunk of memory owned by a different object.
 */

struct __pyx_vtabstruct_9psycopg_c_2pq_ViewBuffer {
  struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *(*_from_buffer)(PyObject *, unsigned char *, Py_ssize_t);
};
static struct __pyx_vtabstruct_9psycopg_c_2pq_ViewBuffer *__pyx_vtabptr_9psycopg_c_2pq_ViewBuffer;
/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
  #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
#endif
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_XINCREF(r)  do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* TupleAndListFromArray.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* fastcall.proto */
#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_Arg_FASTCALL(args, i) args[i]
    #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
#else
    #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
#else
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* KeywordStringCheck.proto */
static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#if !CYTHON_VECTORCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
#if !CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03080000
  #include "frameobject.h"
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
  #define __Pxy_PyFrame_Initialize_Offsets()
  #define __Pyx_PyFrame_GetLocalsplus(frame)  ((frame)->f_localsplus)
#else
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif
#endif
#endif

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectFastCall.proto */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif PY_MAJOR_VERSION < 3
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* PyObjectFormat.proto */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* GCCDiagnostics.proto */
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* BuildPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char);

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
    const char* function_name);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);

/* decode_c_string_utf16.proto */
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 0;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = -1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}

/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* ssize_strlen.proto */
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* IncludeStructmemberH.proto */
#include <structmember.h>

/* FixUpExtensionType.proto */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
#endif

/* PyObjectCallNoArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* ValidateBasesTuple.proto */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif

/* PyType_Ready.proto */
static CYTHON_UNUSED int __Pyx_PyType_Ready(PyTypeObject *t);

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* MergeVTables.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type);
#endif

/* SetupReduce.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce(PyObject* type_obj);
#endif

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
#if __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize check_size);
#endif

/* FetchSharedCythonModule.proto */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* FetchCommonType.proto */
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
#else
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
#endif

/* PyMethodNew.proto */
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#else
    #define __Pyx_PyMethod_New PyMethod_New
#endif

/* PyVectorcallFastCallDict.proto */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1
  #define __Pyx_CyFunction_GetClassObj(f)\
      (((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
  #define __Pyx_CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
#if PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_BACKPORT_VECTORCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1
    PyObject *func_classobj;
#endif
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;  // used by FusedFunction for copying defaults
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#if !CYTHON_USE_MODULE_STATE
static PyTypeObject *__pyx_CyFunctionType = 0;
#endif
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
#define __Pyx_IsCyOrPyCFunction(obj)  __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_BACKPORT_VECTORCALL
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* ImportDottedModule.proto */
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);

/* ClassMethod.proto */
#include "descrobject.h"
static CYTHON_UNUSED PyObject* __Pyx_Method_ClassMethod(PyObject *method);

/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* PyObjectCall2Args.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
#define __Pyx_PyObject_LookupSpecial(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
#else
#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
#endif

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PGPing(PGPing value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ConnStatusType(ConnStatusType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PGTransactionStatusType(PGTransactionStatusType value);

/* CIntFromPy.proto */
static CYTHON_INLINE Oid __Pyx_PyInt_As_Oid(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PGpipelineStatus(PGpipelineStatus value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ExecStatusType(ExecStatusType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Oid(Oid value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#else
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_Occurred(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);

/* InitStrings.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str);
#else
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
#endif

/* #### Code section: module_declarations ### */
static struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_f_9psycopg_c_2pq_6PGconn__from_ptr(PGconn *__pyx_v_ptr); /* proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_6PGconn_notifies(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(PGresult *__pyx_v_ptr); /* proto*/
static struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_f_9psycopg_c_2pq_8PGcancel__from_ptr(PGcancel *__pyx_v_ptr); /* proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_8Escaping_escape_literal(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_8Escaping_escape_identifier(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_8Escaping_escape_string(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_8Escaping_escape_bytea(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_8Escaping_unescape_bytea(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, unsigned char const *__pyx_v_data, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_f_9psycopg_c_2pq_8PQBuffer__from_buffer(unsigned char *__pyx_v_buf, Py_ssize_t __pyx_v_length); /* proto*/
static struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_f_9psycopg_c_2pq_10ViewBuffer__from_buffer(PyObject *__pyx_v_obj, unsigned char *__pyx_v_buf, Py_ssize_t __pyx_v_length); /* proto*/

/* Module declarations from "psycopg_c.pq.libpq" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "cpython.mem" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "libc.string" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "libc.stdio" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "__builtin__" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "cpython.type" */
#if !CYTHON_USE_MODULE_STATE
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
#endif

/* Module declarations from "cpython" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "cpython.object" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "cpython.bytes" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "cpython.memoryview" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "cython" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "cpython.bytearray" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "cpython.buffer" */
#if !CYTHON_USE_MODULE_STATE
#endif

/* Module declarations from "psycopg_c.pq" */
#if !CYTHON_USE_MODULE_STATE
static PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PGconn = 0;
static PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PGresult = 0;
static PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PGcancel = 0;
static PyTypeObject *__pyx_ptype_9psycopg_c_2pq_Escaping = 0;
static PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PQBuffer = 0;
static PyTypeObject *__pyx_ptype_9psycopg_c_2pq_ViewBuffer = 0;
#endif
static int __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(PyObject *, char **, Py_ssize_t *); /*proto*/
static int __pyx_f_9psycopg_c_2pq__ensure_pgconn(struct __pyx_obj_9psycopg_c_2pq_PGconn *); /*proto*/
static char *__pyx_f_9psycopg_c_2pq__call_bytes(struct __pyx_obj_9psycopg_c_2pq_PGconn *, __pyx_t_9psycopg_c_2pq_conn_bytes_f); /*proto*/
static int __pyx_f_9psycopg_c_2pq__call_int(struct __pyx_obj_9psycopg_c_2pq_PGconn *, __pyx_t_9psycopg_c_2pq_conn_int_f); /*proto*/
static void __pyx_f_9psycopg_c_2pq_notice_receiver(void *, PGresult const *); /*proto*/
static __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc __pyx_f_9psycopg_c_2pq__query_params_args(PyObject *, PyObject *, PyObject *); /*proto*/
static void __pyx_f_9psycopg_c_2pq__clear_query_params(Oid *, char *const *, int *, int *); /*proto*/
static PyObject *__pyx_f_9psycopg_c_2pq__options_from_array(PQconninfoOption *); /*proto*/
static PyObject *__pyx_f_9psycopg_c_2pq___pyx_unpickle_Escaping__set_state(struct __pyx_obj_9psycopg_c_2pq_Escaping *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "psycopg_c.pq"
extern int __pyx_module_is_main_psycopg_c__pq;
int __pyx_module_is_main_psycopg_c__pq = 0;

/* Implementation of "psycopg_c.pq" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_ValueError;
/* #### Code section: string_decls ### */
static const char __pyx_k_[] = ".";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_v[] = "v";
static const char __pyx_k_x[] = "x";
static const char __pyx_k__2[] = "<";
static const char __pyx_k__3[] = " ";
static const char __pyx_k__4[] = ">";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_rv[] = "rv";
static const char __pyx_k__12[] = "";
static const char __pyx_k__14[] = " [";
static const char __pyx_k__17[] = " (";
static const char __pyx_k__18[] = ")>";
static const char __pyx_k__19[] = "(";
static const char __pyx_k__20[] = ")";
static const char __pyx_k__23[] = "*";
static const char __pyx_k_buf[] = "buf";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_exc[] = "exc";
static const char __pyx_k_got[] = "got ";
static const char __pyx_k_int[] = "int";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_num[] = "num";
static const char __pyx_k_out[] = "out";
static const char __pyx_k_ptr[] = "ptr";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_ssl[] = "ssl";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_None[] = "None";
static const char __pyx_k_TEXT[] = "TEXT";
static const char __pyx_k__130[] = "?";
static const char __pyx_k_ccol[] = "ccol";
static const char __pyx_k_cerr[] = "cerr";
static const char __pyx_k_conn[] = "conn";
static const char __pyx_k_crow[] = "crow";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_exec[] = "exec_";
static const char __pyx_k_fmod[] = "fmod";
static const char __pyx_k_free[] = "free";
static const char __pyx_k_impl[] = "__impl__";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_opts[] = "opts";
static const char __pyx_k_ping[] = "ping";
static const char __pyx_k_repr[] = "__repr__";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_user[] = "user";
static const char __pyx_k_ascii[] = "ascii";
static const char __pyx_k_async[] = "async_";
static const char __pyx_k_at_0x[] = " at 0x";
static const char __pyx_k_attrs[] = "attrs";
static const char __pyx_k_bytes[] = " bytes";
static const char __pyx_k_calgo[] = "calgo";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_descr[] = "descr";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_flush[] = "flush";
static const char __pyx_k_fname[] = "fname";
static const char __pyx_k_fsize[] = "fsize";
static const char __pyx_k_ftype[] = "ftype";
static const char __pyx_k_label[] = "label";
static const char __pyx_k_parse[] = "parse";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_reset[] = "reset";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_typid[] = "typid";
static const char __pyx_k_Format[] = "Format";
static const char __pyx_k_PGconn[] = "PGconn";
static const char __pyx_k_atypes[] = "atypes";
static const char __pyx_k_buffer[] = "buffer";
static const char __pyx_k_cancel[] = "cancel";
static const char __pyx_k_ctypes[] = "ctypes";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_dict_2[] = "_dict";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_envvar[] = "envvar";
static const char __pyx_k_errmsg[] = "errmsg";
static const char __pyx_k_errors[] = "errors";
static const char __pyx_k_finish[] = "finish";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_ftable[] = "ftable";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_logger[] = "logger";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_nbytes[] = "nbytes";
static const char __pyx_k_passwd[] = "passwd";
static const char __pyx_k_pgconn[] = "pgconn";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_return[] = "return";
static const char __pyx_k_status[] = "status";
static const char __pyx_k_typing[] = "typing";
static const char __pyx_k_typlen[] = "typlen";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_at_0x_2[] = "] at 0x";
static const char __pyx_k_bytes_2[] = "bytes";
static const char __pyx_k_cbuffer[] = "cbuffer";
static const char __pyx_k_command[] = "command";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_cvalues[] = "cvalues";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_fformat[] = "fformat";
static const char __pyx_k_is_busy[] = "is_busy";
static const char __pyx_k_keyword[] = "keyword";
static const char __pyx_k_logging[] = "logging";
static const char __pyx_k_nparams[] = "nparams";
static const char __pyx_k_prepare[] = "prepare";
static const char __pyx_k_psycopg[] = "psycopg";
static const char __pyx_k_tableid[] = "tableid";
static const char __pyx_k_version[] = "version";
static const char __pyx_k_Conninfo[] = "Conninfo";
static const char __pyx_k_Escaping[] = "Escaping";
static const char __pyx_k_Iterator[] = "Iterator";
static const char __pyx_k_PGcancel[] = "PGcancel";
static const char __pyx_k_PGnotify[] = "PGnotify";
static const char __pyx_k_PGresult[] = "PGresult";
static const char __pyx_k_PQBuffer[] = "PQBuffer";
static const char __pyx_k_PqFormat[] = "PqFormat";
static const char __pyx_k_cformats[] = "cformats";
static const char __pyx_k_clengths[] = "clengths";
static const char __pyx_k_cnparams[] = "cnparams";
static const char __pyx_k_columnid[] = "columnid";
static const char __pyx_k_compiled[] = "compiled";
static const char __pyx_k_conninfo[] = "conninfo";
static const char __pyx_k_dispchar[] = "dispchar";
static const char __pyx_k_dispsize[] = "dispsize";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_notifies[] = "notifies";
static const char __pyx_k_pgresult[] = "pgresult";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_set_name[] = "__set_name__";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_algorithm[] = "algorithm";
static const char __pyx_k_atttypmod[] = "atttypmod";
static const char __pyx_k_exception[] = "exception";
static const char __pyx_k_fieldcode[] = "fieldcode";
static const char __pyx_k_ftablecol[] = "ftablecol";
static const char __pyx_k_getLogger[] = "getLogger";
static const char __pyx_k_get_value[] = "get_value";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_prepare_2[] = "__prepare__";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_ExecStatus[] = "ExecStatus";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_ViewBuffer[] = "ViewBuffer";
static const char __pyx_k_buffer_ptr[] = "buffer_ptr";
static const char __pyx_k_get_cancel[] = "get_cancel";
static const char __pyx_k_get_result[] = "get_result";
static const char __pyx_k_param_type[] = "param_type";
static const char __pyx_k_psycopg_pq[] = "psycopg.pq";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_reset_poll[] = "reset_poll";
static const char __pyx_k_row_number[] = "row_number";
static const char __pyx_k_send_query[] = "send_query";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_PGconn_exec[] = "PGconn.exec_";
static const char __pyx_k_PGconn_ping[] = "PGconn.ping";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_error_field[] = "error_field";
static const char __pyx_k_exec_params[] = "exec_params";
static const char __pyx_k_exec_status[] = "exec_status";
static const char __pyx_k_param_types[] = "param_types";
static const char __pyx_k_reset_start[] = "reset_start";
static const char __pyx_k_PGconn_flush[] = "PGconn.flush";
static const char __pyx_k_PGconn_reset[] = "PGconn.reset";
static const char __pyx_k_PGresAttDesc[] = "PGresAttDesc";
static const char __pyx_k_connect_poll[] = "connect_poll";
static const char __pyx_k_descriptions[] = "descriptions";
static const char __pyx_k_escape_bytea[] = "escape_bytea";
static const char __pyx_k_get_defaults[] = "get_defaults";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_param_number[] = "param_number";
static const char __pyx_k_param_values[] = "param_values";
static const char __pyx_k_psycopg_c_pq[] = "psycopg_c.pq";
static const char __pyx_k_put_copy_end[] = "put_copy_end";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_send_prepare[] = "send_prepare";
static const char __pyx_k_stringsource[] = "<stringsource>";
static const char __pyx_k_use_setstate[] = "use_setstate";
static const char __pyx_k_PGcancel_free[] = "PGcancel.free";
static const char __pyx_k_PGconn_finish[] = "PGconn.finish";
static const char __pyx_k_PGresult_fmod[] = "PGresult.fmod";
static const char __pyx_k_build_version[] = "__build_version__";
static const char __pyx_k_cancel_failed[] = "cancel failed: ";
static const char __pyx_k_column_number[] = "column_number";
static const char __pyx_k_connect_start[] = "connect_start";
static const char __pyx_k_consume_input[] = "consume_input";
static const char __pyx_k_error_message[] = "error_message";
static const char __pyx_k_escape_string[] = "escape_string";
static const char __pyx_k_exec_prepared[] = "exec_prepared";
static const char __pyx_k_get_copy_data[] = "get_copy_data";
static const char __pyx_k_init_subclass[] = "__init_subclass__";
static const char __pyx_k_param_formats[] = "param_formats";
static const char __pyx_k_param_types_2[] = " param_types";
static const char __pyx_k_pipeline_sync[] = "pipeline_sync";
static const char __pyx_k_put_copy_data[] = "put_copy_data";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_result_format[] = "result_format";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_ConninfoOption[] = "ConninfoOption";
static const char __pyx_k_Conninfo_parse[] = "Conninfo.parse";
static const char __pyx_k_Optional_bytes[] = "Optional[bytes]";
static const char __pyx_k_PGconn_connect[] = "PGconn.connect";
static const char __pyx_k_PGconn_is_busy[] = "PGconn.is_busy";
static const char __pyx_k_PGconn_prepare[] = "PGconn.prepare";
static const char __pyx_k_PGresult_clear[] = "PGresult.clear";
static const char __pyx_k_PGresult_fname[] = "PGresult.fname";
static const char __pyx_k_PGresult_fsize[] = "PGresult.fsize";
static const char __pyx_k_PGresult_ftype[] = "PGresult.ftype";
static const char __pyx_k_PipelineStatus[] = "PipelineStatus";
static const char __pyx_k_escape_literal[] = "escape_literal";
static const char __pyx_k_set_attributes[] = "set_attributes";
static const char __pyx_k_unescape_bytea[] = "unescape_bytea";
static const char __pyx_k_Conninfo___repr[] = "Conninfo.__repr__";
static const char __pyx_k_PGcancel_cancel[] = "PGcancel.cancel";
static const char __pyx_k_PGconn_notifies[] = "PGconn.notifies";
static const char __pyx_k_PGresult_ftable[] = "PGresult.ftable";
static const char __pyx_k_describe_portal[] = "describe_portal";
static const char __pyx_k_flushing_failed[] = "flushing failed: ";
static const char __pyx_k_param_formats_2[] = " param_formats";
static const char __pyx_k_psycopg_pq_misc[] = "psycopg.pq.misc";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_OperationalError[] = "OperationalError";
static const char __pyx_k_PGresult_fformat[] = "PGresult.fformat";
static const char __pyx_k_encrypt_password[] = "encrypt_password";
static const char __pyx_k_param_values_but[] = " param_values but ";
static const char __pyx_k_parameter_status[] = "parameter_status";
static const char __pyx_k_psycopg_c_pq_pyx[] = "psycopg_c/pq.pyx";
static const char __pyx_k_List_PGresAttDesc[] = "List[PGresAttDesc]";
static const char __pyx_k_NotSupportedError[] = "NotSupportedError";
static const char __pyx_k_Optional_PGresult[] = "Optional['PGresult']";
static const char __pyx_k_PGconn_get_cancel[] = "PGconn.get_cancel";
static const char __pyx_k_PGconn_get_result[] = "PGconn.get_result";
static const char __pyx_k_PGconn_reset_poll[] = "PGconn.reset_poll";
static const char __pyx_k_PGconn_send_query[] = "PGconn.send_query";
static const char __pyx_k_available_instead[] = " available instead";
static const char __pyx_k_describe_prepared[] = "describe_prepared";
static const char __pyx_k_escape_identifier[] = "escape_identifier";
static const char __pyx_k_make_empty_result[] = "make_empty_result";
static const char __pyx_k_psycopg_pq__enums[] = "psycopg.pq._enums";
static const char __pyx_k_send_query_params[] = "send_query_params";
static const char __pyx_k_PGconn_exec_params[] = "PGconn.exec_params";
static const char __pyx_k_PGconn_reset_start[] = "PGconn.reset_start";
static const char __pyx_k_PGresult_ftablecol[] = "PGresult.ftablecol";
static const char __pyx_k_PGresult_get_value[] = "PGresult.get_value";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_connection_summary[] = "connection_summary";
static const char __pyx_k_exit_pipeline_mode[] = "exit_pipeline_mode";
static const char __pyx_k_send_flush_request[] = "send_flush_request";
static const char __pyx_k_List_ConninfoOption[] = "List[ConninfoOption]";
static const char __pyx_k_PGconn_connect_poll[] = "PGconn.connect_poll";
static const char __pyx_k_PGconn_put_copy_end[] = "PGconn.put_copy_end";
static const char __pyx_k_PGconn_send_prepare[] = "PGconn.send_prepare";
static const char __pyx_k_PGresult_param_type[] = "PGresult.param_type";
static const char __pyx_k_enter_pipeline_mode[] = "enter_pipeline_mode";
static const char __pyx_k_send_query_prepared[] = "send_query_prepared";
static const char __pyx_k_set_single_row_mode[] = "set_single_row_mode";
static const char __pyx_k_PGconn_connect_start[] = "PGconn.connect_start";
static const char __pyx_k_PGconn_consume_input[] = "PGconn.consume_input";
static const char __pyx_k_PGconn_exec_prepared[] = "PGconn.exec_prepared";
static const char __pyx_k_PGconn_get_copy_data[] = "PGconn.get_copy_data";
static const char __pyx_k_PGconn_pipeline_sync[] = "PGconn.pipeline_sync";
static const char __pyx_k_PGconn_put_copy_data[] = "PGconn.put_copy_data";
static const char __pyx_k_PGresult_error_field[] = "PGresult.error_field";
static const char __pyx_k_Tuple_int_memoryview[] = "Tuple[int, memoryview]";
static const char __pyx_k_escape_string_failed[] = "escape_string failed: ";
static const char __pyx_k_flush_request_failed[] = "flush request failed: ";
static const char __pyx_k_send_describe_portal[] = "send_describe_portal";
static const char __pyx_k_sending_query_failed[] = "sending query failed: ";
static const char __pyx_k_Conninfo_get_defaults[] = "Conninfo.get_defaults";
static const char __pyx_k_Escaping_escape_bytea[] = "Escaping.escape_bytea";
static const char __pyx_k_Optional_Sequence_int[] = "Optional[Sequence[int]]";
static const char __pyx_k_escape_literal_failed[] = "escape_literal failed: ";
static const char __pyx_k_pyx_unpickle_Escaping[] = "__pyx_unpickle_Escaping";
static const char __pyx_k_Escaping_escape_string[] = "Escaping.escape_string";
static const char __pyx_k_PGconn___reduce_cython[] = "PGconn.__reduce_cython__";
static const char __pyx_k_PGconn_describe_portal[] = "PGconn.describe_portal";
static const char __pyx_k_consuming_input_failed[] = "consuming input failed: ";
static const char __pyx_k_send_describe_prepared[] = "send_describe_prepared";
static const char __pyx_k_the_connection_is_lost[] = "the connection is lost";
static const char __pyx_k_Escaping_escape_literal[] = "Escaping.escape_literal";
static const char __pyx_k_Escaping_unescape_bytea[] = "Escaping.unescape_bytea";
static const char __pyx_k_Optional_Sequence_bytes[] = "Optional[Sequence[bytes]]";
static const char __pyx_k_PGconn_encrypt_password[] = "PGconn.encrypt_password";
static const char __pyx_k_PGconn_parameter_status[] = "PGconn.parameter_status";
static const char __pyx_k_PGresult_set_attributes[] = "PGresult.set_attributes";
static const char __pyx_k_PQsetResultAttrs_failed[] = "PQsetResultAttrs failed";
static const char __pyx_k_failed_to_sync_pipeline[] = "failed to sync pipeline";
static const char __pyx_k_psycopg_c_pq_pgconn_pyx[] = "psycopg_c/pq/pgconn.pyx";
static const char __pyx_k_sending_copy_end_failed[] = "sending copy end failed: ";
static const char __pyx_k_Escaping___reduce_cython[] = "Escaping.__reduce_cython__";
static const char __pyx_k_PGcancel___reduce_cython[] = "PGcancel.__reduce_cython__";
static const char __pyx_k_PGconn___setstate_cython[] = "PGconn.__setstate_cython__";
static const char __pyx_k_PGconn_describe_prepared[] = "PGconn.describe_prepared";
static const char __pyx_k_PGconn_make_empty_result[] = "PGconn.make_empty_result";
static const char __pyx_k_PGconn_send_query_params[] = "PGconn.send_query_params";
static const char __pyx_k_PGresult___reduce_cython[] = "PGresult.__reduce_cython__";
static const char __pyx_k_PQBuffer___reduce_cython[] = "PQBuffer.__reduce_cython__";
static const char __pyx_k_couldn_t_allocate_PGconn[] = "couldn't allocate PGconn";
static const char __pyx_k_escape_identifier_failed[] = "escape_identifier failed: ";
static const char __pyx_k_sending_copy_data_failed[] = "sending copy data failed: ";
static const char __pyx_k_the_connection_is_closed[] = "the connection is closed";
static const char __pyx_k_PGconn_exit_pipeline_mode[] = "PGconn.exit_pipeline_mode";
static const char __pyx_k_PGconn_send_flush_request[] = "PGconn.send_flush_request";
static const char __pyx_k_couldn_t_reset_connection[] = "couldn't reset connection";
static const char __pyx_k_psycopg_c_pq_conninfo_pyx[] = "psycopg_c/pq/conninfo.pyx";
static const char __pyx_k_psycopg_c_pq_escaping_pyx[] = "psycopg_c/pq/escaping.pyx";
static const char __pyx_k_psycopg_c_pq_pgcancel_pyx[] = "psycopg_c/pq/pgcancel.pyx";
static const char __pyx_k_psycopg_c_pq_pgresult_pyx[] = "psycopg_c/pq/pgresult.pyx";
static const char __pyx_k_Escaping___setstate_cython[] = "Escaping.__setstate_cython__";
static const char __pyx_k_Escaping_escape_identifier[] = "Escaping.escape_identifier";
static const char __pyx_k_PGcancel___setstate_cython[] = "PGcancel.__setstate_cython__";
static const char __pyx_k_PGconn_enter_pipeline_mode[] = "PGconn.enter_pipeline_mode";
static const char __pyx_k_PGconn_send_query_prepared[] = "PGconn.send_query_prepared";
static const char __pyx_k_PGconn_set_single_row_mode[] = "PGconn.set_single_row_mode";
static const char __pyx_k_PGresult___setstate_cython[] = "PGresult.__setstate_cython__";
static const char __pyx_k_PQBuffer___setstate_cython[] = "PQBuffer.__setstate_cython__";
static const char __pyx_k_ViewBuffer___reduce_cython[] = "ViewBuffer.__reduce_cython__";
static const char __pyx_k_couldn_t_allocate_PGresult[] = "couldn't allocate PGresult";
static const char __pyx_k_error_in_notice_receiver_s[] = "error in notice receiver: %s";
static const char __pyx_k_password_encryption_failed[] = "password encryption failed: ";
static const char __pyx_k_receiving_copy_data_failed[] = "receiving copy data failed: ";
static const char __pyx_k_setting_nonblocking_failed[] = "setting nonblocking failed: ";
static const char __pyx_k_PGconn_send_describe_portal[] = "PGconn.send_describe_portal";
static const char __pyx_k_ViewBuffer___setstate_cython[] = "ViewBuffer.__setstate_cython__";
static const char __pyx_k_bytes_or_buffer_expected_got[] = "bytes or buffer expected, got ";
static const char __pyx_k_PGconn_send_describe_prepared[] = "PGconn.send_describe_prepared";
static const char __pyx_k_couldn_t_create_cancel_object[] = "couldn't create cancel object";
static const char __pyx_k_failed_to_enter_pipeline_mode[] = "failed to enter pipeline mode";
static const char __pyx_k_sending_prepared_query_failed[] = "sending prepared query failed: ";
static const char __pyx_k_setting_single_row_mode_failed[] = "setting single row mode failed";
static const char __pyx_k_connection_not_in_pipeline_mode[] = "connection not in pipeline mode";
static const char __pyx_k_libpq_Python_wrapper_using_cyth[] = "\nlibpq Python wrapper using cython bindings.\n";
static const char __pyx_k_sending_query_and_params_failed[] = "sending query and params failed: ";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x0804127, 0x3908a35, 0x0c1d0e2) = (conn))";
static const char __pyx_k_Optional_Sequence_Optional_bytes[] = "Optional[Sequence[Optional[bytes]]]";
static const char __pyx_k_PQencryptPasswordConn_requires_l[] = "PQencryptPasswordConn requires libpq from PostgreSQL 10, ";
static const char __pyx_k_PQenterPipelineMode_requires_lib[] = "PQenterPipelineMode requires libpq from PostgreSQL 14, ";
static const char __pyx_k_PQexitPipelineMode_requires_libp[] = "PQexitPipelineMode requires libpq from PostgreSQL 14, ";
static const char __pyx_k_PQhostaddr_requires_libpq_from_P[] = "PQhostaddr requires libpq from PostgreSQL 12, ";
static const char __pyx_k_PQpipelineSync_requires_libpq_fr[] = "PQpipelineSync requires libpq from PostgreSQL 14, ";
static const char __pyx_k_PQsendFlushRequest_requires_libp[] = "PQsendFlushRequest requires libpq from PostgreSQL 14, ";
static const char __pyx_k_couldn_t_allocate_connection_def[] = "couldn't allocate connection defaults";
static const char __pyx_k_couldn_t_allocate_connection_inf[] = "couldn't allocate connection info";
static const char __pyx_k_couldn_t_allocate_empty_PGresult[] = "couldn't allocate empty PGresult";
static const char __pyx_k_couldn_t_allocate_for_escape_byt[] = "couldn't allocate for escape_bytea of ";
static const char __pyx_k_couldn_t_allocate_for_unescape_b[] = "couldn't allocate for unescape_bytea of ";
static const char __pyx_k_couldn_t_allocate_on_conninfo_pa[] = "couldn't allocate on conninfo parse";
static const char __pyx_k_escape_identifier_failed_no_conn[] = "escape_identifier failed: no connection provided";
static const char __pyx_k_escape_literal_failed_no_connect[] = "escape_literal failed: no connection provided";
static const char __pyx_k_flushing_failed_the_connection_i[] = "flushing failed: the connection is closed";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_sending_describe_prepared_failed[] = "sending describe prepared failed: ";
#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_n_s_AssertionError;
static PyObject *__pyx_n_s_Conninfo;
static PyObject *__pyx_n_s_ConninfoOption;
static PyObject *__pyx_n_s_Conninfo___repr;
static PyObject *__pyx_n_s_Conninfo_get_defaults;
static PyObject *__pyx_n_s_Conninfo_parse;
static PyObject *__pyx_n_s_Escaping;
static PyObject *__pyx_n_s_Escaping___reduce_cython;
static PyObject *__pyx_n_s_Escaping___setstate_cython;
static PyObject *__pyx_n_s_Escaping_escape_bytea;
static PyObject *__pyx_n_s_Escaping_escape_identifier;
static PyObject *__pyx_n_s_Escaping_escape_literal;
static PyObject *__pyx_n_s_Escaping_escape_string;
static PyObject *__pyx_n_s_Escaping_unescape_bytea;
static PyObject *__pyx_n_s_ExecStatus;
static PyObject *__pyx_n_s_Format;
static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
static PyObject *__pyx_n_s_Iterator;
static PyObject *__pyx_kp_s_List_ConninfoOption;
static PyObject *__pyx_kp_s_List_PGresAttDesc;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_n_s_None;
static PyObject *__pyx_n_s_NotSupportedError;
static PyObject *__pyx_n_s_OperationalError;
static PyObject *__pyx_kp_s_Optional_PGresult;
static PyObject *__pyx_kp_s_Optional_Sequence_Optional_bytes;
static PyObject *__pyx_kp_s_Optional_Sequence_bytes;
static PyObject *__pyx_kp_s_Optional_Sequence_int;
static PyObject *__pyx_kp_s_Optional_bytes;
static PyObject *__pyx_n_s_PGcancel;
static PyObject *__pyx_n_s_PGcancel___reduce_cython;
static PyObject *__pyx_n_s_PGcancel___setstate_cython;
static PyObject *__pyx_n_s_PGcancel_cancel;
static PyObject *__pyx_n_s_PGcancel_free;
static PyObject *__pyx_n_s_PGconn;
static PyObject *__pyx_n_s_PGconn___reduce_cython;
static PyObject *__pyx_n_s_PGconn___setstate_cython;
static PyObject *__pyx_n_s_PGconn_connect;
static PyObject *__pyx_n_s_PGconn_connect_poll;
static PyObject *__pyx_n_s_PGconn_connect_start;
static PyObject *__pyx_n_s_PGconn_consume_input;
static PyObject *__pyx_n_s_PGconn_describe_portal;
static PyObject *__pyx_n_s_PGconn_describe_prepared;
static PyObject *__pyx_n_s_PGconn_encrypt_password;
static PyObject *__pyx_n_s_PGconn_enter_pipeline_mode;
static PyObject *__pyx_n_s_PGconn_exec;
static PyObject *__pyx_n_s_PGconn_exec_params;
static PyObject *__pyx_n_s_PGconn_exec_prepared;
static PyObject *__pyx_n_s_PGconn_exit_pipeline_mode;
static PyObject *__pyx_n_s_PGconn_finish;
static PyObject *__pyx_n_s_PGconn_flush;
static PyObject *__pyx_n_s_PGconn_get_cancel;
static PyObject *__pyx_n_s_PGconn_get_copy_data;
static PyObject *__pyx_n_s_PGconn_get_result;
static PyObject *__pyx_n_s_PGconn_is_busy;
static PyObject *__pyx_n_s_PGconn_make_empty_result;
static PyObject *__pyx_n_s_PGconn_notifies;
static PyObject *__pyx_n_s_PGconn_parameter_status;
static PyObject *__pyx_n_s_PGconn_ping;
static PyObject *__pyx_n_s_PGconn_pipeline_sync;
static PyObject *__pyx_n_s_PGconn_prepare;
static PyObject *__pyx_n_s_PGconn_put_copy_data;
static PyObject *__pyx_n_s_PGconn_put_copy_end;
static PyObject *__pyx_n_s_PGconn_reset;
static PyObject *__pyx_n_s_PGconn_reset_poll;
static PyObject *__pyx_n_s_PGconn_reset_start;
static PyObject *__pyx_n_s_PGconn_send_describe_portal;
static PyObject *__pyx_n_s_PGconn_send_describe_prepared;
static PyObject *__pyx_n_s_PGconn_send_flush_request;
static PyObject *__pyx_n_s_PGconn_send_prepare;
static PyObject *__pyx_n_s_PGconn_send_query;
static PyObject *__pyx_n_s_PGconn_send_query_params;
static PyObject *__pyx_n_s_PGconn_send_query_prepared;
static PyObject *__pyx_n_s_PGconn_set_single_row_mode;
static PyObject *__pyx_n_s_PGnotify;
static PyObject *__pyx_n_s_PGresAttDesc;
static PyObject *__pyx_n_s_PGresult;
static PyObject *__pyx_n_s_PGresult___reduce_cython;
static PyObject *__pyx_n_s_PGresult___setstate_cython;
static PyObject *__pyx_n_s_PGresult_clear;
static PyObject *__pyx_n_s_PGresult_error_field;
static PyObject *__pyx_n_s_PGresult_fformat;
static PyObject *__pyx_n_s_PGresult_fmod;
static PyObject *__pyx_n_s_PGresult_fname;
static PyObject *__pyx_n_s_PGresult_fsize;
static PyObject *__pyx_n_s_PGresult_ftable;
static PyObject *__pyx_n_s_PGresult_ftablecol;
static PyObject *__pyx_n_s_PGresult_ftype;
static PyObject *__pyx_n_s_PGresult_get_value;
static PyObject *__pyx_n_s_PGresult_param_type;
static PyObject *__pyx_n_s_PGresult_set_attributes;
static PyObject *__pyx_n_s_PQBuffer;
static PyObject *__pyx_n_s_PQBuffer___reduce_cython;
static PyObject *__pyx_n_s_PQBuffer___setstate_cython;
static PyObject *__pyx_kp_u_PQencryptPasswordConn_requires_l;
static PyObject *__pyx_kp_u_PQenterPipelineMode_requires_lib;
static PyObject *__pyx_kp_u_PQexitPipelineMode_requires_libp;
static PyObject *__pyx_kp_u_PQhostaddr_requires_libpq_from_P;
static PyObject *__pyx_kp_u_PQpipelineSync_requires_libpq_fr;
static PyObject *__pyx_kp_u_PQsendFlushRequest_requires_libp;
static PyObject *__pyx_kp_u_PQsetResultAttrs_failed;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_n_s_PipelineStatus;
static PyObject *__pyx_n_s_PqFormat;
static PyObject *__pyx_n_s_TEXT;
static PyObject *__pyx_kp_s_Tuple_int_memoryview;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_ViewBuffer;
static PyObject *__pyx_n_s_ViewBuffer___reduce_cython;
static PyObject *__pyx_n_s_ViewBuffer___setstate_cython;
static PyObject *__pyx_kp_b__12;
static PyObject *__pyx_n_s__130;
static PyObject *__pyx_kp_u__14;
static PyObject *__pyx_kp_u__17;
static PyObject *__pyx_kp_u__18;
static PyObject *__pyx_kp_u__19;
static PyObject *__pyx_kp_u__2;
static PyObject *__pyx_kp_u__20;
static PyObject *__pyx_n_s__23;
static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_kp_u__4;
static PyObject *__pyx_n_s_algorithm;
static PyObject *__pyx_n_u_ascii;
static PyObject *__pyx_n_s_async;
static PyObject *__pyx_n_s_asyncio_coroutines;
static PyObject *__pyx_kp_u_at_0x;
static PyObject *__pyx_kp_u_at_0x_2;
static PyObject *__pyx_n_s_attrs;
static PyObject *__pyx_n_s_atttypmod;
static PyObject *__pyx_n_s_atypes;
static PyObject *__pyx_kp_u_available_instead;
static PyObject *__pyx_n_s_buf;
static PyObject *__pyx_n_s_buffer;
static PyObject *__pyx_n_s_buffer_ptr;
static PyObject *__pyx_n_s_build_version;
static PyObject *__pyx_kp_u_bytes;
static PyObject *__pyx_n_s_bytes_2;
static PyObject *__pyx_kp_u_bytes_or_buffer_expected_got;
static PyObject *__pyx_n_u_c;
static PyObject *__pyx_n_s_calgo;
static PyObject *__pyx_n_s_cancel;
static PyObject *__pyx_kp_u_cancel_failed;
static PyObject *__pyx_n_s_cbuffer;
static PyObject *__pyx_n_s_ccol;
static PyObject *__pyx_n_s_cerr;
static PyObject *__pyx_n_s_cformats;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_clengths;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_n_s_cnparams;
static PyObject *__pyx_n_s_column_number;
static PyObject *__pyx_n_s_columnid;
static PyObject *__pyx_n_s_command;
static PyObject *__pyx_n_s_compiled;
static PyObject *__pyx_n_s_conn;
static PyObject *__pyx_n_s_connect;
static PyObject *__pyx_n_s_connect_poll;
static PyObject *__pyx_n_s_connect_start;
static PyObject *__pyx_kp_u_connection_not_in_pipeline_mode;
static PyObject *__pyx_n_s_connection_summary;
static PyObject *__pyx_n_s_conninfo;
static PyObject *__pyx_n_s_consume_input;
static PyObject *__pyx_kp_u_consuming_input_failed;
static PyObject *__pyx_kp_u_couldn_t_allocate_PGconn;
static PyObject *__pyx_kp_u_couldn_t_allocate_PGresult;
static PyObject *__pyx_kp_u_couldn_t_allocate_connection_def;
static PyObject *__pyx_kp_u_couldn_t_allocate_connection_inf;
static PyObject *__pyx_kp_u_couldn_t_allocate_empty_PGresult;
static PyObject *__pyx_kp_u_couldn_t_allocate_for_escape_byt;
static PyObject *__pyx_kp_u_couldn_t_allocate_for_unescape_b;
static PyObject *__pyx_kp_u_couldn_t_allocate_on_conninfo_pa;
static PyObject *__pyx_kp_u_couldn_t_create_cancel_object;
static PyObject *__pyx_kp_u_couldn_t_reset_connection;
static PyObject *__pyx_n_s_crow;
static PyObject *__pyx_n_s_ctypes;
static PyObject *__pyx_n_s_cvalues;
static PyObject *__pyx_n_u_d;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_descr;
static PyObject *__pyx_n_s_describe_portal;
static PyObject *__pyx_n_s_describe_prepared;
static PyObject *__pyx_n_s_descriptions;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dict_2;
static PyObject *__pyx_kp_u_disable;
static PyObject *__pyx_n_s_dispchar;
static PyObject *__pyx_n_s_dispsize;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_kp_u_enable;
static PyObject *__pyx_n_s_encrypt_password;
static PyObject *__pyx_n_s_enter_pipeline_mode;
static PyObject *__pyx_n_s_envvar;
static PyObject *__pyx_n_s_errmsg;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_error_field;
static PyObject *__pyx_kp_u_error_in_notice_receiver_s;
static PyObject *__pyx_n_s_error_message;
static PyObject *__pyx_n_s_errors;
static PyObject *__pyx_n_s_escape_bytea;
static PyObject *__pyx_n_s_escape_identifier;
static PyObject *__pyx_kp_u_escape_identifier_failed;
static PyObject *__pyx_kp_u_escape_identifier_failed_no_conn;
static PyObject *__pyx_n_s_escape_literal;
static PyObject *__pyx_kp_u_escape_literal_failed;
static PyObject *__pyx_kp_u_escape_literal_failed_no_connect;
static PyObject *__pyx_n_s_escape_string;
static PyObject *__pyx_kp_u_escape_string_failed;
static PyObject *__pyx_n_s_exc;
static PyObject *__pyx_n_s_exception;
static PyObject *__pyx_n_s_exec;
static PyObject *__pyx_n_s_exec_params;
static PyObject *__pyx_n_s_exec_prepared;
static PyObject *__pyx_n_s_exec_status;
static PyObject *__pyx_n_s_exit_pipeline_mode;
static PyObject *__pyx_kp_u_failed_to_enter_pipeline_mode;
static PyObject *__pyx_kp_u_failed_to_sync_pipeline;
static PyObject *__pyx_n_s_fformat;
static PyObject *__pyx_n_s_fieldcode;
static PyObject *__pyx_n_s_finish;
static PyObject *__pyx_n_s_flush;
static PyObject *__pyx_kp_u_flush_request_failed;
static PyObject *__pyx_kp_u_flushing_failed;
static PyObject *__pyx_kp_u_flushing_failed_the_connection_i;
static PyObject *__pyx_n_s_fmod;
static PyObject *__pyx_n_s_fname;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_free;
static PyObject *__pyx_n_s_fsize;
static PyObject *__pyx_n_s_ftable;
static PyObject *__pyx_n_s_ftablecol;
static PyObject *__pyx_n_s_ftype;
static PyObject *__pyx_kp_u_gc;
static PyObject *__pyx_n_s_getLogger;
static PyObject *__pyx_n_s_get_cancel;
static PyObject *__pyx_n_s_get_copy_data;
static PyObject *__pyx_n_s_get_defaults;
static PyObject *__pyx_n_s_get_result;
static PyObject *__pyx_n_s_get_value;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_kp_u_got;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_impl;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_init_subclass;
static PyObject *__pyx_n_s_initializing;
static PyObject *__pyx_n_s_int;
static PyObject *__pyx_n_s_is_busy;
static PyObject *__pyx_n_s_is_coroutine;
static PyObject *__pyx_kp_u_isenabled;
static PyObject *__pyx_n_s_keyword;
static PyObject *__pyx_n_s_label;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_logger;
static PyObject *__pyx_n_s_logging;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make_empty_result;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_nbytes;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_notifies;
static PyObject *__pyx_n_s_nparams;
static PyObject *__pyx_n_s_num;
static PyObject *__pyx_n_s_opts;
static PyObject *__pyx_n_s_out;
static PyObject *__pyx_n_s_param_formats;
static PyObject *__pyx_kp_u_param_formats_2;
static PyObject *__pyx_n_s_param_number;
static PyObject *__pyx_n_s_param_type;
static PyObject *__pyx_n_s_param_types;
static PyObject *__pyx_kp_u_param_types_2;
static PyObject *__pyx_n_s_param_values;
static PyObject *__pyx_kp_u_param_values_but;
static PyObject *__pyx_n_s_parameter_status;
static PyObject *__pyx_n_s_parse;
static PyObject *__pyx_n_s_passwd;
static PyObject *__pyx_kp_u_password_encryption_failed;
static PyObject *__pyx_n_s_pgconn;
static PyObject *__pyx_n_s_pgresult;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_ping;
static PyObject *__pyx_n_s_pipeline_sync;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_prepare_2;
static PyObject *__pyx_n_s_psycopg;
static PyObject *__pyx_n_u_psycopg;
static PyObject *__pyx_n_s_psycopg_c_pq;
static PyObject *__pyx_kp_s_psycopg_c_pq_conninfo_pyx;
static PyObject *__pyx_kp_s_psycopg_c_pq_escaping_pyx;
static PyObject *__pyx_kp_s_psycopg_c_pq_pgcancel_pyx;
static PyObject *__pyx_kp_s_psycopg_c_pq_pgconn_pyx;
static PyObject *__pyx_kp_s_psycopg_c_pq_pgresult_pyx;
static PyObject *__pyx_kp_s_psycopg_c_pq_pyx;
static PyObject *__pyx_n_s_psycopg_pq;
static PyObject *__pyx_n_s_psycopg_pq__enums;
static PyObject *__pyx_n_s_psycopg_pq_misc;
static PyObject *__pyx_n_s_ptr;
static PyObject *__pyx_n_s_put_copy_data;
static PyObject *__pyx_n_s_put_copy_end;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_Escaping;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_kp_u_receiving_copy_data_failed;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_s_res;
static PyObject *__pyx_n_s_reset;
static PyObject *__pyx_n_s_reset_poll;
static PyObject *__pyx_n_s_reset_start;
static PyObject *__pyx_n_s_result_format;
static PyObject *__pyx_n_s_return;
static PyObject *__pyx_n_s_row_number;
static PyObject *__pyx_n_s_rv;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send_describe_portal;
static PyObject *__pyx_n_s_send_describe_prepared;
static PyObject *__pyx_n_s_send_flush_request;
static PyObject *__pyx_n_s_send_prepare;
static PyObject *__pyx_n_s_send_query;
static PyObject *__pyx_n_s_send_query_params;
static PyObject *__pyx_n_s_send_query_prepared;
static PyObject *__pyx_kp_u_sending_copy_data_failed;
static PyObject *__pyx_kp_u_sending_copy_end_failed;
static PyObject *__pyx_kp_u_sending_describe_prepared_failed;
static PyObject *__pyx_kp_u_sending_prepared_query_failed;
static PyObject *__pyx_kp_u_sending_query_and_params_failed;
static PyObject *__pyx_kp_u_sending_query_failed;
static PyObject *__pyx_n_s_set_attributes;
static PyObject *__pyx_n_s_set_name;
static PyObject *__pyx_n_s_set_single_row_mode;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_kp_u_setting_nonblocking_failed;
static PyObject *__pyx_kp_u_setting_single_row_mode_failed;
static PyObject *__pyx_n_s_spec;
static PyObject *__pyx_n_s_ssl;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_status;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_tableid;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_kp_u_the_connection_is_closed;
static PyObject *__pyx_kp_u_the_connection_is_lost;
static PyObject *__pyx_n_s_typid;
static PyObject *__pyx_n_s_typing;
static PyObject *__pyx_n_s_typlen;
static PyObject *__pyx_n_s_unescape_bytea;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_use_setstate;
static PyObject *__pyx_n_s_user;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_n_s_val;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_u_x;
#endif
/* #### Code section: decls ### */
static PyObject *__pyx_pf_9psycopg_c_2pq_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static int __pyx_pf_9psycopg_c_2pq_6PGconn___cinit__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static void __pyx_pf_9psycopg_c_2pq_6PGconn_2__dealloc__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_4__repr__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_pf_9psycopg_c_2pq_6PGconn_6connect(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, char const *__pyx_v_conninfo); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_pf_9psycopg_c_2pq_6PGconn_8connect_start(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, char const *__pyx_v_conninfo); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_10connect_poll(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_12finish(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_10pgconn_ptr___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_4info___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_14reset(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_16reset_start(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_18reset_poll(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_20ping(CYTHON_UNUSED PyTypeObject *__pyx_v_self, char const *__pyx_v_conninfo); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_2db___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_4user___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_8password___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_4host___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_8hostaddr___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_4port___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_3tty___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_7options___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_6status___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_18transaction_status___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_22parameter_status(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_13error_message___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_16protocol_version___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_14server_version___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_6socket___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_11backend_pid___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_14needs_password___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_13used_password___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_10ssl_in_use___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_24exec_(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_26send_query(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_28exec_params(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_types, PyObject *__pyx_v_param_formats, int __pyx_v_result_format); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_30send_query_params(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_types, PyObject *__pyx_v_param_formats, int __pyx_v_result_format); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_32send_prepare(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, char const *__pyx_v_command, PyObject *__pyx_v_param_types); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_34send_query_prepared(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_formats, int __pyx_v_result_format); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_36prepare(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, char const *__pyx_v_command, PyObject *__pyx_v_param_types); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_38exec_prepared(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_formats, int __pyx_v_result_format); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_40describe_prepared(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_42send_describe_prepared(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_44describe_portal(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_46send_describe_portal(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_48get_result(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_50consume_input(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_52is_busy(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_11nonblocking___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static int __pyx_pf_9psycopg_c_2pq_6PGconn_11nonblocking_2__set__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, int __pyx_v_arg); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_54flush(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_56set_single_row_mode(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_pf_9psycopg_c_2pq_6PGconn_58get_cancel(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_60notifies(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_62put_copy_data(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_64put_copy_end(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_error); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_66get_copy_data(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, int __pyx_v_async_); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_68encrypt_password(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_passwd, char const *__pyx_v_user, PyObject *__pyx_v_algorithm); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_70make_empty_result(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, int __pyx_v_exec_status); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_15pipeline_status___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_72enter_pipeline_mode(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_74exit_pipeline_mode(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_76pipeline_sync(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_78send_flush_request(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_14notice_handler___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static int __pyx_pf_9psycopg_c_2pq_6PGconn_14notice_handler_2__set__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_9psycopg_c_2pq_6PGconn_14notice_handler_4__del__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_14notify_handler___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static int __pyx_pf_9psycopg_c_2pq_6PGconn_14notify_handler_2__set__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_9psycopg_c_2pq_6PGconn_14notify_handler_4__del__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_80__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_82__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_9psycopg_c_2pq_8PGresult___cinit__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static void __pyx_pf_9psycopg_c_2pq_8PGresult_2__dealloc__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_4__repr__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_6clear(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_12pgresult_ptr___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_6status___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_13error_message___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_8error_field(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_fieldcode); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_7ntuples___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_7nfields___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_10fname(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_12ftable(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_14ftablecol(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_16fformat(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_18ftype(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_20fmod(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_22fsize(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_13binary_tuples___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_24get_value(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_row_number, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_7nparams___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_26param_type(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_param_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_14command_status___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_14command_tuples___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_9oid_value___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_28set_attributes(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, PyObject *__pyx_v_descriptions); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_9psycopg_c_2pq_8PGcancel___cinit__(struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self); /* proto */
static void __pyx_pf_9psycopg_c_2pq_8PGcancel_2__dealloc__(struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGcancel_4free(struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGcancel_6cancel(struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGcancel_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGcancel_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8Conninfo_get_defaults(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8Conninfo_2parse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, char const *__pyx_v_conninfo); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8Conninfo_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static int __pyx_pf_9psycopg_c_2pq_8Escaping___init__(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_conn); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_2escape_literal(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_4escape_identifier(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_6escape_string(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_8escape_bytea(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_10unescape_bytea(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, unsigned char const *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_12__reduce_cython__(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_14__setstate_cython__(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_9psycopg_c_2pq_8PQBuffer___cinit__(struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self); /* proto */
static void __pyx_pf_9psycopg_c_2pq_8PQBuffer_2__dealloc__(struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PQBuffer_4__repr__(struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self); /* proto */
static int __pyx_pf_9psycopg_c_2pq_8PQBuffer_6__getbuffer__(struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags); /* proto */
static void __pyx_pf_9psycopg_c_2pq_8PQBuffer_8__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PQBuffer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PQBuffer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_9psycopg_c_2pq_10ViewBuffer___cinit__(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_10ViewBuffer_2__repr__(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self); /* proto */
static int __pyx_pf_9psycopg_c_2pq_10ViewBuffer_4__getbuffer__(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags); /* proto */
static void __pyx_pf_9psycopg_c_2pq_10ViewBuffer_6__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_10ViewBuffer_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_10ViewBuffer_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_2__pyx_unpickle_Escaping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_9psycopg_c_2pq_PGconn(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9psycopg_c_2pq_PGresult(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9psycopg_c_2pq_PGcancel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9psycopg_c_2pq_Escaping(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9psycopg_c_2pq_PQBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9psycopg_c_2pq_ViewBuffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_int_8405287;
static PyObject *__pyx_int_12701922;
static PyObject *__pyx_int_59804213;
#endif
#if !CYTHON_USE_MODULE_STATE
static int __pyx_k__8;
static int __pyx_k__9;
static int __pyx_k__10;
static int __pyx_k__11;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_codeobj__22;
static PyObject *__pyx_codeobj__26;
static PyObject *__pyx_codeobj__27;
static PyObject *__pyx_codeobj__29;
static PyObject *__pyx_codeobj__30;
static PyObject *__pyx_codeobj__31;
static PyObject *__pyx_codeobj__32;
static PyObject *__pyx_codeobj__33;
static PyObject *__pyx_codeobj__35;
static PyObject *__pyx_codeobj__37;
static PyObject *__pyx_codeobj__39;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__43;
static PyObject *__pyx_codeobj__45;
static PyObject *__pyx_codeobj__47;
static PyObject *__pyx_codeobj__50;
static PyObject *__pyx_codeobj__51;
static PyObject *__pyx_codeobj__52;
static PyObject *__pyx_codeobj__53;
static PyObject *__pyx_codeobj__54;
static PyObject *__pyx_codeobj__55;
static PyObject *__pyx_codeobj__56;
static PyObject *__pyx_codeobj__58;
static PyObject *__pyx_codeobj__59;
static PyObject *__pyx_codeobj__61;
static PyObject *__pyx_codeobj__62;
static PyObject *__pyx_codeobj__63;
static PyObject *__pyx_codeobj__65;
static PyObject *__pyx_codeobj__66;
static PyObject *__pyx_codeobj__68;
static PyObject *__pyx_codeobj__70;
static PyObject *__pyx_codeobj__72;
static PyObject *__pyx_codeobj__74;
static PyObject *__pyx_codeobj__76;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__78;
static PyObject *__pyx_codeobj__79;
static PyObject *__pyx_codeobj__80;
static PyObject *__pyx_codeobj__81;
static PyObject *__pyx_codeobj__83;
static PyObject *__pyx_codeobj__84;
static PyObject *__pyx_codeobj__86;
static PyObject *__pyx_codeobj__88;
static PyObject *__pyx_codeobj__90;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__92;
static PyObject *__pyx_codeobj__93;
static PyObject *__pyx_codeobj__94;
static PyObject *__pyx_codeobj__95;
static PyObject *__pyx_codeobj__97;
static PyObject *__pyx_codeobj__99;
static PyObject *__pyx_codeobj__101;
static PyObject *__pyx_codeobj__102;
static PyObject *__pyx_codeobj__103;
static PyObject *__pyx_codeobj__104;
static PyObject *__pyx_codeobj__106;
static PyObject *__pyx_codeobj__107;
static PyObject *__pyx_codeobj__108;
static PyObject *__pyx_codeobj__110;
static PyObject *__pyx_codeobj__112;
static PyObject *__pyx_codeobj__113;
static PyObject *__pyx_codeobj__115;
static PyObject *__pyx_codeobj__116;
static PyObject *__pyx_codeobj__117;
static PyObject *__pyx_codeobj__118;
static PyObject *__pyx_codeobj__120;
static PyObject *__pyx_codeobj__122;
static PyObject *__pyx_codeobj__123;
static PyObject *__pyx_codeobj__124;
static PyObject *__pyx_codeobj__125;
static PyObject *__pyx_codeobj__126;
static PyObject *__pyx_codeobj__127;
static PyObject *__pyx_codeobj__129;
#endif
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
#if CYTHON_USE_MODULE_STATE
typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PGconn;
  PyObject *__pyx_type_9psycopg_c_2pq_PGconn;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PGresult;
  PyObject *__pyx_type_9psycopg_c_2pq_PGresult;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PGcancel;
  PyObject *__pyx_type_9psycopg_c_2pq_PGcancel;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_Escaping;
  PyObject *__pyx_type_9psycopg_c_2pq_Escaping;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PQBuffer;
  PyObject *__pyx_type_9psycopg_c_2pq_PQBuffer;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_ViewBuffer;
  PyObject *__pyx_type_9psycopg_c_2pq_ViewBuffer;
  PyObject *__pyx_kp_u_;
  PyObject *__pyx_n_s_AssertionError;
  PyObject *__pyx_n_s_Conninfo;
  PyObject *__pyx_n_s_ConninfoOption;
  PyObject *__pyx_n_s_Conninfo___repr;
  PyObject *__pyx_n_s_Conninfo_get_defaults;
  PyObject *__pyx_n_s_Conninfo_parse;
  PyObject *__pyx_n_s_Escaping;
  PyObject *__pyx_n_s_Escaping___reduce_cython;
  PyObject *__pyx_n_s_Escaping___setstate_cython;
  PyObject *__pyx_n_s_Escaping_escape_bytea;
  PyObject *__pyx_n_s_Escaping_escape_identifier;
  PyObject *__pyx_n_s_Escaping_escape_literal;
  PyObject *__pyx_n_s_Escaping_escape_string;
  PyObject *__pyx_n_s_Escaping_unescape_bytea;
  PyObject *__pyx_n_s_ExecStatus;
  PyObject *__pyx_n_s_Format;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
  PyObject *__pyx_n_s_Iterator;
  PyObject *__pyx_kp_s_List_ConninfoOption;
  PyObject *__pyx_kp_s_List_PGresAttDesc;
  PyObject *__pyx_n_s_MemoryError;
  PyObject *__pyx_n_s_None;
  PyObject *__pyx_n_s_NotSupportedError;
  PyObject *__pyx_n_s_OperationalError;
  PyObject *__pyx_kp_s_Optional_PGresult;
  PyObject *__pyx_kp_s_Optional_Sequence_Optional_bytes;
  PyObject *__pyx_kp_s_Optional_Sequence_bytes;
  PyObject *__pyx_kp_s_Optional_Sequence_int;
  PyObject *__pyx_kp_s_Optional_bytes;
  PyObject *__pyx_n_s_PGcancel;
  PyObject *__pyx_n_s_PGcancel___reduce_cython;
  PyObject *__pyx_n_s_PGcancel___setstate_cython;
  PyObject *__pyx_n_s_PGcancel_cancel;
  PyObject *__pyx_n_s_PGcancel_free;
  PyObject *__pyx_n_s_PGconn;
  PyObject *__pyx_n_s_PGconn___reduce_cython;
  PyObject *__pyx_n_s_PGconn___setstate_cython;
  PyObject *__pyx_n_s_PGconn_connect;
  PyObject *__pyx_n_s_PGconn_connect_poll;
  PyObject *__pyx_n_s_PGconn_connect_start;
  PyObject *__pyx_n_s_PGconn_consume_input;
  PyObject *__pyx_n_s_PGconn_describe_portal;
  PyObject *__pyx_n_s_PGconn_describe_prepared;
  PyObject *__pyx_n_s_PGconn_encrypt_password;
  PyObject *__pyx_n_s_PGconn_enter_pipeline_mode;
  PyObject *__pyx_n_s_PGconn_exec;
  PyObject *__pyx_n_s_PGconn_exec_params;
  PyObject *__pyx_n_s_PGconn_exec_prepared;
  PyObject *__pyx_n_s_PGconn_exit_pipeline_mode;
  PyObject *__pyx_n_s_PGconn_finish;
  PyObject *__pyx_n_s_PGconn_flush;
  PyObject *__pyx_n_s_PGconn_get_cancel;
  PyObject *__pyx_n_s_PGconn_get_copy_data;
  PyObject *__pyx_n_s_PGconn_get_result;
  PyObject *__pyx_n_s_PGconn_is_busy;
  PyObject *__pyx_n_s_PGconn_make_empty_result;
  PyObject *__pyx_n_s_PGconn_notifies;
  PyObject *__pyx_n_s_PGconn_parameter_status;
  PyObject *__pyx_n_s_PGconn_ping;
  PyObject *__pyx_n_s_PGconn_pipeline_sync;
  PyObject *__pyx_n_s_PGconn_prepare;
  PyObject *__pyx_n_s_PGconn_put_copy_data;
  PyObject *__pyx_n_s_PGconn_put_copy_end;
  PyObject *__pyx_n_s_PGconn_reset;
  PyObject *__pyx_n_s_PGconn_reset_poll;
  PyObject *__pyx_n_s_PGconn_reset_start;
  PyObject *__pyx_n_s_PGconn_send_describe_portal;
  PyObject *__pyx_n_s_PGconn_send_describe_prepared;
  PyObject *__pyx_n_s_PGconn_send_flush_request;
  PyObject *__pyx_n_s_PGconn_send_prepare;
  PyObject *__pyx_n_s_PGconn_send_query;
  PyObject *__pyx_n_s_PGconn_send_query_params;
  PyObject *__pyx_n_s_PGconn_send_query_prepared;
  PyObject *__pyx_n_s_PGconn_set_single_row_mode;
  PyObject *__pyx_n_s_PGnotify;
  PyObject *__pyx_n_s_PGresAttDesc;
  PyObject *__pyx_n_s_PGresult;
  PyObject *__pyx_n_s_PGresult___reduce_cython;
  PyObject *__pyx_n_s_PGresult___setstate_cython;
  PyObject *__pyx_n_s_PGresult_clear;
  PyObject *__pyx_n_s_PGresult_error_field;
  PyObject *__pyx_n_s_PGresult_fformat;
  PyObject *__pyx_n_s_PGresult_fmod;
  PyObject *__pyx_n_s_PGresult_fname;
  PyObject *__pyx_n_s_PGresult_fsize;
  PyObject *__pyx_n_s_PGresult_ftable;
  PyObject *__pyx_n_s_PGresult_ftablecol;
  PyObject *__pyx_n_s_PGresult_ftype;
  PyObject *__pyx_n_s_PGresult_get_value;
  PyObject *__pyx_n_s_PGresult_param_type;
  PyObject *__pyx_n_s_PGresult_set_attributes;
  PyObject *__pyx_n_s_PQBuffer;
  PyObject *__pyx_n_s_PQBuffer___reduce_cython;
  PyObject *__pyx_n_s_PQBuffer___setstate_cython;
  PyObject *__pyx_kp_u_PQencryptPasswordConn_requires_l;
  PyObject *__pyx_kp_u_PQenterPipelineMode_requires_lib;
  PyObject *__pyx_kp_u_PQexitPipelineMode_requires_libp;
  PyObject *__pyx_kp_u_PQhostaddr_requires_libpq_from_P;
  PyObject *__pyx_kp_u_PQpipelineSync_requires_libpq_fr;
  PyObject *__pyx_kp_u_PQsendFlushRequest_requires_libp;
  PyObject *__pyx_kp_u_PQsetResultAttrs_failed;
  PyObject *__pyx_n_s_PickleError;
  PyObject *__pyx_n_s_PipelineStatus;
  PyObject *__pyx_n_s_PqFormat;
  PyObject *__pyx_n_s_TEXT;
  PyObject *__pyx_kp_s_Tuple_int_memoryview;
  PyObject *__pyx_n_s_TypeError;
  PyObject *__pyx_n_s_ValueError;
  PyObject *__pyx_n_s_ViewBuffer;
  PyObject *__pyx_n_s_ViewBuffer___reduce_cython;
  PyObject *__pyx_n_s_ViewBuffer___setstate_cython;
  PyObject *__pyx_kp_b__12;
  PyObject *__pyx_n_s__130;
  PyObject *__pyx_kp_u__14;
  PyObject *__pyx_kp_u__17;
  PyObject *__pyx_kp_u__18;
  PyObject *__pyx_kp_u__19;
  PyObject *__pyx_kp_u__2;
  PyObject *__pyx_kp_u__20;
  PyObject *__pyx_n_s__23;
  PyObject *__pyx_kp_u__3;
  PyObject *__pyx_kp_u__4;
  PyObject *__pyx_n_s_algorithm;
  PyObject *__pyx_n_u_ascii;
  PyObject *__pyx_n_s_async;
  PyObject *__pyx_n_s_asyncio_coroutines;
  PyObject *__pyx_kp_u_at_0x;
  PyObject *__pyx_kp_u_at_0x_2;
  PyObject *__pyx_n_s_attrs;
  PyObject *__pyx_n_s_atttypmod;
  PyObject *__pyx_n_s_atypes;
  PyObject *__pyx_kp_u_available_instead;
  PyObject *__pyx_n_s_buf;
  PyObject *__pyx_n_s_buffer;
  PyObject *__pyx_n_s_buffer_ptr;
  PyObject *__pyx_n_s_build_version;
  PyObject *__pyx_kp_u_bytes;
  PyObject *__pyx_n_s_bytes_2;
  PyObject *__pyx_kp_u_bytes_or_buffer_expected_got;
  PyObject *__pyx_n_u_c;
  PyObject *__pyx_n_s_calgo;
  PyObject *__pyx_n_s_cancel;
  PyObject *__pyx_kp_u_cancel_failed;
  PyObject *__pyx_n_s_cbuffer;
  PyObject *__pyx_n_s_ccol;
  PyObject *__pyx_n_s_cerr;
  PyObject *__pyx_n_s_cformats;
  PyObject *__pyx_n_s_class;
  PyObject *__pyx_n_s_clear;
  PyObject *__pyx_n_s_clengths;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_cls;
  PyObject *__pyx_n_s_cnparams;
  PyObject *__pyx_n_s_column_number;
  PyObject *__pyx_n_s_columnid;
  PyObject *__pyx_n_s_command;
  PyObject *__pyx_n_s_compiled;
  PyObject *__pyx_n_s_conn;
  PyObject *__pyx_n_s_connect;
  PyObject *__pyx_n_s_connect_poll;
  PyObject *__pyx_n_s_connect_start;
  PyObject *__pyx_kp_u_connection_not_in_pipeline_mode;
  PyObject *__pyx_n_s_connection_summary;
  PyObject *__pyx_n_s_conninfo;
  PyObject *__pyx_n_s_consume_input;
  PyObject *__pyx_kp_u_consuming_input_failed;
  PyObject *__pyx_kp_u_couldn_t_allocate_PGconn;
  PyObject *__pyx_kp_u_couldn_t_allocate_PGresult;
  PyObject *__pyx_kp_u_couldn_t_allocate_connection_def;
  PyObject *__pyx_kp_u_couldn_t_allocate_connection_inf;
  PyObject *__pyx_kp_u_couldn_t_allocate_empty_PGresult;
  PyObject *__pyx_kp_u_couldn_t_allocate_for_escape_byt;
  PyObject *__pyx_kp_u_couldn_t_allocate_for_unescape_b;
  PyObject *__pyx_kp_u_couldn_t_allocate_on_conninfo_pa;
  PyObject *__pyx_kp_u_couldn_t_create_cancel_object;
  PyObject *__pyx_kp_u_couldn_t_reset_connection;
  PyObject *__pyx_n_s_crow;
  PyObject *__pyx_n_s_ctypes;
  PyObject *__pyx_n_s_cvalues;
  PyObject *__pyx_n_u_d;
  PyObject *__pyx_n_s_data;
  PyObject *__pyx_n_s_decode;
  PyObject *__pyx_n_s_descr;
  PyObject *__pyx_n_s_describe_portal;
  PyObject *__pyx_n_s_describe_prepared;
  PyObject *__pyx_n_s_descriptions;
  PyObject *__pyx_n_s_dict;
  PyObject *__pyx_n_s_dict_2;
  PyObject *__pyx_kp_u_disable;
  PyObject *__pyx_n_s_dispchar;
  PyObject *__pyx_n_s_dispsize;
  PyObject *__pyx_n_s_doc;
  PyObject *__pyx_n_s_e;
  PyObject *__pyx_kp_u_enable;
  PyObject *__pyx_n_s_encrypt_password;
  PyObject *__pyx_n_s_enter_pipeline_mode;
  PyObject *__pyx_n_s_envvar;
  PyObject *__pyx_n_s_errmsg;
  PyObject *__pyx_n_s_error;
  PyObject *__pyx_n_s_error_field;
  PyObject *__pyx_kp_u_error_in_notice_receiver_s;
  PyObject *__pyx_n_s_error_message;
  PyObject *__pyx_n_s_errors;
  PyObject *__pyx_n_s_escape_bytea;
  PyObject *__pyx_n_s_escape_identifier;
  PyObject *__pyx_kp_u_escape_identifier_failed;
  PyObject *__pyx_kp_u_escape_identifier_failed_no_conn;
  PyObject *__pyx_n_s_escape_literal;
  PyObject *__pyx_kp_u_escape_literal_failed;
  PyObject *__pyx_kp_u_escape_literal_failed_no_connect;
  PyObject *__pyx_n_s_escape_string;
  PyObject *__pyx_kp_u_escape_string_failed;
  PyObject *__pyx_n_s_exc;
  PyObject *__pyx_n_s_exception;
  PyObject *__pyx_n_s_exec;
  PyObject *__pyx_n_s_exec_params;
  PyObject *__pyx_n_s_exec_prepared;
  PyObject *__pyx_n_s_exec_status;
  PyObject *__pyx_n_s_exit_pipeline_mode;
  PyObject *__pyx_kp_u_failed_to_enter_pipeline_mode;
  PyObject *__pyx_kp_u_failed_to_sync_pipeline;
  PyObject *__pyx_n_s_fformat;
  PyObject *__pyx_n_s_fieldcode;
  PyObject *__pyx_n_s_finish;
  PyObject *__pyx_n_s_flush;
  PyObject *__pyx_kp_u_flush_request_failed;
  PyObject *__pyx_kp_u_flushing_failed;
  PyObject *__pyx_kp_u_flushing_failed_the_connection_i;
  PyObject *__pyx_n_s_fmod;
  PyObject *__pyx_n_s_fname;
  PyObject *__pyx_n_s_format;
  PyObject *__pyx_n_s_free;
  PyObject *__pyx_n_s_fsize;
  PyObject *__pyx_n_s_ftable;
  PyObject *__pyx_n_s_ftablecol;
  PyObject *__pyx_n_s_ftype;
  PyObject *__pyx_kp_u_gc;
  PyObject *__pyx_n_s_getLogger;
  PyObject *__pyx_n_s_get_cancel;
  PyObject *__pyx_n_s_get_copy_data;
  PyObject *__pyx_n_s_get_defaults;
  PyObject *__pyx_n_s_get_result;
  PyObject *__pyx_n_s_get_value;
  PyObject *__pyx_n_s_getstate;
  PyObject *__pyx_kp_u_got;
  PyObject *__pyx_n_s_i;
  PyObject *__pyx_n_s_id;
  PyObject *__pyx_n_s_impl;
  PyObject *__pyx_n_s_import;
  PyObject *__pyx_n_s_init_subclass;
  PyObject *__pyx_n_s_initializing;
  PyObject *__pyx_n_s_int;
  PyObject *__pyx_n_s_is_busy;
  PyObject *__pyx_n_s_is_coroutine;
  PyObject *__pyx_kp_u_isenabled;
  PyObject *__pyx_n_s_keyword;
  PyObject *__pyx_n_s_label;
  PyObject *__pyx_n_s_length;
  PyObject *__pyx_n_s_logger;
  PyObject *__pyx_n_s_logging;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_make_empty_result;
  PyObject *__pyx_n_s_metaclass;
  PyObject *__pyx_n_s_module;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_n_s_name_2;
  PyObject *__pyx_n_s_nbytes;
  PyObject *__pyx_n_s_new;
  PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
  PyObject *__pyx_n_s_notifies;
  PyObject *__pyx_n_s_nparams;
  PyObject *__pyx_n_s_num;
  PyObject *__pyx_n_s_opts;
  PyObject *__pyx_n_s_out;
  PyObject *__pyx_n_s_param_formats;
  PyObject *__pyx_kp_u_param_formats_2;
  PyObject *__pyx_n_s_param_number;
  PyObject *__pyx_n_s_param_type;
  PyObject *__pyx_n_s_param_types;
  PyObject *__pyx_kp_u_param_types_2;
  PyObject *__pyx_n_s_param_values;
  PyObject *__pyx_kp_u_param_values_but;
  PyObject *__pyx_n_s_parameter_status;
  PyObject *__pyx_n_s_parse;
  PyObject *__pyx_n_s_passwd;
  PyObject *__pyx_kp_u_password_encryption_failed;
  PyObject *__pyx_n_s_pgconn;
  PyObject *__pyx_n_s_pgresult;
  PyObject *__pyx_n_s_pickle;
  PyObject *__pyx_n_s_ping;
  PyObject *__pyx_n_s_pipeline_sync;
  PyObject *__pyx_n_s_prepare;
  PyObject *__pyx_n_s_prepare_2;
  PyObject *__pyx_n_s_psycopg;
  PyObject *__pyx_n_u_psycopg;
  PyObject *__pyx_n_s_psycopg_c_pq;
  PyObject *__pyx_kp_s_psycopg_c_pq_conninfo_pyx;
  PyObject *__pyx_kp_s_psycopg_c_pq_escaping_pyx;
  PyObject *__pyx_kp_s_psycopg_c_pq_pgcancel_pyx;
  PyObject *__pyx_kp_s_psycopg_c_pq_pgconn_pyx;
  PyObject *__pyx_kp_s_psycopg_c_pq_pgresult_pyx;
  PyObject *__pyx_kp_s_psycopg_c_pq_pyx;
  PyObject *__pyx_n_s_psycopg_pq;
  PyObject *__pyx_n_s_psycopg_pq__enums;
  PyObject *__pyx_n_s_psycopg_pq_misc;
  PyObject *__pyx_n_s_ptr;
  PyObject *__pyx_n_s_put_copy_data;
  PyObject *__pyx_n_s_put_copy_end;
  PyObject *__pyx_n_s_pyx_PickleError;
  PyObject *__pyx_n_s_pyx_checksum;
  PyObject *__pyx_n_s_pyx_result;
  PyObject *__pyx_n_s_pyx_state;
  PyObject *__pyx_n_s_pyx_type;
  PyObject *__pyx_n_s_pyx_unpickle_Escaping;
  PyObject *__pyx_n_s_pyx_vtable;
  PyObject *__pyx_n_s_qualname;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_kp_u_receiving_copy_data_failed;
  PyObject *__pyx_n_s_reduce;
  PyObject *__pyx_n_s_reduce_cython;
  PyObject *__pyx_n_s_reduce_ex;
  PyObject *__pyx_n_s_repr;
  PyObject *__pyx_n_s_res;
  PyObject *__pyx_n_s_reset;
  PyObject *__pyx_n_s_reset_poll;
  PyObject *__pyx_n_s_reset_start;
  PyObject *__pyx_n_s_result_format;
  PyObject *__pyx_n_s_return;
  PyObject *__pyx_n_s_row_number;
  PyObject *__pyx_n_s_rv;
  PyObject *__pyx_n_s_self;
  PyObject *__pyx_n_s_send_describe_portal;
  PyObject *__pyx_n_s_send_describe_prepared;
  PyObject *__pyx_n_s_send_flush_request;
  PyObject *__pyx_n_s_send_prepare;
  PyObject *__pyx_n_s_send_query;
  PyObject *__pyx_n_s_send_query_params;
  PyObject *__pyx_n_s_send_query_prepared;
  PyObject *__pyx_kp_u_sending_copy_data_failed;
  PyObject *__pyx_kp_u_sending_copy_end_failed;
  PyObject *__pyx_kp_u_sending_describe_prepared_failed;
  PyObject *__pyx_kp_u_sending_prepared_query_failed;
  PyObject *__pyx_kp_u_sending_query_and_params_failed;
  PyObject *__pyx_kp_u_sending_query_failed;
  PyObject *__pyx_n_s_set_attributes;
  PyObject *__pyx_n_s_set_name;
  PyObject *__pyx_n_s_set_single_row_mode;
  PyObject *__pyx_n_s_setstate;
  PyObject *__pyx_n_s_setstate_cython;
  PyObject *__pyx_kp_u_setting_nonblocking_failed;
  PyObject *__pyx_kp_u_setting_single_row_mode_failed;
  PyObject *__pyx_n_s_spec;
  PyObject *__pyx_n_s_ssl;
  PyObject *__pyx_n_s_state;
  PyObject *__pyx_n_s_status;
  PyObject *__pyx_kp_s_stringsource;
  PyObject *__pyx_n_s_super;
  PyObject *__pyx_n_s_tableid;
  PyObject *__pyx_n_s_test;
  PyObject *__pyx_kp_u_the_connection_is_closed;
  PyObject *__pyx_kp_u_the_connection_is_lost;
  PyObject *__pyx_n_s_typid;
  PyObject *__pyx_n_s_typing;
  PyObject *__pyx_n_s_typlen;
  PyObject *__pyx_n_s_unescape_bytea;
  PyObject *__pyx_n_s_update;
  PyObject *__pyx_n_s_use_setstate;
  PyObject *__pyx_n_s_user;
  PyObject *__pyx_n_s_v;
  PyObject *__pyx_n_s_val;
  PyObject *__pyx_n_s_version;
  PyObject *__pyx_n_u_x;
  PyObject *__pyx_int_8405287;
  PyObject *__pyx_int_12701922;
  PyObject *__pyx_int_59804213;
  int __pyx_k__8;
  int __pyx_k__9;
  int __pyx_k__10;
  int __pyx_k__11;
  PyObject *__pyx_tuple__5;
  PyObject *__pyx_tuple__6;
  PyObject *__pyx_tuple__7;
  PyObject *__pyx_tuple__13;
  PyObject *__pyx_tuple__15;
  PyObject *__pyx_tuple__16;
  PyObject *__pyx_tuple__21;
  PyObject *__pyx_tuple__24;
  PyObject *__pyx_tuple__25;
  PyObject *__pyx_tuple__28;
  PyObject *__pyx_tuple__34;
  PyObject *__pyx_tuple__36;
  PyObject *__pyx_tuple__38;
  PyObject *__pyx_tuple__40;
  PyObject *__pyx_tuple__42;
  PyObject *__pyx_tuple__44;
  PyObject *__pyx_tuple__46;
  PyObject *__pyx_tuple__48;
  PyObject *__pyx_tuple__49;
  PyObject *__pyx_tuple__57;
  PyObject *__pyx_tuple__60;
  PyObject *__pyx_tuple__64;
  PyObject *__pyx_tuple__67;
  PyObject *__pyx_tuple__69;
  PyObject *__pyx_tuple__71;
  PyObject *__pyx_tuple__73;
  PyObject *__pyx_tuple__75;
  PyObject *__pyx_tuple__82;
  PyObject *__pyx_tuple__85;
  PyObject *__pyx_tuple__87;
  PyObject *__pyx_tuple__89;
  PyObject *__pyx_tuple__96;
  PyObject *__pyx_tuple__98;
  PyObject *__pyx_tuple__100;
  PyObject *__pyx_tuple__105;
  PyObject *__pyx_tuple__109;
  PyObject *__pyx_tuple__111;
  PyObject *__pyx_tuple__114;
  PyObject *__pyx_tuple__119;
  PyObject *__pyx_tuple__121;
  PyObject *__pyx_tuple__128;
  PyObject *__pyx_codeobj__22;
  PyObject *__pyx_codeobj__26;
  PyObject *__pyx_codeobj__27;
  PyObject *__pyx_codeobj__29;
  PyObject *__pyx_codeobj__30;
  PyObject *__pyx_codeobj__31;
  PyObject *__pyx_codeobj__32;
  PyObject *__pyx_codeobj__33;
  PyObject *__pyx_codeobj__35;
  PyObject *__pyx_codeobj__37;
  PyObject *__pyx_codeobj__39;
  PyObject *__pyx_codeobj__41;
  PyObject *__pyx_codeobj__43;
  PyObject *__pyx_codeobj__45;
  PyObject *__pyx_codeobj__47;
  PyObject *__pyx_codeobj__50;
  PyObject *__pyx_codeobj__51;
  PyObject *__pyx_codeobj__52;
  PyObject *__pyx_codeobj__53;
  PyObject *__pyx_codeobj__54;
  PyObject *__pyx_codeobj__55;
  PyObject *__pyx_codeobj__56;
  PyObject *__pyx_codeobj__58;
  PyObject *__pyx_codeobj__59;
  PyObject *__pyx_codeobj__61;
  PyObject *__pyx_codeobj__62;
  PyObject *__pyx_codeobj__63;
  PyObject *__pyx_codeobj__65;
  PyObject *__pyx_codeobj__66;
  PyObject *__pyx_codeobj__68;
  PyObject *__pyx_codeobj__70;
  PyObject *__pyx_codeobj__72;
  PyObject *__pyx_codeobj__74;
  PyObject *__pyx_codeobj__76;
  PyObject *__pyx_codeobj__77;
  PyObject *__pyx_codeobj__78;
  PyObject *__pyx_codeobj__79;
  PyObject *__pyx_codeobj__80;
  PyObject *__pyx_codeobj__81;
  PyObject *__pyx_codeobj__83;
  PyObject *__pyx_codeobj__84;
  PyObject *__pyx_codeobj__86;
  PyObject *__pyx_codeobj__88;
  PyObject *__pyx_codeobj__90;
  PyObject *__pyx_codeobj__91;
  PyObject *__pyx_codeobj__92;
  PyObject *__pyx_codeobj__93;
  PyObject *__pyx_codeobj__94;
  PyObject *__pyx_codeobj__95;
  PyObject *__pyx_codeobj__97;
  PyObject *__pyx_codeobj__99;
  PyObject *__pyx_codeobj__101;
  PyObject *__pyx_codeobj__102;
  PyObject *__pyx_codeobj__103;
  PyObject *__pyx_codeobj__104;
  PyObject *__pyx_codeobj__106;
  PyObject *__pyx_codeobj__107;
  PyObject *__pyx_codeobj__108;
  PyObject *__pyx_codeobj__110;
  PyObject *__pyx_codeobj__112;
  PyObject *__pyx_codeobj__113;
  PyObject *__pyx_codeobj__115;
  PyObject *__pyx_codeobj__116;
  PyObject *__pyx_codeobj__117;
  PyObject *__pyx_codeobj__118;
  PyObject *__pyx_codeobj__120;
  PyObject *__pyx_codeobj__122;
  PyObject *__pyx_codeobj__123;
  PyObject *__pyx_codeobj__124;
  PyObject *__pyx_codeobj__125;
  PyObject *__pyx_codeobj__126;
  PyObject *__pyx_codeobj__127;
  PyObject *__pyx_codeobj__129;
} __pyx_mstate;

#ifdef __cplusplus
namespace {
  extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))

#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))

#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
#endif
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_clear(PyObject *m) {
  __pyx_mstate *clear_module_state = __pyx_mstate(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_9psycopg_c_2pq_PGconn);
  Py_CLEAR(clear_module_state->__pyx_type_9psycopg_c_2pq_PGconn);
  Py_CLEAR(clear_module_state->__pyx_ptype_9psycopg_c_2pq_PGresult);
  Py_CLEAR(clear_module_state->__pyx_type_9psycopg_c_2pq_PGresult);
  Py_CLEAR(clear_module_state->__pyx_ptype_9psycopg_c_2pq_PGcancel);
  Py_CLEAR(clear_module_state->__pyx_type_9psycopg_c_2pq_PGcancel);
  Py_CLEAR(clear_module_state->__pyx_ptype_9psycopg_c_2pq_Escaping);
  Py_CLEAR(clear_module_state->__pyx_type_9psycopg_c_2pq_Escaping);
  Py_CLEAR(clear_module_state->__pyx_ptype_9psycopg_c_2pq_PQBuffer);
  Py_CLEAR(clear_module_state->__pyx_type_9psycopg_c_2pq_PQBuffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_9psycopg_c_2pq_ViewBuffer);
  Py_CLEAR(clear_module_state->__pyx_type_9psycopg_c_2pq_ViewBuffer);
  Py_CLEAR(clear_module_state->__pyx_kp_u_);
  Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
  Py_CLEAR(clear_module_state->__pyx_n_s_Conninfo);
  Py_CLEAR(clear_module_state->__pyx_n_s_ConninfoOption);
  Py_CLEAR(clear_module_state->__pyx_n_s_Conninfo___repr);
  Py_CLEAR(clear_module_state->__pyx_n_s_Conninfo_get_defaults);
  Py_CLEAR(clear_module_state->__pyx_n_s_Conninfo_parse);
  Py_CLEAR(clear_module_state->__pyx_n_s_Escaping);
  Py_CLEAR(clear_module_state->__pyx_n_s_Escaping___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Escaping___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Escaping_escape_bytea);
  Py_CLEAR(clear_module_state->__pyx_n_s_Escaping_escape_identifier);
  Py_CLEAR(clear_module_state->__pyx_n_s_Escaping_escape_literal);
  Py_CLEAR(clear_module_state->__pyx_n_s_Escaping_escape_string);
  Py_CLEAR(clear_module_state->__pyx_n_s_Escaping_unescape_bytea);
  Py_CLEAR(clear_module_state->__pyx_n_s_ExecStatus);
  Py_CLEAR(clear_module_state->__pyx_n_s_Format);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
  Py_CLEAR(clear_module_state->__pyx_n_s_Iterator);
  Py_CLEAR(clear_module_state->__pyx_kp_s_List_ConninfoOption);
  Py_CLEAR(clear_module_state->__pyx_kp_s_List_PGresAttDesc);
  Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
  Py_CLEAR(clear_module_state->__pyx_n_s_None);
  Py_CLEAR(clear_module_state->__pyx_n_s_NotSupportedError);
  Py_CLEAR(clear_module_state->__pyx_n_s_OperationalError);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_PGresult);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Sequence_Optional_bytes);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Sequence_bytes);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Sequence_int);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_bytes);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGcancel);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGcancel___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGcancel___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGcancel_cancel);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGcancel_free);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_connect);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_connect_poll);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_connect_start);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_consume_input);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_describe_portal);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_describe_prepared);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_encrypt_password);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_enter_pipeline_mode);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_exec);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_exec_params);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_exec_prepared);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_exit_pipeline_mode);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_finish);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_flush);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_get_cancel);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_get_copy_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_get_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_is_busy);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_make_empty_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_notifies);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_parameter_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_ping);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_pipeline_sync);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_prepare);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_put_copy_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_put_copy_end);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_reset);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_reset_poll);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_reset_start);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_send_describe_portal);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_send_describe_prepared);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_send_flush_request);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_send_prepare);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_send_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_send_query_params);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_send_query_prepared);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGconn_set_single_row_mode);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGnotify);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresAttDesc);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_clear);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_error_field);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_fformat);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_fmod);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_fname);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_fsize);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_ftable);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_ftablecol);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_ftype);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_get_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_param_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_PGresult_set_attributes);
  Py_CLEAR(clear_module_state->__pyx_n_s_PQBuffer);
  Py_CLEAR(clear_module_state->__pyx_n_s_PQBuffer___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_PQBuffer___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_kp_u_PQencryptPasswordConn_requires_l);
  Py_CLEAR(clear_module_state->__pyx_kp_u_PQenterPipelineMode_requires_lib);
  Py_CLEAR(clear_module_state->__pyx_kp_u_PQexitPipelineMode_requires_libp);
  Py_CLEAR(clear_module_state->__pyx_kp_u_PQhostaddr_requires_libpq_from_P);
  Py_CLEAR(clear_module_state->__pyx_kp_u_PQpipelineSync_requires_libpq_fr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_PQsendFlushRequest_requires_libp);
  Py_CLEAR(clear_module_state->__pyx_kp_u_PQsetResultAttrs_failed);
  Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
  Py_CLEAR(clear_module_state->__pyx_n_s_PipelineStatus);
  Py_CLEAR(clear_module_state->__pyx_n_s_PqFormat);
  Py_CLEAR(clear_module_state->__pyx_n_s_TEXT);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Tuple_int_memoryview);
  Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
  Py_CLEAR(clear_module_state->__pyx_n_s_ViewBuffer);
  Py_CLEAR(clear_module_state->__pyx_n_s_ViewBuffer___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ViewBuffer___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_kp_b__12);
  Py_CLEAR(clear_module_state->__pyx_n_s__130);
  Py_CLEAR(clear_module_state->__pyx_kp_u__14);
  Py_CLEAR(clear_module_state->__pyx_kp_u__17);
  Py_CLEAR(clear_module_state->__pyx_kp_u__18);
  Py_CLEAR(clear_module_state->__pyx_kp_u__19);
  Py_CLEAR(clear_module_state->__pyx_kp_u__2);
  Py_CLEAR(clear_module_state->__pyx_kp_u__20);
  Py_CLEAR(clear_module_state->__pyx_n_s__23);
  Py_CLEAR(clear_module_state->__pyx_kp_u__3);
  Py_CLEAR(clear_module_state->__pyx_kp_u__4);
  Py_CLEAR(clear_module_state->__pyx_n_s_algorithm);
  Py_CLEAR(clear_module_state->__pyx_n_u_ascii);
  Py_CLEAR(clear_module_state->__pyx_n_s_async);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
  Py_CLEAR(clear_module_state->__pyx_kp_u_at_0x);
  Py_CLEAR(clear_module_state->__pyx_kp_u_at_0x_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_attrs);
  Py_CLEAR(clear_module_state->__pyx_n_s_atttypmod);
  Py_CLEAR(clear_module_state->__pyx_n_s_atypes);
  Py_CLEAR(clear_module_state->__pyx_kp_u_available_instead);
  Py_CLEAR(clear_module_state->__pyx_n_s_buf);
  Py_CLEAR(clear_module_state->__pyx_n_s_buffer);
  Py_CLEAR(clear_module_state->__pyx_n_s_buffer_ptr);
  Py_CLEAR(clear_module_state->__pyx_n_s_build_version);
  Py_CLEAR(clear_module_state->__pyx_kp_u_bytes);
  Py_CLEAR(clear_module_state->__pyx_n_s_bytes_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_bytes_or_buffer_expected_got);
  Py_CLEAR(clear_module_state->__pyx_n_u_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_calgo);
  Py_CLEAR(clear_module_state->__pyx_n_s_cancel);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cancel_failed);
  Py_CLEAR(clear_module_state->__pyx_n_s_cbuffer);
  Py_CLEAR(clear_module_state->__pyx_n_s_ccol);
  Py_CLEAR(clear_module_state->__pyx_n_s_cerr);
  Py_CLEAR(clear_module_state->__pyx_n_s_cformats);
  Py_CLEAR(clear_module_state->__pyx_n_s_class);
  Py_CLEAR(clear_module_state->__pyx_n_s_clear);
  Py_CLEAR(clear_module_state->__pyx_n_s_clengths);
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_cls);
  Py_CLEAR(clear_module_state->__pyx_n_s_cnparams);
  Py_CLEAR(clear_module_state->__pyx_n_s_column_number);
  Py_CLEAR(clear_module_state->__pyx_n_s_columnid);
  Py_CLEAR(clear_module_state->__pyx_n_s_command);
  Py_CLEAR(clear_module_state->__pyx_n_s_compiled);
  Py_CLEAR(clear_module_state->__pyx_n_s_conn);
  Py_CLEAR(clear_module_state->__pyx_n_s_connect);
  Py_CLEAR(clear_module_state->__pyx_n_s_connect_poll);
  Py_CLEAR(clear_module_state->__pyx_n_s_connect_start);
  Py_CLEAR(clear_module_state->__pyx_kp_u_connection_not_in_pipeline_mode);
  Py_CLEAR(clear_module_state->__pyx_n_s_connection_summary);
  Py_CLEAR(clear_module_state->__pyx_n_s_conninfo);
  Py_CLEAR(clear_module_state->__pyx_n_s_consume_input);
  Py_CLEAR(clear_module_state->__pyx_kp_u_consuming_input_failed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_couldn_t_allocate_PGconn);
  Py_CLEAR(clear_module_state->__pyx_kp_u_couldn_t_allocate_PGresult);
  Py_CLEAR(clear_module_state->__pyx_kp_u_couldn_t_allocate_connection_def);
  Py_CLEAR(clear_module_state->__pyx_kp_u_couldn_t_allocate_connection_inf);
  Py_CLEAR(clear_module_state->__pyx_kp_u_couldn_t_allocate_empty_PGresult);
  Py_CLEAR(clear_module_state->__pyx_kp_u_couldn_t_allocate_for_escape_byt);
  Py_CLEAR(clear_module_state->__pyx_kp_u_couldn_t_allocate_for_unescape_b);
  Py_CLEAR(clear_module_state->__pyx_kp_u_couldn_t_allocate_on_conninfo_pa);
  Py_CLEAR(clear_module_state->__pyx_kp_u_couldn_t_create_cancel_object);
  Py_CLEAR(clear_module_state->__pyx_kp_u_couldn_t_reset_connection);
  Py_CLEAR(clear_module_state->__pyx_n_s_crow);
  Py_CLEAR(clear_module_state->__pyx_n_s_ctypes);
  Py_CLEAR(clear_module_state->__pyx_n_s_cvalues);
  Py_CLEAR(clear_module_state->__pyx_n_u_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_decode);
  Py_CLEAR(clear_module_state->__pyx_n_s_descr);
  Py_CLEAR(clear_module_state->__pyx_n_s_describe_portal);
  Py_CLEAR(clear_module_state->__pyx_n_s_describe_prepared);
  Py_CLEAR(clear_module_state->__pyx_n_s_descriptions);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
  Py_CLEAR(clear_module_state->__pyx_n_s_dispchar);
  Py_CLEAR(clear_module_state->__pyx_n_s_dispsize);
  Py_CLEAR(clear_module_state->__pyx_n_s_doc);
  Py_CLEAR(clear_module_state->__pyx_n_s_e);
  Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
  Py_CLEAR(clear_module_state->__pyx_n_s_encrypt_password);
  Py_CLEAR(clear_module_state->__pyx_n_s_enter_pipeline_mode);
  Py_CLEAR(clear_module_state->__pyx_n_s_envvar);
  Py_CLEAR(clear_module_state->__pyx_n_s_errmsg);
  Py_CLEAR(clear_module_state->__pyx_n_s_error);
  Py_CLEAR(clear_module_state->__pyx_n_s_error_field);
  Py_CLEAR(clear_module_state->__pyx_kp_u_error_in_notice_receiver_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_error_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_errors);
  Py_CLEAR(clear_module_state->__pyx_n_s_escape_bytea);
  Py_CLEAR(clear_module_state->__pyx_n_s_escape_identifier);
  Py_CLEAR(clear_module_state->__pyx_kp_u_escape_identifier_failed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_escape_identifier_failed_no_conn);
  Py_CLEAR(clear_module_state->__pyx_n_s_escape_literal);
  Py_CLEAR(clear_module_state->__pyx_kp_u_escape_literal_failed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_escape_literal_failed_no_connect);
  Py_CLEAR(clear_module_state->__pyx_n_s_escape_string);
  Py_CLEAR(clear_module_state->__pyx_kp_u_escape_string_failed);
  Py_CLEAR(clear_module_state->__pyx_n_s_exc);
  Py_CLEAR(clear_module_state->__pyx_n_s_exception);
  Py_CLEAR(clear_module_state->__pyx_n_s_exec);
  Py_CLEAR(clear_module_state->__pyx_n_s_exec_params);
  Py_CLEAR(clear_module_state->__pyx_n_s_exec_prepared);
  Py_CLEAR(clear_module_state->__pyx_n_s_exec_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_exit_pipeline_mode);
  Py_CLEAR(clear_module_state->__pyx_kp_u_failed_to_enter_pipeline_mode);
  Py_CLEAR(clear_module_state->__pyx_kp_u_failed_to_sync_pipeline);
  Py_CLEAR(clear_module_state->__pyx_n_s_fformat);
  Py_CLEAR(clear_module_state->__pyx_n_s_fieldcode);
  Py_CLEAR(clear_module_state->__pyx_n_s_finish);
  Py_CLEAR(clear_module_state->__pyx_n_s_flush);
  Py_CLEAR(clear_module_state->__pyx_kp_u_flush_request_failed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_flushing_failed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_flushing_failed_the_connection_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_fmod);
  Py_CLEAR(clear_module_state->__pyx_n_s_fname);
  Py_CLEAR(clear_module_state->__pyx_n_s_format);
  Py_CLEAR(clear_module_state->__pyx_n_s_free);
  Py_CLEAR(clear_module_state->__pyx_n_s_fsize);
  Py_CLEAR(clear_module_state->__pyx_n_s_ftable);
  Py_CLEAR(clear_module_state->__pyx_n_s_ftablecol);
  Py_CLEAR(clear_module_state->__pyx_n_s_ftype);
  Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
  Py_CLEAR(clear_module_state->__pyx_n_s_getLogger);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_cancel);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_copy_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_defaults);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
  Py_CLEAR(clear_module_state->__pyx_kp_u_got);
  Py_CLEAR(clear_module_state->__pyx_n_s_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_impl);
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
  Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
  Py_CLEAR(clear_module_state->__pyx_n_s_int);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_busy);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
  Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
  Py_CLEAR(clear_module_state->__pyx_n_s_keyword);
  Py_CLEAR(clear_module_state->__pyx_n_s_label);
  Py_CLEAR(clear_module_state->__pyx_n_s_length);
  Py_CLEAR(clear_module_state->__pyx_n_s_logger);
  Py_CLEAR(clear_module_state->__pyx_n_s_logging);
  Py_CLEAR(clear_module_state->__pyx_n_s_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_make_empty_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_module);
  Py_CLEAR(clear_module_state->__pyx_n_s_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_nbytes);
  Py_CLEAR(clear_module_state->__pyx_n_s_new);
  Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
  Py_CLEAR(clear_module_state->__pyx_n_s_notifies);
  Py_CLEAR(clear_module_state->__pyx_n_s_nparams);
  Py_CLEAR(clear_module_state->__pyx_n_s_num);
  Py_CLEAR(clear_module_state->__pyx_n_s_opts);
  Py_CLEAR(clear_module_state->__pyx_n_s_out);
  Py_CLEAR(clear_module_state->__pyx_n_s_param_formats);
  Py_CLEAR(clear_module_state->__pyx_kp_u_param_formats_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_param_number);
  Py_CLEAR(clear_module_state->__pyx_n_s_param_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_param_types);
  Py_CLEAR(clear_module_state->__pyx_kp_u_param_types_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_param_values);
  Py_CLEAR(clear_module_state->__pyx_kp_u_param_values_but);
  Py_CLEAR(clear_module_state->__pyx_n_s_parameter_status);
  Py_CLEAR(clear_module_state->__pyx_n_s_parse);
  Py_CLEAR(clear_module_state->__pyx_n_s_passwd);
  Py_CLEAR(clear_module_state->__pyx_kp_u_password_encryption_failed);
  Py_CLEAR(clear_module_state->__pyx_n_s_pgconn);
  Py_CLEAR(clear_module_state->__pyx_n_s_pgresult);
  Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
  Py_CLEAR(clear_module_state->__pyx_n_s_ping);
  Py_CLEAR(clear_module_state->__pyx_n_s_pipeline_sync);
  Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
  Py_CLEAR(clear_module_state->__pyx_n_s_prepare_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_psycopg);
  Py_CLEAR(clear_module_state->__pyx_n_u_psycopg);
  Py_CLEAR(clear_module_state->__pyx_n_s_psycopg_c_pq);
  Py_CLEAR(clear_module_state->__pyx_kp_s_psycopg_c_pq_conninfo_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_psycopg_c_pq_escaping_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_psycopg_c_pq_pgcancel_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_psycopg_c_pq_pgconn_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_psycopg_c_pq_pgresult_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_psycopg_c_pq_pyx);
  Py_CLEAR(clear_module_state->__pyx_n_s_psycopg_pq);
  Py_CLEAR(clear_module_state->__pyx_n_s_psycopg_pq__enums);
  Py_CLEAR(clear_module_state->__pyx_n_s_psycopg_pq_misc);
  Py_CLEAR(clear_module_state->__pyx_n_s_ptr);
  Py_CLEAR(clear_module_state->__pyx_n_s_put_copy_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_put_copy_end);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Escaping);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
  Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
  Py_CLEAR(clear_module_state->__pyx_kp_u_receiving_copy_data_failed);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
  Py_CLEAR(clear_module_state->__pyx_n_s_repr);
  Py_CLEAR(clear_module_state->__pyx_n_s_res);
  Py_CLEAR(clear_module_state->__pyx_n_s_reset);
  Py_CLEAR(clear_module_state->__pyx_n_s_reset_poll);
  Py_CLEAR(clear_module_state->__pyx_n_s_reset_start);
  Py_CLEAR(clear_module_state->__pyx_n_s_result_format);
  Py_CLEAR(clear_module_state->__pyx_n_s_return);
  Py_CLEAR(clear_module_state->__pyx_n_s_row_number);
  Py_CLEAR(clear_module_state->__pyx_n_s_rv);
  Py_CLEAR(clear_module_state->__pyx_n_s_self);
  Py_CLEAR(clear_module_state->__pyx_n_s_send_describe_portal);
  Py_CLEAR(clear_module_state->__pyx_n_s_send_describe_prepared);
  Py_CLEAR(clear_module_state->__pyx_n_s_send_flush_request);
  Py_CLEAR(clear_module_state->__pyx_n_s_send_prepare);
  Py_CLEAR(clear_module_state->__pyx_n_s_send_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_send_query_params);
  Py_CLEAR(clear_module_state->__pyx_n_s_send_query_prepared);
  Py_CLEAR(clear_module_state->__pyx_kp_u_sending_copy_data_failed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_sending_copy_end_failed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_sending_describe_prepared_failed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_sending_prepared_query_failed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_sending_query_and_params_failed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_sending_query_failed);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_attributes);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_single_row_mode);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_kp_u_setting_nonblocking_failed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_setting_single_row_mode_failed);
  Py_CLEAR(clear_module_state->__pyx_n_s_spec);
  Py_CLEAR(clear_module_state->__pyx_n_s_ssl);
  Py_CLEAR(clear_module_state->__pyx_n_s_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_status);
  Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
  Py_CLEAR(clear_module_state->__pyx_n_s_super);
  Py_CLEAR(clear_module_state->__pyx_n_s_tableid);
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
  Py_CLEAR(clear_module_state->__pyx_kp_u_the_connection_is_closed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_the_connection_is_lost);
  Py_CLEAR(clear_module_state->__pyx_n_s_typid);
  Py_CLEAR(clear_module_state->__pyx_n_s_typing);
  Py_CLEAR(clear_module_state->__pyx_n_s_typlen);
  Py_CLEAR(clear_module_state->__pyx_n_s_unescape_bytea);
  Py_CLEAR(clear_module_state->__pyx_n_s_update);
  Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_user);
  Py_CLEAR(clear_module_state->__pyx_n_s_v);
  Py_CLEAR(clear_module_state->__pyx_n_s_val);
  Py_CLEAR(clear_module_state->__pyx_n_s_version);
  Py_CLEAR(clear_module_state->__pyx_n_u_x);
  Py_CLEAR(clear_module_state->__pyx_int_8405287);
  Py_CLEAR(clear_module_state->__pyx_int_12701922);
  Py_CLEAR(clear_module_state->__pyx_int_59804213);
  Py_CLEAR(clear_module_state->__pyx_k__8);
  Py_CLEAR(clear_module_state->__pyx_k__9);
  Py_CLEAR(clear_module_state->__pyx_k__10);
  Py_CLEAR(clear_module_state->__pyx_k__11);
  Py_CLEAR(clear_module_state->__pyx_tuple__5);
  Py_CLEAR(clear_module_state->__pyx_tuple__6);
  Py_CLEAR(clear_module_state->__pyx_tuple__7);
  Py_CLEAR(clear_module_state->__pyx_tuple__13);
  Py_CLEAR(clear_module_state->__pyx_tuple__15);
  Py_CLEAR(clear_module_state->__pyx_tuple__16);
  Py_CLEAR(clear_module_state->__pyx_tuple__21);
  Py_CLEAR(clear_module_state->__pyx_tuple__24);
  Py_CLEAR(clear_module_state->__pyx_tuple__25);
  Py_CLEAR(clear_module_state->__pyx_tuple__28);
  Py_CLEAR(clear_module_state->__pyx_tuple__34);
  Py_CLEAR(clear_module_state->__pyx_tuple__36);
  Py_CLEAR(clear_module_state->__pyx_tuple__38);
  Py_CLEAR(clear_module_state->__pyx_tuple__40);
  Py_CLEAR(clear_module_state->__pyx_tuple__42);
  Py_CLEAR(clear_module_state->__pyx_tuple__44);
  Py_CLEAR(clear_module_state->__pyx_tuple__46);
  Py_CLEAR(clear_module_state->__pyx_tuple__48);
  Py_CLEAR(clear_module_state->__pyx_tuple__49);
  Py_CLEAR(clear_module_state->__pyx_tuple__57);
  Py_CLEAR(clear_module_state->__pyx_tuple__60);
  Py_CLEAR(clear_module_state->__pyx_tuple__64);
  Py_CLEAR(clear_module_state->__pyx_tuple__67);
  Py_CLEAR(clear_module_state->__pyx_tuple__69);
  Py_CLEAR(clear_module_state->__pyx_tuple__71);
  Py_CLEAR(clear_module_state->__pyx_tuple__73);
  Py_CLEAR(clear_module_state->__pyx_tuple__75);
  Py_CLEAR(clear_module_state->__pyx_tuple__82);
  Py_CLEAR(clear_module_state->__pyx_tuple__85);
  Py_CLEAR(clear_module_state->__pyx_tuple__87);
  Py_CLEAR(clear_module_state->__pyx_tuple__89);
  Py_CLEAR(clear_module_state->__pyx_tuple__96);
  Py_CLEAR(clear_module_state->__pyx_tuple__98);
  Py_CLEAR(clear_module_state->__pyx_tuple__100);
  Py_CLEAR(clear_module_state->__pyx_tuple__105);
  Py_CLEAR(clear_module_state->__pyx_tuple__109);
  Py_CLEAR(clear_module_state->__pyx_tuple__111);
  Py_CLEAR(clear_module_state->__pyx_tuple__114);
  Py_CLEAR(clear_module_state->__pyx_tuple__119);
  Py_CLEAR(clear_module_state->__pyx_tuple__121);
  Py_CLEAR(clear_module_state->__pyx_tuple__128);
  Py_CLEAR(clear_module_state->__pyx_codeobj__22);
  Py_CLEAR(clear_module_state->__pyx_codeobj__26);
  Py_CLEAR(clear_module_state->__pyx_codeobj__27);
  Py_CLEAR(clear_module_state->__pyx_codeobj__29);
  Py_CLEAR(clear_module_state->__pyx_codeobj__30);
  Py_CLEAR(clear_module_state->__pyx_codeobj__31);
  Py_CLEAR(clear_module_state->__pyx_codeobj__32);
  Py_CLEAR(clear_module_state->__pyx_codeobj__33);
  Py_CLEAR(clear_module_state->__pyx_codeobj__35);
  Py_CLEAR(clear_module_state->__pyx_codeobj__37);
  Py_CLEAR(clear_module_state->__pyx_codeobj__39);
  Py_CLEAR(clear_module_state->__pyx_codeobj__41);
  Py_CLEAR(clear_module_state->__pyx_codeobj__43);
  Py_CLEAR(clear_module_state->__pyx_codeobj__45);
  Py_CLEAR(clear_module_state->__pyx_codeobj__47);
  Py_CLEAR(clear_module_state->__pyx_codeobj__50);
  Py_CLEAR(clear_module_state->__pyx_codeobj__51);
  Py_CLEAR(clear_module_state->__pyx_codeobj__52);
  Py_CLEAR(clear_module_state->__pyx_codeobj__53);
  Py_CLEAR(clear_module_state->__pyx_codeobj__54);
  Py_CLEAR(clear_module_state->__pyx_codeobj__55);
  Py_CLEAR(clear_module_state->__pyx_codeobj__56);
  Py_CLEAR(clear_module_state->__pyx_codeobj__58);
  Py_CLEAR(clear_module_state->__pyx_codeobj__59);
  Py_CLEAR(clear_module_state->__pyx_codeobj__61);
  Py_CLEAR(clear_module_state->__pyx_codeobj__62);
  Py_CLEAR(clear_module_state->__pyx_codeobj__63);
  Py_CLEAR(clear_module_state->__pyx_codeobj__65);
  Py_CLEAR(clear_module_state->__pyx_codeobj__66);
  Py_CLEAR(clear_module_state->__pyx_codeobj__68);
  Py_CLEAR(clear_module_state->__pyx_codeobj__70);
  Py_CLEAR(clear_module_state->__pyx_codeobj__72);
  Py_CLEAR(clear_module_state->__pyx_codeobj__74);
  Py_CLEAR(clear_module_state->__pyx_codeobj__76);
  Py_CLEAR(clear_module_state->__pyx_codeobj__77);
  Py_CLEAR(clear_module_state->__pyx_codeobj__78);
  Py_CLEAR(clear_module_state->__pyx_codeobj__79);
  Py_CLEAR(clear_module_state->__pyx_codeobj__80);
  Py_CLEAR(clear_module_state->__pyx_codeobj__81);
  Py_CLEAR(clear_module_state->__pyx_codeobj__83);
  Py_CLEAR(clear_module_state->__pyx_codeobj__84);
  Py_CLEAR(clear_module_state->__pyx_codeobj__86);
  Py_CLEAR(clear_module_state->__pyx_codeobj__88);
  Py_CLEAR(clear_module_state->__pyx_codeobj__90);
  Py_CLEAR(clear_module_state->__pyx_codeobj__91);
  Py_CLEAR(clear_module_state->__pyx_codeobj__92);
  Py_CLEAR(clear_module_state->__pyx_codeobj__93);
  Py_CLEAR(clear_module_state->__pyx_codeobj__94);
  Py_CLEAR(clear_module_state->__pyx_codeobj__95);
  Py_CLEAR(clear_module_state->__pyx_codeobj__97);
  Py_CLEAR(clear_module_state->__pyx_codeobj__99);
  Py_CLEAR(clear_module_state->__pyx_codeobj__101);
  Py_CLEAR(clear_module_state->__pyx_codeobj__102);
  Py_CLEAR(clear_module_state->__pyx_codeobj__103);
  Py_CLEAR(clear_module_state->__pyx_codeobj__104);
  Py_CLEAR(clear_module_state->__pyx_codeobj__106);
  Py_CLEAR(clear_module_state->__pyx_codeobj__107);
  Py_CLEAR(clear_module_state->__pyx_codeobj__108);
  Py_CLEAR(clear_module_state->__pyx_codeobj__110);
  Py_CLEAR(clear_module_state->__pyx_codeobj__112);
  Py_CLEAR(clear_module_state->__pyx_codeobj__113);
  Py_CLEAR(clear_module_state->__pyx_codeobj__115);
  Py_CLEAR(clear_module_state->__pyx_codeobj__116);
  Py_CLEAR(clear_module_state->__pyx_codeobj__117);
  Py_CLEAR(clear_module_state->__pyx_codeobj__118);
  Py_CLEAR(clear_module_state->__pyx_codeobj__120);
  Py_CLEAR(clear_module_state->__pyx_codeobj__122);
  Py_CLEAR(clear_module_state->__pyx_codeobj__123);
  Py_CLEAR(clear_module_state->__pyx_codeobj__124);
  Py_CLEAR(clear_module_state->__pyx_codeobj__125);
  Py_CLEAR(clear_module_state->__pyx_codeobj__126);
  Py_CLEAR(clear_module_state->__pyx_codeobj__127);
  Py_CLEAR(clear_module_state->__pyx_codeobj__129);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstate *traverse_module_state = __pyx_mstate(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  Py_VISIT(traverse_module_state->__pyx_empty_tuple);
  Py_VISIT(traverse_module_state->__pyx_empty_bytes);
  Py_VISIT(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_9psycopg_c_2pq_PGconn);
  Py_VISIT(traverse_module_state->__pyx_type_9psycopg_c_2pq_PGconn);
  Py_VISIT(traverse_module_state->__pyx_ptype_9psycopg_c_2pq_PGresult);
  Py_VISIT(traverse_module_state->__pyx_type_9psycopg_c_2pq_PGresult);
  Py_VISIT(traverse_module_state->__pyx_ptype_9psycopg_c_2pq_PGcancel);
  Py_VISIT(traverse_module_state->__pyx_type_9psycopg_c_2pq_PGcancel);
  Py_VISIT(traverse_module_state->__pyx_ptype_9psycopg_c_2pq_Escaping);
  Py_VISIT(traverse_module_state->__pyx_type_9psycopg_c_2pq_Escaping);
  Py_VISIT(traverse_module_state->__pyx_ptype_9psycopg_c_2pq_PQBuffer);
  Py_VISIT(traverse_module_state->__pyx_type_9psycopg_c_2pq_PQBuffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_9psycopg_c_2pq_ViewBuffer);
  Py_VISIT(traverse_module_state->__pyx_type_9psycopg_c_2pq_ViewBuffer);
  Py_VISIT(traverse_module_state->__pyx_kp_u_);
  Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
  Py_VISIT(traverse_module_state->__pyx_n_s_Conninfo);
  Py_VISIT(traverse_module_state->__pyx_n_s_ConninfoOption);
  Py_VISIT(traverse_module_state->__pyx_n_s_Conninfo___repr);
  Py_VISIT(traverse_module_state->__pyx_n_s_Conninfo_get_defaults);
  Py_VISIT(traverse_module_state->__pyx_n_s_Conninfo_parse);
  Py_VISIT(traverse_module_state->__pyx_n_s_Escaping);
  Py_VISIT(traverse_module_state->__pyx_n_s_Escaping___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Escaping___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Escaping_escape_bytea);
  Py_VISIT(traverse_module_state->__pyx_n_s_Escaping_escape_identifier);
  Py_VISIT(traverse_module_state->__pyx_n_s_Escaping_escape_literal);
  Py_VISIT(traverse_module_state->__pyx_n_s_Escaping_escape_string);
  Py_VISIT(traverse_module_state->__pyx_n_s_Escaping_unescape_bytea);
  Py_VISIT(traverse_module_state->__pyx_n_s_ExecStatus);
  Py_VISIT(traverse_module_state->__pyx_n_s_Format);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
  Py_VISIT(traverse_module_state->__pyx_n_s_Iterator);
  Py_VISIT(traverse_module_state->__pyx_kp_s_List_ConninfoOption);
  Py_VISIT(traverse_module_state->__pyx_kp_s_List_PGresAttDesc);
  Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
  Py_VISIT(traverse_module_state->__pyx_n_s_None);
  Py_VISIT(traverse_module_state->__pyx_n_s_NotSupportedError);
  Py_VISIT(traverse_module_state->__pyx_n_s_OperationalError);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_PGresult);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Sequence_Optional_bytes);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Sequence_bytes);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Sequence_int);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_bytes);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGcancel);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGcancel___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGcancel___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGcancel_cancel);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGcancel_free);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_connect);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_connect_poll);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_connect_start);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_consume_input);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_describe_portal);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_describe_prepared);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_encrypt_password);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_enter_pipeline_mode);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_exec);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_exec_params);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_exec_prepared);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_exit_pipeline_mode);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_finish);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_flush);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_get_cancel);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_get_copy_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_get_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_is_busy);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_make_empty_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_notifies);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_parameter_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_ping);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_pipeline_sync);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_prepare);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_put_copy_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_put_copy_end);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_reset);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_reset_poll);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_reset_start);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_send_describe_portal);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_send_describe_prepared);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_send_flush_request);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_send_prepare);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_send_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_send_query_params);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_send_query_prepared);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGconn_set_single_row_mode);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGnotify);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresAttDesc);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_clear);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_error_field);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_fformat);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_fmod);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_fname);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_fsize);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_ftable);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_ftablecol);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_ftype);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_get_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_param_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_PGresult_set_attributes);
  Py_VISIT(traverse_module_state->__pyx_n_s_PQBuffer);
  Py_VISIT(traverse_module_state->__pyx_n_s_PQBuffer___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_PQBuffer___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_kp_u_PQencryptPasswordConn_requires_l);
  Py_VISIT(traverse_module_state->__pyx_kp_u_PQenterPipelineMode_requires_lib);
  Py_VISIT(traverse_module_state->__pyx_kp_u_PQexitPipelineMode_requires_libp);
  Py_VISIT(traverse_module_state->__pyx_kp_u_PQhostaddr_requires_libpq_from_P);
  Py_VISIT(traverse_module_state->__pyx_kp_u_PQpipelineSync_requires_libpq_fr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_PQsendFlushRequest_requires_libp);
  Py_VISIT(traverse_module_state->__pyx_kp_u_PQsetResultAttrs_failed);
  Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
  Py_VISIT(traverse_module_state->__pyx_n_s_PipelineStatus);
  Py_VISIT(traverse_module_state->__pyx_n_s_PqFormat);
  Py_VISIT(traverse_module_state->__pyx_n_s_TEXT);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Tuple_int_memoryview);
  Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
  Py_VISIT(traverse_module_state->__pyx_n_s_ViewBuffer);
  Py_VISIT(traverse_module_state->__pyx_n_s_ViewBuffer___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ViewBuffer___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_kp_b__12);
  Py_VISIT(traverse_module_state->__pyx_n_s__130);
  Py_VISIT(traverse_module_state->__pyx_kp_u__14);
  Py_VISIT(traverse_module_state->__pyx_kp_u__17);
  Py_VISIT(traverse_module_state->__pyx_kp_u__18);
  Py_VISIT(traverse_module_state->__pyx_kp_u__19);
  Py_VISIT(traverse_module_state->__pyx_kp_u__2);
  Py_VISIT(traverse_module_state->__pyx_kp_u__20);
  Py_VISIT(traverse_module_state->__pyx_n_s__23);
  Py_VISIT(traverse_module_state->__pyx_kp_u__3);
  Py_VISIT(traverse_module_state->__pyx_kp_u__4);
  Py_VISIT(traverse_module_state->__pyx_n_s_algorithm);
  Py_VISIT(traverse_module_state->__pyx_n_u_ascii);
  Py_VISIT(traverse_module_state->__pyx_n_s_async);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
  Py_VISIT(traverse_module_state->__pyx_kp_u_at_0x);
  Py_VISIT(traverse_module_state->__pyx_kp_u_at_0x_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_attrs);
  Py_VISIT(traverse_module_state->__pyx_n_s_atttypmod);
  Py_VISIT(traverse_module_state->__pyx_n_s_atypes);
  Py_VISIT(traverse_module_state->__pyx_kp_u_available_instead);
  Py_VISIT(traverse_module_state->__pyx_n_s_buf);
  Py_VISIT(traverse_module_state->__pyx_n_s_buffer);
  Py_VISIT(traverse_module_state->__pyx_n_s_buffer_ptr);
  Py_VISIT(traverse_module_state->__pyx_n_s_build_version);
  Py_VISIT(traverse_module_state->__pyx_kp_u_bytes);
  Py_VISIT(traverse_module_state->__pyx_n_s_bytes_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_bytes_or_buffer_expected_got);
  Py_VISIT(traverse_module_state->__pyx_n_u_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_calgo);
  Py_VISIT(traverse_module_state->__pyx_n_s_cancel);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cancel_failed);
  Py_VISIT(traverse_module_state->__pyx_n_s_cbuffer);
  Py_VISIT(traverse_module_state->__pyx_n_s_ccol);
  Py_VISIT(traverse_module_state->__pyx_n_s_cerr);
  Py_VISIT(traverse_module_state->__pyx_n_s_cformats);
  Py_VISIT(traverse_module_state->__pyx_n_s_class);
  Py_VISIT(traverse_module_state->__pyx_n_s_clear);
  Py_VISIT(traverse_module_state->__pyx_n_s_clengths);
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_cls);
  Py_VISIT(traverse_module_state->__pyx_n_s_cnparams);
  Py_VISIT(traverse_module_state->__pyx_n_s_column_number);
  Py_VISIT(traverse_module_state->__pyx_n_s_columnid);
  Py_VISIT(traverse_module_state->__pyx_n_s_command);
  Py_VISIT(traverse_module_state->__pyx_n_s_compiled);
  Py_VISIT(traverse_module_state->__pyx_n_s_conn);
  Py_VISIT(traverse_module_state->__pyx_n_s_connect);
  Py_VISIT(traverse_module_state->__pyx_n_s_connect_poll);
  Py_VISIT(traverse_module_state->__pyx_n_s_connect_start);
  Py_VISIT(traverse_module_state->__pyx_kp_u_connection_not_in_pipeline_mode);
  Py_VISIT(traverse_module_state->__pyx_n_s_connection_summary);
  Py_VISIT(traverse_module_state->__pyx_n_s_conninfo);
  Py_VISIT(traverse_module_state->__pyx_n_s_consume_input);
  Py_VISIT(traverse_module_state->__pyx_kp_u_consuming_input_failed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_couldn_t_allocate_PGconn);
  Py_VISIT(traverse_module_state->__pyx_kp_u_couldn_t_allocate_PGresult);
  Py_VISIT(traverse_module_state->__pyx_kp_u_couldn_t_allocate_connection_def);
  Py_VISIT(traverse_module_state->__pyx_kp_u_couldn_t_allocate_connection_inf);
  Py_VISIT(traverse_module_state->__pyx_kp_u_couldn_t_allocate_empty_PGresult);
  Py_VISIT(traverse_module_state->__pyx_kp_u_couldn_t_allocate_for_escape_byt);
  Py_VISIT(traverse_module_state->__pyx_kp_u_couldn_t_allocate_for_unescape_b);
  Py_VISIT(traverse_module_state->__pyx_kp_u_couldn_t_allocate_on_conninfo_pa);
  Py_VISIT(traverse_module_state->__pyx_kp_u_couldn_t_create_cancel_object);
  Py_VISIT(traverse_module_state->__pyx_kp_u_couldn_t_reset_connection);
  Py_VISIT(traverse_module_state->__pyx_n_s_crow);
  Py_VISIT(traverse_module_state->__pyx_n_s_ctypes);
  Py_VISIT(traverse_module_state->__pyx_n_s_cvalues);
  Py_VISIT(traverse_module_state->__pyx_n_u_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_decode);
  Py_VISIT(traverse_module_state->__pyx_n_s_descr);
  Py_VISIT(traverse_module_state->__pyx_n_s_describe_portal);
  Py_VISIT(traverse_module_state->__pyx_n_s_describe_prepared);
  Py_VISIT(traverse_module_state->__pyx_n_s_descriptions);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
  Py_VISIT(traverse_module_state->__pyx_n_s_dispchar);
  Py_VISIT(traverse_module_state->__pyx_n_s_dispsize);
  Py_VISIT(traverse_module_state->__pyx_n_s_doc);
  Py_VISIT(traverse_module_state->__pyx_n_s_e);
  Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
  Py_VISIT(traverse_module_state->__pyx_n_s_encrypt_password);
  Py_VISIT(traverse_module_state->__pyx_n_s_enter_pipeline_mode);
  Py_VISIT(traverse_module_state->__pyx_n_s_envvar);
  Py_VISIT(traverse_module_state->__pyx_n_s_errmsg);
  Py_VISIT(traverse_module_state->__pyx_n_s_error);
  Py_VISIT(traverse_module_state->__pyx_n_s_error_field);
  Py_VISIT(traverse_module_state->__pyx_kp_u_error_in_notice_receiver_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_error_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_errors);
  Py_VISIT(traverse_module_state->__pyx_n_s_escape_bytea);
  Py_VISIT(traverse_module_state->__pyx_n_s_escape_identifier);
  Py_VISIT(traverse_module_state->__pyx_kp_u_escape_identifier_failed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_escape_identifier_failed_no_conn);
  Py_VISIT(traverse_module_state->__pyx_n_s_escape_literal);
  Py_VISIT(traverse_module_state->__pyx_kp_u_escape_literal_failed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_escape_literal_failed_no_connect);
  Py_VISIT(traverse_module_state->__pyx_n_s_escape_string);
  Py_VISIT(traverse_module_state->__pyx_kp_u_escape_string_failed);
  Py_VISIT(traverse_module_state->__pyx_n_s_exc);
  Py_VISIT(traverse_module_state->__pyx_n_s_exception);
  Py_VISIT(traverse_module_state->__pyx_n_s_exec);
  Py_VISIT(traverse_module_state->__pyx_n_s_exec_params);
  Py_VISIT(traverse_module_state->__pyx_n_s_exec_prepared);
  Py_VISIT(traverse_module_state->__pyx_n_s_exec_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_exit_pipeline_mode);
  Py_VISIT(traverse_module_state->__pyx_kp_u_failed_to_enter_pipeline_mode);
  Py_VISIT(traverse_module_state->__pyx_kp_u_failed_to_sync_pipeline);
  Py_VISIT(traverse_module_state->__pyx_n_s_fformat);
  Py_VISIT(traverse_module_state->__pyx_n_s_fieldcode);
  Py_VISIT(traverse_module_state->__pyx_n_s_finish);
  Py_VISIT(traverse_module_state->__pyx_n_s_flush);
  Py_VISIT(traverse_module_state->__pyx_kp_u_flush_request_failed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_flushing_failed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_flushing_failed_the_connection_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_fmod);
  Py_VISIT(traverse_module_state->__pyx_n_s_fname);
  Py_VISIT(traverse_module_state->__pyx_n_s_format);
  Py_VISIT(traverse_module_state->__pyx_n_s_free);
  Py_VISIT(traverse_module_state->__pyx_n_s_fsize);
  Py_VISIT(traverse_module_state->__pyx_n_s_ftable);
  Py_VISIT(traverse_module_state->__pyx_n_s_ftablecol);
  Py_VISIT(traverse_module_state->__pyx_n_s_ftype);
  Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
  Py_VISIT(traverse_module_state->__pyx_n_s_getLogger);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_cancel);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_copy_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_defaults);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
  Py_VISIT(traverse_module_state->__pyx_kp_u_got);
  Py_VISIT(traverse_module_state->__pyx_n_s_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_impl);
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
  Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
  Py_VISIT(traverse_module_state->__pyx_n_s_int);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_busy);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
  Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
  Py_VISIT(traverse_module_state->__pyx_n_s_keyword);
  Py_VISIT(traverse_module_state->__pyx_n_s_label);
  Py_VISIT(traverse_module_state->__pyx_n_s_length);
  Py_VISIT(traverse_module_state->__pyx_n_s_logger);
  Py_VISIT(traverse_module_state->__pyx_n_s_logging);
  Py_VISIT(traverse_module_state->__pyx_n_s_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_make_empty_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_module);
  Py_VISIT(traverse_module_state->__pyx_n_s_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_nbytes);
  Py_VISIT(traverse_module_state->__pyx_n_s_new);
  Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
  Py_VISIT(traverse_module_state->__pyx_n_s_notifies);
  Py_VISIT(traverse_module_state->__pyx_n_s_nparams);
  Py_VISIT(traverse_module_state->__pyx_n_s_num);
  Py_VISIT(traverse_module_state->__pyx_n_s_opts);
  Py_VISIT(traverse_module_state->__pyx_n_s_out);
  Py_VISIT(traverse_module_state->__pyx_n_s_param_formats);
  Py_VISIT(traverse_module_state->__pyx_kp_u_param_formats_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_param_number);
  Py_VISIT(traverse_module_state->__pyx_n_s_param_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_param_types);
  Py_VISIT(traverse_module_state->__pyx_kp_u_param_types_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_param_values);
  Py_VISIT(traverse_module_state->__pyx_kp_u_param_values_but);
  Py_VISIT(traverse_module_state->__pyx_n_s_parameter_status);
  Py_VISIT(traverse_module_state->__pyx_n_s_parse);
  Py_VISIT(traverse_module_state->__pyx_n_s_passwd);
  Py_VISIT(traverse_module_state->__pyx_kp_u_password_encryption_failed);
  Py_VISIT(traverse_module_state->__pyx_n_s_pgconn);
  Py_VISIT(traverse_module_state->__pyx_n_s_pgresult);
  Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
  Py_VISIT(traverse_module_state->__pyx_n_s_ping);
  Py_VISIT(traverse_module_state->__pyx_n_s_pipeline_sync);
  Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
  Py_VISIT(traverse_module_state->__pyx_n_s_prepare_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_psycopg);
  Py_VISIT(traverse_module_state->__pyx_n_u_psycopg);
  Py_VISIT(traverse_module_state->__pyx_n_s_psycopg_c_pq);
  Py_VISIT(traverse_module_state->__pyx_kp_s_psycopg_c_pq_conninfo_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_psycopg_c_pq_escaping_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_psycopg_c_pq_pgcancel_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_psycopg_c_pq_pgconn_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_psycopg_c_pq_pgresult_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_psycopg_c_pq_pyx);
  Py_VISIT(traverse_module_state->__pyx_n_s_psycopg_pq);
  Py_VISIT(traverse_module_state->__pyx_n_s_psycopg_pq__enums);
  Py_VISIT(traverse_module_state->__pyx_n_s_psycopg_pq_misc);
  Py_VISIT(traverse_module_state->__pyx_n_s_ptr);
  Py_VISIT(traverse_module_state->__pyx_n_s_put_copy_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_put_copy_end);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Escaping);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
  Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
  Py_VISIT(traverse_module_state->__pyx_kp_u_receiving_copy_data_failed);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
  Py_VISIT(traverse_module_state->__pyx_n_s_repr);
  Py_VISIT(traverse_module_state->__pyx_n_s_res);
  Py_VISIT(traverse_module_state->__pyx_n_s_reset);
  Py_VISIT(traverse_module_state->__pyx_n_s_reset_poll);
  Py_VISIT(traverse_module_state->__pyx_n_s_reset_start);
  Py_VISIT(traverse_module_state->__pyx_n_s_result_format);
  Py_VISIT(traverse_module_state->__pyx_n_s_return);
  Py_VISIT(traverse_module_state->__pyx_n_s_row_number);
  Py_VISIT(traverse_module_state->__pyx_n_s_rv);
  Py_VISIT(traverse_module_state->__pyx_n_s_self);
  Py_VISIT(traverse_module_state->__pyx_n_s_send_describe_portal);
  Py_VISIT(traverse_module_state->__pyx_n_s_send_describe_prepared);
  Py_VISIT(traverse_module_state->__pyx_n_s_send_flush_request);
  Py_VISIT(traverse_module_state->__pyx_n_s_send_prepare);
  Py_VISIT(traverse_module_state->__pyx_n_s_send_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_send_query_params);
  Py_VISIT(traverse_module_state->__pyx_n_s_send_query_prepared);
  Py_VISIT(traverse_module_state->__pyx_kp_u_sending_copy_data_failed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_sending_copy_end_failed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_sending_describe_prepared_failed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_sending_prepared_query_failed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_sending_query_and_params_failed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_sending_query_failed);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_attributes);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_single_row_mode);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_kp_u_setting_nonblocking_failed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_setting_single_row_mode_failed);
  Py_VISIT(traverse_module_state->__pyx_n_s_spec);
  Py_VISIT(traverse_module_state->__pyx_n_s_ssl);
  Py_VISIT(traverse_module_state->__pyx_n_s_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_status);
  Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
  Py_VISIT(traverse_module_state->__pyx_n_s_super);
  Py_VISIT(traverse_module_state->__pyx_n_s_tableid);
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
  Py_VISIT(traverse_module_state->__pyx_kp_u_the_connection_is_closed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_the_connection_is_lost);
  Py_VISIT(traverse_module_state->__pyx_n_s_typid);
  Py_VISIT(traverse_module_state->__pyx_n_s_typing);
  Py_VISIT(traverse_module_state->__pyx_n_s_typlen);
  Py_VISIT(traverse_module_state->__pyx_n_s_unescape_bytea);
  Py_VISIT(traverse_module_state->__pyx_n_s_update);
  Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_user);
  Py_VISIT(traverse_module_state->__pyx_n_s_v);
  Py_VISIT(traverse_module_state->__pyx_n_s_val);
  Py_VISIT(traverse_module_state->__pyx_n_s_version);
  Py_VISIT(traverse_module_state->__pyx_n_u_x);
  Py_VISIT(traverse_module_state->__pyx_int_8405287);
  Py_VISIT(traverse_module_state->__pyx_int_12701922);
  Py_VISIT(traverse_module_state->__pyx_int_59804213);
  Py_VISIT(traverse_module_state->__pyx_k__8);
  Py_VISIT(traverse_module_state->__pyx_k__9);
  Py_VISIT(traverse_module_state->__pyx_k__10);
  Py_VISIT(traverse_module_state->__pyx_k__11);
  Py_VISIT(traverse_module_state->__pyx_tuple__5);
  Py_VISIT(traverse_module_state->__pyx_tuple__6);
  Py_VISIT(traverse_module_state->__pyx_tuple__7);
  Py_VISIT(traverse_module_state->__pyx_tuple__13);
  Py_VISIT(traverse_module_state->__pyx_tuple__15);
  Py_VISIT(traverse_module_state->__pyx_tuple__16);
  Py_VISIT(traverse_module_state->__pyx_tuple__21);
  Py_VISIT(traverse_module_state->__pyx_tuple__24);
  Py_VISIT(traverse_module_state->__pyx_tuple__25);
  Py_VISIT(traverse_module_state->__pyx_tuple__28);
  Py_VISIT(traverse_module_state->__pyx_tuple__34);
  Py_VISIT(traverse_module_state->__pyx_tuple__36);
  Py_VISIT(traverse_module_state->__pyx_tuple__38);
  Py_VISIT(traverse_module_state->__pyx_tuple__40);
  Py_VISIT(traverse_module_state->__pyx_tuple__42);
  Py_VISIT(traverse_module_state->__pyx_tuple__44);
  Py_VISIT(traverse_module_state->__pyx_tuple__46);
  Py_VISIT(traverse_module_state->__pyx_tuple__48);
  Py_VISIT(traverse_module_state->__pyx_tuple__49);
  Py_VISIT(traverse_module_state->__pyx_tuple__57);
  Py_VISIT(traverse_module_state->__pyx_tuple__60);
  Py_VISIT(traverse_module_state->__pyx_tuple__64);
  Py_VISIT(traverse_module_state->__pyx_tuple__67);
  Py_VISIT(traverse_module_state->__pyx_tuple__69);
  Py_VISIT(traverse_module_state->__pyx_tuple__71);
  Py_VISIT(traverse_module_state->__pyx_tuple__73);
  Py_VISIT(traverse_module_state->__pyx_tuple__75);
  Py_VISIT(traverse_module_state->__pyx_tuple__82);
  Py_VISIT(traverse_module_state->__pyx_tuple__85);
  Py_VISIT(traverse_module_state->__pyx_tuple__87);
  Py_VISIT(traverse_module_state->__pyx_tuple__89);
  Py_VISIT(traverse_module_state->__pyx_tuple__96);
  Py_VISIT(traverse_module_state->__pyx_tuple__98);
  Py_VISIT(traverse_module_state->__pyx_tuple__100);
  Py_VISIT(traverse_module_state->__pyx_tuple__105);
  Py_VISIT(traverse_module_state->__pyx_tuple__109);
  Py_VISIT(traverse_module_state->__pyx_tuple__111);
  Py_VISIT(traverse_module_state->__pyx_tuple__114);
  Py_VISIT(traverse_module_state->__pyx_tuple__119);
  Py_VISIT(traverse_module_state->__pyx_tuple__121);
  Py_VISIT(traverse_module_state->__pyx_tuple__128);
  Py_VISIT(traverse_module_state->__pyx_codeobj__22);
  Py_VISIT(traverse_module_state->__pyx_codeobj__26);
  Py_VISIT(traverse_module_state->__pyx_codeobj__27);
  Py_VISIT(traverse_module_state->__pyx_codeobj__29);
  Py_VISIT(traverse_module_state->__pyx_codeobj__30);
  Py_VISIT(traverse_module_state->__pyx_codeobj__31);
  Py_VISIT(traverse_module_state->__pyx_codeobj__32);
  Py_VISIT(traverse_module_state->__pyx_codeobj__33);
  Py_VISIT(traverse_module_state->__pyx_codeobj__35);
  Py_VISIT(traverse_module_state->__pyx_codeobj__37);
  Py_VISIT(traverse_module_state->__pyx_codeobj__39);
  Py_VISIT(traverse_module_state->__pyx_codeobj__41);
  Py_VISIT(traverse_module_state->__pyx_codeobj__43);
  Py_VISIT(traverse_module_state->__pyx_codeobj__45);
  Py_VISIT(traverse_module_state->__pyx_codeobj__47);
  Py_VISIT(traverse_module_state->__pyx_codeobj__50);
  Py_VISIT(traverse_module_state->__pyx_codeobj__51);
  Py_VISIT(traverse_module_state->__pyx_codeobj__52);
  Py_VISIT(traverse_module_state->__pyx_codeobj__53);
  Py_VISIT(traverse_module_state->__pyx_codeobj__54);
  Py_VISIT(traverse_module_state->__pyx_codeobj__55);
  Py_VISIT(traverse_module_state->__pyx_codeobj__56);
  Py_VISIT(traverse_module_state->__pyx_codeobj__58);
  Py_VISIT(traverse_module_state->__pyx_codeobj__59);
  Py_VISIT(traverse_module_state->__pyx_codeobj__61);
  Py_VISIT(traverse_module_state->__pyx_codeobj__62);
  Py_VISIT(traverse_module_state->__pyx_codeobj__63);
  Py_VISIT(traverse_module_state->__pyx_codeobj__65);
  Py_VISIT(traverse_module_state->__pyx_codeobj__66);
  Py_VISIT(traverse_module_state->__pyx_codeobj__68);
  Py_VISIT(traverse_module_state->__pyx_codeobj__70);
  Py_VISIT(traverse_module_state->__pyx_codeobj__72);
  Py_VISIT(traverse_module_state->__pyx_codeobj__74);
  Py_VISIT(traverse_module_state->__pyx_codeobj__76);
  Py_VISIT(traverse_module_state->__pyx_codeobj__77);
  Py_VISIT(traverse_module_state->__pyx_codeobj__78);
  Py_VISIT(traverse_module_state->__pyx_codeobj__79);
  Py_VISIT(traverse_module_state->__pyx_codeobj__80);
  Py_VISIT(traverse_module_state->__pyx_codeobj__81);
  Py_VISIT(traverse_module_state->__pyx_codeobj__83);
  Py_VISIT(traverse_module_state->__pyx_codeobj__84);
  Py_VISIT(traverse_module_state->__pyx_codeobj__86);
  Py_VISIT(traverse_module_state->__pyx_codeobj__88);
  Py_VISIT(traverse_module_state->__pyx_codeobj__90);
  Py_VISIT(traverse_module_state->__pyx_codeobj__91);
  Py_VISIT(traverse_module_state->__pyx_codeobj__92);
  Py_VISIT(traverse_module_state->__pyx_codeobj__93);
  Py_VISIT(traverse_module_state->__pyx_codeobj__94);
  Py_VISIT(traverse_module_state->__pyx_codeobj__95);
  Py_VISIT(traverse_module_state->__pyx_codeobj__97);
  Py_VISIT(traverse_module_state->__pyx_codeobj__99);
  Py_VISIT(traverse_module_state->__pyx_codeobj__101);
  Py_VISIT(traverse_module_state->__pyx_codeobj__102);
  Py_VISIT(traverse_module_state->__pyx_codeobj__103);
  Py_VISIT(traverse_module_state->__pyx_codeobj__104);
  Py_VISIT(traverse_module_state->__pyx_codeobj__106);
  Py_VISIT(traverse_module_state->__pyx_codeobj__107);
  Py_VISIT(traverse_module_state->__pyx_codeobj__108);
  Py_VISIT(traverse_module_state->__pyx_codeobj__110);
  Py_VISIT(traverse_module_state->__pyx_codeobj__112);
  Py_VISIT(traverse_module_state->__pyx_codeobj__113);
  Py_VISIT(traverse_module_state->__pyx_codeobj__115);
  Py_VISIT(traverse_module_state->__pyx_codeobj__116);
  Py_VISIT(traverse_module_state->__pyx_codeobj__117);
  Py_VISIT(traverse_module_state->__pyx_codeobj__118);
  Py_VISIT(traverse_module_state->__pyx_codeobj__120);
  Py_VISIT(traverse_module_state->__pyx_codeobj__122);
  Py_VISIT(traverse_module_state->__pyx_codeobj__123);
  Py_VISIT(traverse_module_state->__pyx_codeobj__124);
  Py_VISIT(traverse_module_state->__pyx_codeobj__125);
  Py_VISIT(traverse_module_state->__pyx_codeobj__126);
  Py_VISIT(traverse_module_state->__pyx_codeobj__127);
  Py_VISIT(traverse_module_state->__pyx_codeobj__129);
  return 0;
}
#endif
/* #### Code section: module_state_defines ### */
#if CYTHON_USE_MODULE_STATE
#define __pyx_d __pyx_mstate_global->__pyx_d
#define __pyx_b __pyx_mstate_global->__pyx_b
#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
#ifdef __Pyx_CyFunction_USED
#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
#endif
#ifdef __Pyx_FusedFunction_USED
#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
#endif
#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
#define __pyx_ptype_9psycopg_c_2pq_PGconn __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn
#define __pyx_type_9psycopg_c_2pq_PGconn __pyx_mstate_global->__pyx_type_9psycopg_c_2pq_PGconn
#define __pyx_ptype_9psycopg_c_2pq_PGresult __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult
#define __pyx_type_9psycopg_c_2pq_PGresult __pyx_mstate_global->__pyx_type_9psycopg_c_2pq_PGresult
#define __pyx_ptype_9psycopg_c_2pq_PGcancel __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancel
#define __pyx_type_9psycopg_c_2pq_PGcancel __pyx_mstate_global->__pyx_type_9psycopg_c_2pq_PGcancel
#define __pyx_ptype_9psycopg_c_2pq_Escaping __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping
#define __pyx_type_9psycopg_c_2pq_Escaping __pyx_mstate_global->__pyx_type_9psycopg_c_2pq_Escaping
#define __pyx_ptype_9psycopg_c_2pq_PQBuffer __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PQBuffer
#define __pyx_type_9psycopg_c_2pq_PQBuffer __pyx_mstate_global->__pyx_type_9psycopg_c_2pq_PQBuffer
#define __pyx_ptype_9psycopg_c_2pq_ViewBuffer __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_ViewBuffer
#define __pyx_type_9psycopg_c_2pq_ViewBuffer __pyx_mstate_global->__pyx_type_9psycopg_c_2pq_ViewBuffer
#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
#define __pyx_n_s_Conninfo __pyx_mstate_global->__pyx_n_s_Conninfo
#define __pyx_n_s_ConninfoOption __pyx_mstate_global->__pyx_n_s_ConninfoOption
#define __pyx_n_s_Conninfo___repr __pyx_mstate_global->__pyx_n_s_Conninfo___repr
#define __pyx_n_s_Conninfo_get_defaults __pyx_mstate_global->__pyx_n_s_Conninfo_get_defaults
#define __pyx_n_s_Conninfo_parse __pyx_mstate_global->__pyx_n_s_Conninfo_parse
#define __pyx_n_s_Escaping __pyx_mstate_global->__pyx_n_s_Escaping
#define __pyx_n_s_Escaping___reduce_cython __pyx_mstate_global->__pyx_n_s_Escaping___reduce_cython
#define __pyx_n_s_Escaping___setstate_cython __pyx_mstate_global->__pyx_n_s_Escaping___setstate_cython
#define __pyx_n_s_Escaping_escape_bytea __pyx_mstate_global->__pyx_n_s_Escaping_escape_bytea
#define __pyx_n_s_Escaping_escape_identifier __pyx_mstate_global->__pyx_n_s_Escaping_escape_identifier
#define __pyx_n_s_Escaping_escape_literal __pyx_mstate_global->__pyx_n_s_Escaping_escape_literal
#define __pyx_n_s_Escaping_escape_string __pyx_mstate_global->__pyx_n_s_Escaping_escape_string
#define __pyx_n_s_Escaping_unescape_bytea __pyx_mstate_global->__pyx_n_s_Escaping_unescape_bytea
#define __pyx_n_s_ExecStatus __pyx_mstate_global->__pyx_n_s_ExecStatus
#define __pyx_n_s_Format __pyx_mstate_global->__pyx_n_s_Format
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
#define __pyx_n_s_Iterator __pyx_mstate_global->__pyx_n_s_Iterator
#define __pyx_kp_s_List_ConninfoOption __pyx_mstate_global->__pyx_kp_s_List_ConninfoOption
#define __pyx_kp_s_List_PGresAttDesc __pyx_mstate_global->__pyx_kp_s_List_PGresAttDesc
#define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
#define __pyx_n_s_None __pyx_mstate_global->__pyx_n_s_None
#define __pyx_n_s_NotSupportedError __pyx_mstate_global->__pyx_n_s_NotSupportedError
#define __pyx_n_s_OperationalError __pyx_mstate_global->__pyx_n_s_OperationalError
#define __pyx_kp_s_Optional_PGresult __pyx_mstate_global->__pyx_kp_s_Optional_PGresult
#define __pyx_kp_s_Optional_Sequence_Optional_bytes __pyx_mstate_global->__pyx_kp_s_Optional_Sequence_Optional_bytes
#define __pyx_kp_s_Optional_Sequence_bytes __pyx_mstate_global->__pyx_kp_s_Optional_Sequence_bytes
#define __pyx_kp_s_Optional_Sequence_int __pyx_mstate_global->__pyx_kp_s_Optional_Sequence_int
#define __pyx_kp_s_Optional_bytes __pyx_mstate_global->__pyx_kp_s_Optional_bytes
#define __pyx_n_s_PGcancel __pyx_mstate_global->__pyx_n_s_PGcancel
#define __pyx_n_s_PGcancel___reduce_cython __pyx_mstate_global->__pyx_n_s_PGcancel___reduce_cython
#define __pyx_n_s_PGcancel___setstate_cython __pyx_mstate_global->__pyx_n_s_PGcancel___setstate_cython
#define __pyx_n_s_PGcancel_cancel __pyx_mstate_global->__pyx_n_s_PGcancel_cancel
#define __pyx_n_s_PGcancel_free __pyx_mstate_global->__pyx_n_s_PGcancel_free
#define __pyx_n_s_PGconn __pyx_mstate_global->__pyx_n_s_PGconn
#define __pyx_n_s_PGconn___reduce_cython __pyx_mstate_global->__pyx_n_s_PGconn___reduce_cython
#define __pyx_n_s_PGconn___setstate_cython __pyx_mstate_global->__pyx_n_s_PGconn___setstate_cython
#define __pyx_n_s_PGconn_connect __pyx_mstate_global->__pyx_n_s_PGconn_connect
#define __pyx_n_s_PGconn_connect_poll __pyx_mstate_global->__pyx_n_s_PGconn_connect_poll
#define __pyx_n_s_PGconn_connect_start __pyx_mstate_global->__pyx_n_s_PGconn_connect_start
#define __pyx_n_s_PGconn_consume_input __pyx_mstate_global->__pyx_n_s_PGconn_consume_input
#define __pyx_n_s_PGconn_describe_portal __pyx_mstate_global->__pyx_n_s_PGconn_describe_portal
#define __pyx_n_s_PGconn_describe_prepared __pyx_mstate_global->__pyx_n_s_PGconn_describe_prepared
#define __pyx_n_s_PGconn_encrypt_password __pyx_mstate_global->__pyx_n_s_PGconn_encrypt_password
#define __pyx_n_s_PGconn_enter_pipeline_mode __pyx_mstate_global->__pyx_n_s_PGconn_enter_pipeline_mode
#define __pyx_n_s_PGconn_exec __pyx_mstate_global->__pyx_n_s_PGconn_exec
#define __pyx_n_s_PGconn_exec_params __pyx_mstate_global->__pyx_n_s_PGconn_exec_params
#define __pyx_n_s_PGconn_exec_prepared __pyx_mstate_global->__pyx_n_s_PGconn_exec_prepared
#define __pyx_n_s_PGconn_exit_pipeline_mode __pyx_mstate_global->__pyx_n_s_PGconn_exit_pipeline_mode
#define __pyx_n_s_PGconn_finish __pyx_mstate_global->__pyx_n_s_PGconn_finish
#define __pyx_n_s_PGconn_flush __pyx_mstate_global->__pyx_n_s_PGconn_flush
#define __pyx_n_s_PGconn_get_cancel __pyx_mstate_global->__pyx_n_s_PGconn_get_cancel
#define __pyx_n_s_PGconn_get_copy_data __pyx_mstate_global->__pyx_n_s_PGconn_get_copy_data
#define __pyx_n_s_PGconn_get_result __pyx_mstate_global->__pyx_n_s_PGconn_get_result
#define __pyx_n_s_PGconn_is_busy __pyx_mstate_global->__pyx_n_s_PGconn_is_busy
#define __pyx_n_s_PGconn_make_empty_result __pyx_mstate_global->__pyx_n_s_PGconn_make_empty_result
#define __pyx_n_s_PGconn_notifies __pyx_mstate_global->__pyx_n_s_PGconn_notifies
#define __pyx_n_s_PGconn_parameter_status __pyx_mstate_global->__pyx_n_s_PGconn_parameter_status
#define __pyx_n_s_PGconn_ping __pyx_mstate_global->__pyx_n_s_PGconn_ping
#define __pyx_n_s_PGconn_pipeline_sync __pyx_mstate_global->__pyx_n_s_PGconn_pipeline_sync
#define __pyx_n_s_PGconn_prepare __pyx_mstate_global->__pyx_n_s_PGconn_prepare
#define __pyx_n_s_PGconn_put_copy_data __pyx_mstate_global->__pyx_n_s_PGconn_put_copy_data
#define __pyx_n_s_PGconn_put_copy_end __pyx_mstate_global->__pyx_n_s_PGconn_put_copy_end
#define __pyx_n_s_PGconn_reset __pyx_mstate_global->__pyx_n_s_PGconn_reset
#define __pyx_n_s_PGconn_reset_poll __pyx_mstate_global->__pyx_n_s_PGconn_reset_poll
#define __pyx_n_s_PGconn_reset_start __pyx_mstate_global->__pyx_n_s_PGconn_reset_start
#define __pyx_n_s_PGconn_send_describe_portal __pyx_mstate_global->__pyx_n_s_PGconn_send_describe_portal
#define __pyx_n_s_PGconn_send_describe_prepared __pyx_mstate_global->__pyx_n_s_PGconn_send_describe_prepared
#define __pyx_n_s_PGconn_send_flush_request __pyx_mstate_global->__pyx_n_s_PGconn_send_flush_request
#define __pyx_n_s_PGconn_send_prepare __pyx_mstate_global->__pyx_n_s_PGconn_send_prepare
#define __pyx_n_s_PGconn_send_query __pyx_mstate_global->__pyx_n_s_PGconn_send_query
#define __pyx_n_s_PGconn_send_query_params __pyx_mstate_global->__pyx_n_s_PGconn_send_query_params
#define __pyx_n_s_PGconn_send_query_prepared __pyx_mstate_global->__pyx_n_s_PGconn_send_query_prepared
#define __pyx_n_s_PGconn_set_single_row_mode __pyx_mstate_global->__pyx_n_s_PGconn_set_single_row_mode
#define __pyx_n_s_PGnotify __pyx_mstate_global->__pyx_n_s_PGnotify
#define __pyx_n_s_PGresAttDesc __pyx_mstate_global->__pyx_n_s_PGresAttDesc
#define __pyx_n_s_PGresult __pyx_mstate_global->__pyx_n_s_PGresult
#define __pyx_n_s_PGresult___reduce_cython __pyx_mstate_global->__pyx_n_s_PGresult___reduce_cython
#define __pyx_n_s_PGresult___setstate_cython __pyx_mstate_global->__pyx_n_s_PGresult___setstate_cython
#define __pyx_n_s_PGresult_clear __pyx_mstate_global->__pyx_n_s_PGresult_clear
#define __pyx_n_s_PGresult_error_field __pyx_mstate_global->__pyx_n_s_PGresult_error_field
#define __pyx_n_s_PGresult_fformat __pyx_mstate_global->__pyx_n_s_PGresult_fformat
#define __pyx_n_s_PGresult_fmod __pyx_mstate_global->__pyx_n_s_PGresult_fmod
#define __pyx_n_s_PGresult_fname __pyx_mstate_global->__pyx_n_s_PGresult_fname
#define __pyx_n_s_PGresult_fsize __pyx_mstate_global->__pyx_n_s_PGresult_fsize
#define __pyx_n_s_PGresult_ftable __pyx_mstate_global->__pyx_n_s_PGresult_ftable
#define __pyx_n_s_PGresult_ftablecol __pyx_mstate_global->__pyx_n_s_PGresult_ftablecol
#define __pyx_n_s_PGresult_ftype __pyx_mstate_global->__pyx_n_s_PGresult_ftype
#define __pyx_n_s_PGresult_get_value __pyx_mstate_global->__pyx_n_s_PGresult_get_value
#define __pyx_n_s_PGresult_param_type __pyx_mstate_global->__pyx_n_s_PGresult_param_type
#define __pyx_n_s_PGresult_set_attributes __pyx_mstate_global->__pyx_n_s_PGresult_set_attributes
#define __pyx_n_s_PQBuffer __pyx_mstate_global->__pyx_n_s_PQBuffer
#define __pyx_n_s_PQBuffer___reduce_cython __pyx_mstate_global->__pyx_n_s_PQBuffer___reduce_cython
#define __pyx_n_s_PQBuffer___setstate_cython __pyx_mstate_global->__pyx_n_s_PQBuffer___setstate_cython
#define __pyx_kp_u_PQencryptPasswordConn_requires_l __pyx_mstate_global->__pyx_kp_u_PQencryptPasswordConn_requires_l
#define __pyx_kp_u_PQenterPipelineMode_requires_lib __pyx_mstate_global->__pyx_kp_u_PQenterPipelineMode_requires_lib
#define __pyx_kp_u_PQexitPipelineMode_requires_libp __pyx_mstate_global->__pyx_kp_u_PQexitPipelineMode_requires_libp
#define __pyx_kp_u_PQhostaddr_requires_libpq_from_P __pyx_mstate_global->__pyx_kp_u_PQhostaddr_requires_libpq_from_P
#define __pyx_kp_u_PQpipelineSync_requires_libpq_fr __pyx_mstate_global->__pyx_kp_u_PQpipelineSync_requires_libpq_fr
#define __pyx_kp_u_PQsendFlushRequest_requires_libp __pyx_mstate_global->__pyx_kp_u_PQsendFlushRequest_requires_libp
#define __pyx_kp_u_PQsetResultAttrs_failed __pyx_mstate_global->__pyx_kp_u_PQsetResultAttrs_failed
#define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
#define __pyx_n_s_PipelineStatus __pyx_mstate_global->__pyx_n_s_PipelineStatus
#define __pyx_n_s_PqFormat __pyx_mstate_global->__pyx_n_s_PqFormat
#define __pyx_n_s_TEXT __pyx_mstate_global->__pyx_n_s_TEXT
#define __pyx_kp_s_Tuple_int_memoryview __pyx_mstate_global->__pyx_kp_s_Tuple_int_memoryview
#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
#define __pyx_n_s_ViewBuffer __pyx_mstate_global->__pyx_n_s_ViewBuffer
#define __pyx_n_s_ViewBuffer___reduce_cython __pyx_mstate_global->__pyx_n_s_ViewBuffer___reduce_cython
#define __pyx_n_s_ViewBuffer___setstate_cython __pyx_mstate_global->__pyx_n_s_ViewBuffer___setstate_cython
#define __pyx_kp_b__12 __pyx_mstate_global->__pyx_kp_b__12
#define __pyx_n_s__130 __pyx_mstate_global->__pyx_n_s__130
#define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14
#define __pyx_kp_u__17 __pyx_mstate_global->__pyx_kp_u__17
#define __pyx_kp_u__18 __pyx_mstate_global->__pyx_kp_u__18
#define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19
#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2
#define __pyx_kp_u__20 __pyx_mstate_global->__pyx_kp_u__20
#define __pyx_n_s__23 __pyx_mstate_global->__pyx_n_s__23
#define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3
#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4
#define __pyx_n_s_algorithm __pyx_mstate_global->__pyx_n_s_algorithm
#define __pyx_n_u_ascii __pyx_mstate_global->__pyx_n_u_ascii
#define __pyx_n_s_async __pyx_mstate_global->__pyx_n_s_async
#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
#define __pyx_kp_u_at_0x __pyx_mstate_global->__pyx_kp_u_at_0x
#define __pyx_kp_u_at_0x_2 __pyx_mstate_global->__pyx_kp_u_at_0x_2
#define __pyx_n_s_attrs __pyx_mstate_global->__pyx_n_s_attrs
#define __pyx_n_s_atttypmod __pyx_mstate_global->__pyx_n_s_atttypmod
#define __pyx_n_s_atypes __pyx_mstate_global->__pyx_n_s_atypes
#define __pyx_kp_u_available_instead __pyx_mstate_global->__pyx_kp_u_available_instead
#define __pyx_n_s_buf __pyx_mstate_global->__pyx_n_s_buf
#define __pyx_n_s_buffer __pyx_mstate_global->__pyx_n_s_buffer
#define __pyx_n_s_buffer_ptr __pyx_mstate_global->__pyx_n_s_buffer_ptr
#define __pyx_n_s_build_version __pyx_mstate_global->__pyx_n_s_build_version
#define __pyx_kp_u_bytes __pyx_mstate_global->__pyx_kp_u_bytes
#define __pyx_n_s_bytes_2 __pyx_mstate_global->__pyx_n_s_bytes_2
#define __pyx_kp_u_bytes_or_buffer_expected_got __pyx_mstate_global->__pyx_kp_u_bytes_or_buffer_expected_got
#define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c
#define __pyx_n_s_calgo __pyx_mstate_global->__pyx_n_s_calgo
#define __pyx_n_s_cancel __pyx_mstate_global->__pyx_n_s_cancel
#define __pyx_kp_u_cancel_failed __pyx_mstate_global->__pyx_kp_u_cancel_failed
#define __pyx_n_s_cbuffer __pyx_mstate_global->__pyx_n_s_cbuffer
#define __pyx_n_s_ccol __pyx_mstate_global->__pyx_n_s_ccol
#define __pyx_n_s_cerr __pyx_mstate_global->__pyx_n_s_cerr
#define __pyx_n_s_cformats __pyx_mstate_global->__pyx_n_s_cformats
#define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
#define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear
#define __pyx_n_s_clengths __pyx_mstate_global->__pyx_n_s_clengths
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
#define __pyx_n_s_cls __pyx_mstate_global->__pyx_n_s_cls
#define __pyx_n_s_cnparams __pyx_mstate_global->__pyx_n_s_cnparams
#define __pyx_n_s_column_number __pyx_mstate_global->__pyx_n_s_column_number
#define __pyx_n_s_columnid __pyx_mstate_global->__pyx_n_s_columnid
#define __pyx_n_s_command __pyx_mstate_global->__pyx_n_s_command
#define __pyx_n_s_compiled __pyx_mstate_global->__pyx_n_s_compiled
#define __pyx_n_s_conn __pyx_mstate_global->__pyx_n_s_conn
#define __pyx_n_s_connect __pyx_mstate_global->__pyx_n_s_connect
#define __pyx_n_s_connect_poll __pyx_mstate_global->__pyx_n_s_connect_poll
#define __pyx_n_s_connect_start __pyx_mstate_global->__pyx_n_s_connect_start
#define __pyx_kp_u_connection_not_in_pipeline_mode __pyx_mstate_global->__pyx_kp_u_connection_not_in_pipeline_mode
#define __pyx_n_s_connection_summary __pyx_mstate_global->__pyx_n_s_connection_summary
#define __pyx_n_s_conninfo __pyx_mstate_global->__pyx_n_s_conninfo
#define __pyx_n_s_consume_input __pyx_mstate_global->__pyx_n_s_consume_input
#define __pyx_kp_u_consuming_input_failed __pyx_mstate_global->__pyx_kp_u_consuming_input_failed
#define __pyx_kp_u_couldn_t_allocate_PGconn __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_PGconn
#define __pyx_kp_u_couldn_t_allocate_PGresult __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_PGresult
#define __pyx_kp_u_couldn_t_allocate_connection_def __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_connection_def
#define __pyx_kp_u_couldn_t_allocate_connection_inf __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_connection_inf
#define __pyx_kp_u_couldn_t_allocate_empty_PGresult __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_empty_PGresult
#define __pyx_kp_u_couldn_t_allocate_for_escape_byt __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_for_escape_byt
#define __pyx_kp_u_couldn_t_allocate_for_unescape_b __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_for_unescape_b
#define __pyx_kp_u_couldn_t_allocate_on_conninfo_pa __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_on_conninfo_pa
#define __pyx_kp_u_couldn_t_create_cancel_object __pyx_mstate_global->__pyx_kp_u_couldn_t_create_cancel_object
#define __pyx_kp_u_couldn_t_reset_connection __pyx_mstate_global->__pyx_kp_u_couldn_t_reset_connection
#define __pyx_n_s_crow __pyx_mstate_global->__pyx_n_s_crow
#define __pyx_n_s_ctypes __pyx_mstate_global->__pyx_n_s_ctypes
#define __pyx_n_s_cvalues __pyx_mstate_global->__pyx_n_s_cvalues
#define __pyx_n_u_d __pyx_mstate_global->__pyx_n_u_d
#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data
#define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode
#define __pyx_n_s_descr __pyx_mstate_global->__pyx_n_s_descr
#define __pyx_n_s_describe_portal __pyx_mstate_global->__pyx_n_s_describe_portal
#define __pyx_n_s_describe_prepared __pyx_mstate_global->__pyx_n_s_describe_prepared
#define __pyx_n_s_descriptions __pyx_mstate_global->__pyx_n_s_descriptions
#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2
#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
#define __pyx_n_s_dispchar __pyx_mstate_global->__pyx_n_s_dispchar
#define __pyx_n_s_dispsize __pyx_mstate_global->__pyx_n_s_dispsize
#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
#define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e
#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
#define __pyx_n_s_encrypt_password __pyx_mstate_global->__pyx_n_s_encrypt_password
#define __pyx_n_s_enter_pipeline_mode __pyx_mstate_global->__pyx_n_s_enter_pipeline_mode
#define __pyx_n_s_envvar __pyx_mstate_global->__pyx_n_s_envvar
#define __pyx_n_s_errmsg __pyx_mstate_global->__pyx_n_s_errmsg
#define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
#define __pyx_n_s_error_field __pyx_mstate_global->__pyx_n_s_error_field
#define __pyx_kp_u_error_in_notice_receiver_s __pyx_mstate_global->__pyx_kp_u_error_in_notice_receiver_s
#define __pyx_n_s_error_message __pyx_mstate_global->__pyx_n_s_error_message
#define __pyx_n_s_errors __pyx_mstate_global->__pyx_n_s_errors
#define __pyx_n_s_escape_bytea __pyx_mstate_global->__pyx_n_s_escape_bytea
#define __pyx_n_s_escape_identifier __pyx_mstate_global->__pyx_n_s_escape_identifier
#define __pyx_kp_u_escape_identifier_failed __pyx_mstate_global->__pyx_kp_u_escape_identifier_failed
#define __pyx_kp_u_escape_identifier_failed_no_conn __pyx_mstate_global->__pyx_kp_u_escape_identifier_failed_no_conn
#define __pyx_n_s_escape_literal __pyx_mstate_global->__pyx_n_s_escape_literal
#define __pyx_kp_u_escape_literal_failed __pyx_mstate_global->__pyx_kp_u_escape_literal_failed
#define __pyx_kp_u_escape_literal_failed_no_connect __pyx_mstate_global->__pyx_kp_u_escape_literal_failed_no_connect
#define __pyx_n_s_escape_string __pyx_mstate_global->__pyx_n_s_escape_string
#define __pyx_kp_u_escape_string_failed __pyx_mstate_global->__pyx_kp_u_escape_string_failed
#define __pyx_n_s_exc __pyx_mstate_global->__pyx_n_s_exc
#define __pyx_n_s_exception __pyx_mstate_global->__pyx_n_s_exception
#define __pyx_n_s_exec __pyx_mstate_global->__pyx_n_s_exec
#define __pyx_n_s_exec_params __pyx_mstate_global->__pyx_n_s_exec_params
#define __pyx_n_s_exec_prepared __pyx_mstate_global->__pyx_n_s_exec_prepared
#define __pyx_n_s_exec_status __pyx_mstate_global->__pyx_n_s_exec_status
#define __pyx_n_s_exit_pipeline_mode __pyx_mstate_global->__pyx_n_s_exit_pipeline_mode
#define __pyx_kp_u_failed_to_enter_pipeline_mode __pyx_mstate_global->__pyx_kp_u_failed_to_enter_pipeline_mode
#define __pyx_kp_u_failed_to_sync_pipeline __pyx_mstate_global->__pyx_kp_u_failed_to_sync_pipeline
#define __pyx_n_s_fformat __pyx_mstate_global->__pyx_n_s_fformat
#define __pyx_n_s_fieldcode __pyx_mstate_global->__pyx_n_s_fieldcode
#define __pyx_n_s_finish __pyx_mstate_global->__pyx_n_s_finish
#define __pyx_n_s_flush __pyx_mstate_global->__pyx_n_s_flush
#define __pyx_kp_u_flush_request_failed __pyx_mstate_global->__pyx_kp_u_flush_request_failed
#define __pyx_kp_u_flushing_failed __pyx_mstate_global->__pyx_kp_u_flushing_failed
#define __pyx_kp_u_flushing_failed_the_connection_i __pyx_mstate_global->__pyx_kp_u_flushing_failed_the_connection_i
#define __pyx_n_s_fmod __pyx_mstate_global->__pyx_n_s_fmod
#define __pyx_n_s_fname __pyx_mstate_global->__pyx_n_s_fname
#define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
#define __pyx_n_s_free __pyx_mstate_global->__pyx_n_s_free
#define __pyx_n_s_fsize __pyx_mstate_global->__pyx_n_s_fsize
#define __pyx_n_s_ftable __pyx_mstate_global->__pyx_n_s_ftable
#define __pyx_n_s_ftablecol __pyx_mstate_global->__pyx_n_s_ftablecol
#define __pyx_n_s_ftype __pyx_mstate_global->__pyx_n_s_ftype
#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
#define __pyx_n_s_getLogger __pyx_mstate_global->__pyx_n_s_getLogger
#define __pyx_n_s_get_cancel __pyx_mstate_global->__pyx_n_s_get_cancel
#define __pyx_n_s_get_copy_data __pyx_mstate_global->__pyx_n_s_get_copy_data
#define __pyx_n_s_get_defaults __pyx_mstate_global->__pyx_n_s_get_defaults
#define __pyx_n_s_get_result __pyx_mstate_global->__pyx_n_s_get_result
#define __pyx_n_s_get_value __pyx_mstate_global->__pyx_n_s_get_value
#define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
#define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got
#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
#define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
#define __pyx_n_s_impl __pyx_mstate_global->__pyx_n_s_impl
#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
#define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int
#define __pyx_n_s_is_busy __pyx_mstate_global->__pyx_n_s_is_busy
#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
#define __pyx_n_s_keyword __pyx_mstate_global->__pyx_n_s_keyword
#define __pyx_n_s_label __pyx_mstate_global->__pyx_n_s_label
#define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length
#define __pyx_n_s_logger __pyx_mstate_global->__pyx_n_s_logger
#define __pyx_n_s_logging __pyx_mstate_global->__pyx_n_s_logging
#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
#define __pyx_n_s_make_empty_result __pyx_mstate_global->__pyx_n_s_make_empty_result
#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
#define __pyx_n_s_nbytes __pyx_mstate_global->__pyx_n_s_nbytes
#define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
#define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
#define __pyx_n_s_notifies __pyx_mstate_global->__pyx_n_s_notifies
#define __pyx_n_s_nparams __pyx_mstate_global->__pyx_n_s_nparams
#define __pyx_n_s_num __pyx_mstate_global->__pyx_n_s_num
#define __pyx_n_s_opts __pyx_mstate_global->__pyx_n_s_opts
#define __pyx_n_s_out __pyx_mstate_global->__pyx_n_s_out
#define __pyx_n_s_param_formats __pyx_mstate_global->__pyx_n_s_param_formats
#define __pyx_kp_u_param_formats_2 __pyx_mstate_global->__pyx_kp_u_param_formats_2
#define __pyx_n_s_param_number __pyx_mstate_global->__pyx_n_s_param_number
#define __pyx_n_s_param_type __pyx_mstate_global->__pyx_n_s_param_type
#define __pyx_n_s_param_types __pyx_mstate_global->__pyx_n_s_param_types
#define __pyx_kp_u_param_types_2 __pyx_mstate_global->__pyx_kp_u_param_types_2
#define __pyx_n_s_param_values __pyx_mstate_global->__pyx_n_s_param_values
#define __pyx_kp_u_param_values_but __pyx_mstate_global->__pyx_kp_u_param_values_but
#define __pyx_n_s_parameter_status __pyx_mstate_global->__pyx_n_s_parameter_status
#define __pyx_n_s_parse __pyx_mstate_global->__pyx_n_s_parse
#define __pyx_n_s_passwd __pyx_mstate_global->__pyx_n_s_passwd
#define __pyx_kp_u_password_encryption_failed __pyx_mstate_global->__pyx_kp_u_password_encryption_failed
#define __pyx_n_s_pgconn __pyx_mstate_global->__pyx_n_s_pgconn
#define __pyx_n_s_pgresult __pyx_mstate_global->__pyx_n_s_pgresult
#define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
#define __pyx_n_s_ping __pyx_mstate_global->__pyx_n_s_ping
#define __pyx_n_s_pipeline_sync __pyx_mstate_global->__pyx_n_s_pipeline_sync
#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
#define __pyx_n_s_prepare_2 __pyx_mstate_global->__pyx_n_s_prepare_2
#define __pyx_n_s_psycopg __pyx_mstate_global->__pyx_n_s_psycopg
#define __pyx_n_u_psycopg __pyx_mstate_global->__pyx_n_u_psycopg
#define __pyx_n_s_psycopg_c_pq __pyx_mstate_global->__pyx_n_s_psycopg_c_pq
#define __pyx_kp_s_psycopg_c_pq_conninfo_pyx __pyx_mstate_global->__pyx_kp_s_psycopg_c_pq_conninfo_pyx
#define __pyx_kp_s_psycopg_c_pq_escaping_pyx __pyx_mstate_global->__pyx_kp_s_psycopg_c_pq_escaping_pyx
#define __pyx_kp_s_psycopg_c_pq_pgcancel_pyx __pyx_mstate_global->__pyx_kp_s_psycopg_c_pq_pgcancel_pyx
#define __pyx_kp_s_psycopg_c_pq_pgconn_pyx __pyx_mstate_global->__pyx_kp_s_psycopg_c_pq_pgconn_pyx
#define __pyx_kp_s_psycopg_c_pq_pgresult_pyx __pyx_mstate_global->__pyx_kp_s_psycopg_c_pq_pgresult_pyx
#define __pyx_kp_s_psycopg_c_pq_pyx __pyx_mstate_global->__pyx_kp_s_psycopg_c_pq_pyx
#define __pyx_n_s_psycopg_pq __pyx_mstate_global->__pyx_n_s_psycopg_pq
#define __pyx_n_s_psycopg_pq__enums __pyx_mstate_global->__pyx_n_s_psycopg_pq__enums
#define __pyx_n_s_psycopg_pq_misc __pyx_mstate_global->__pyx_n_s_psycopg_pq_misc
#define __pyx_n_s_ptr __pyx_mstate_global->__pyx_n_s_ptr
#define __pyx_n_s_put_copy_data __pyx_mstate_global->__pyx_n_s_put_copy_data
#define __pyx_n_s_put_copy_end __pyx_mstate_global->__pyx_n_s_put_copy_end
#define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
#define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
#define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
#define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
#define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
#define __pyx_n_s_pyx_unpickle_Escaping __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Escaping
#define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
#define __pyx_kp_u_receiving_copy_data_failed __pyx_mstate_global->__pyx_kp_u_receiving_copy_data_failed
#define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
#define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
#define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
#define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr
#define __pyx_n_s_res __pyx_mstate_global->__pyx_n_s_res
#define __pyx_n_s_reset __pyx_mstate_global->__pyx_n_s_reset
#define __pyx_n_s_reset_poll __pyx_mstate_global->__pyx_n_s_reset_poll
#define __pyx_n_s_reset_start __pyx_mstate_global->__pyx_n_s_reset_start
#define __pyx_n_s_result_format __pyx_mstate_global->__pyx_n_s_result_format
#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return
#define __pyx_n_s_row_number __pyx_mstate_global->__pyx_n_s_row_number
#define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv
#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
#define __pyx_n_s_send_describe_portal __pyx_mstate_global->__pyx_n_s_send_describe_portal
#define __pyx_n_s_send_describe_prepared __pyx_mstate_global->__pyx_n_s_send_describe_prepared
#define __pyx_n_s_send_flush_request __pyx_mstate_global->__pyx_n_s_send_flush_request
#define __pyx_n_s_send_prepare __pyx_mstate_global->__pyx_n_s_send_prepare
#define __pyx_n_s_send_query __pyx_mstate_global->__pyx_n_s_send_query
#define __pyx_n_s_send_query_params __pyx_mstate_global->__pyx_n_s_send_query_params
#define __pyx_n_s_send_query_prepared __pyx_mstate_global->__pyx_n_s_send_query_prepared
#define __pyx_kp_u_sending_copy_data_failed __pyx_mstate_global->__pyx_kp_u_sending_copy_data_failed
#define __pyx_kp_u_sending_copy_end_failed __pyx_mstate_global->__pyx_kp_u_sending_copy_end_failed
#define __pyx_kp_u_sending_describe_prepared_failed __pyx_mstate_global->__pyx_kp_u_sending_describe_prepared_failed
#define __pyx_kp_u_sending_prepared_query_failed __pyx_mstate_global->__pyx_kp_u_sending_prepared_query_failed
#define __pyx_kp_u_sending_query_and_params_failed __pyx_mstate_global->__pyx_kp_u_sending_query_and_params_failed
#define __pyx_kp_u_sending_query_failed __pyx_mstate_global->__pyx_kp_u_sending_query_failed
#define __pyx_n_s_set_attributes __pyx_mstate_global->__pyx_n_s_set_attributes
#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
#define __pyx_n_s_set_single_row_mode __pyx_mstate_global->__pyx_n_s_set_single_row_mode
#define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
#define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
#define __pyx_kp_u_setting_nonblocking_failed __pyx_mstate_global->__pyx_kp_u_setting_nonblocking_failed
#define __pyx_kp_u_setting_single_row_mode_failed __pyx_mstate_global->__pyx_kp_u_setting_single_row_mode_failed
#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
#define __pyx_n_s_ssl __pyx_mstate_global->__pyx_n_s_ssl
#define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state
#define __pyx_n_s_status __pyx_mstate_global->__pyx_n_s_status
#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
#define __pyx_n_s_tableid __pyx_mstate_global->__pyx_n_s_tableid
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
#define __pyx_kp_u_the_connection_is_closed __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed
#define __pyx_kp_u_the_connection_is_lost __pyx_mstate_global->__pyx_kp_u_the_connection_is_lost
#define __pyx_n_s_typid __pyx_mstate_global->__pyx_n_s_typid
#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing
#define __pyx_n_s_typlen __pyx_mstate_global->__pyx_n_s_typlen
#define __pyx_n_s_unescape_bytea __pyx_mstate_global->__pyx_n_s_unescape_bytea
#define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
#define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate
#define __pyx_n_s_user __pyx_mstate_global->__pyx_n_s_user
#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v
#define __pyx_n_s_val __pyx_mstate_global->__pyx_n_s_val
#define __pyx_n_s_version __pyx_mstate_global->__pyx_n_s_version
#define __pyx_n_u_x __pyx_mstate_global->__pyx_n_u_x
#define __pyx_int_8405287 __pyx_mstate_global->__pyx_int_8405287
#define __pyx_int_12701922 __pyx_mstate_global->__pyx_int_12701922
#define __pyx_int_59804213 __pyx_mstate_global->__pyx_int_59804213
#define __pyx_k__8 __pyx_mstate_global->__pyx_k__8
#define __pyx_k__9 __pyx_mstate_global->__pyx_k__9
#define __pyx_k__10 __pyx_mstate_global->__pyx_k__10
#define __pyx_k__11 __pyx_mstate_global->__pyx_k__11
#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7
#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13
#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25
#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34
#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36
#define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38
#define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40
#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42
#define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44
#define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46
#define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48
#define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49
#define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57
#define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60
#define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64
#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67
#define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69
#define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71
#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73
#define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75
#define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82
#define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85
#define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87
#define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89
#define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96
#define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98
#define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100
#define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105
#define __pyx_tuple__109 __pyx_mstate_global->__pyx_tuple__109
#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111
#define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114
#define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119
#define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121
#define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128
#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22
#define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26
#define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27
#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29
#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30
#define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31
#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32
#define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33
#define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35
#define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37
#define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39
#define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41
#define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43
#define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45
#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47
#define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50
#define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51
#define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52
#define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53
#define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54
#define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55
#define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56
#define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58
#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59
#define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61
#define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62
#define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63
#define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65
#define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66
#define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68
#define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70
#define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72
#define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74
#define __pyx_codeobj__76 __pyx_mstate_global->__pyx_codeobj__76
#define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77
#define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78
#define __pyx_codeobj__79 __pyx_mstate_global->__pyx_codeobj__79
#define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80
#define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81
#define __pyx_codeobj__83 __pyx_mstate_global->__pyx_codeobj__83
#define __pyx_codeobj__84 __pyx_mstate_global->__pyx_codeobj__84
#define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86
#define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88
#define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90
#define __pyx_codeobj__91 __pyx_mstate_global->__pyx_codeobj__91
#define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92
#define __pyx_codeobj__93 __pyx_mstate_global->__pyx_codeobj__93
#define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94
#define __pyx_codeobj__95 __pyx_mstate_global->__pyx_codeobj__95
#define __pyx_codeobj__97 __pyx_mstate_global->__pyx_codeobj__97
#define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99
#define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101
#define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102
#define __pyx_codeobj__103 __pyx_mstate_global->__pyx_codeobj__103
#define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104
#define __pyx_codeobj__106 __pyx_mstate_global->__pyx_codeobj__106
#define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107
#define __pyx_codeobj__108 __pyx_mstate_global->__pyx_codeobj__108
#define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110
#define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112
#define __pyx_codeobj__113 __pyx_mstate_global->__pyx_codeobj__113
#define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115
#define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116
#define __pyx_codeobj__117 __pyx_mstate_global->__pyx_codeobj__117
#define __pyx_codeobj__118 __pyx_mstate_global->__pyx_codeobj__118
#define __pyx_codeobj__120 __pyx_mstate_global->__pyx_codeobj__120
#define __pyx_codeobj__122 __pyx_mstate_global->__pyx_codeobj__122
#define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123
#define __pyx_codeobj__124 __pyx_mstate_global->__pyx_codeobj__124
#define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125
#define __pyx_codeobj__126 __pyx_mstate_global->__pyx_codeobj__126
#define __pyx_codeobj__127 __pyx_mstate_global->__pyx_codeobj__127
#define __pyx_codeobj__129 __pyx_mstate_global->__pyx_codeobj__129
#endif
/* #### Code section: module_code ### */

/* "psycopg_c/pq.pyx":17
 * 
 * 
 * def version():             # <<<<<<<<<<<<<<
 *     return libpq.PQlibVersion()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_1version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_1version = {"version", (PyCFunction)__pyx_pw_9psycopg_c_2pq_1version, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_1version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("version (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_version(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_version(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("version", 0);

  /* "psycopg_c/pq.pyx":18
 * 
 * def version():
 *     return libpq.PQlibVersion()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQlibVersion()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq.pyx":17
 * 
 * 
 * def version():             # <<<<<<<<<<<<<<
 *     return libpq.PQlibVersion()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":37
 * cdef class PGconn:
 *     @staticmethod
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):             # <<<<<<<<<<<<<<
 *         cdef PGconn rv = PGconn.__new__(PGconn)
 *         rv._pgconn_ptr = ptr
 */

static struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_f_9psycopg_c_2pq_6PGconn__from_ptr(PGconn *__pyx_v_ptr) {
  struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_rv = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_ptr", 0);

  /* "psycopg_c/pq/pgconn.pyx":38
 *     @staticmethod
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):
 *         cdef PGconn rv = PGconn.__new__(PGconn)             # <<<<<<<<<<<<<<
 *         rv._pgconn_ptr = ptr
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9psycopg_c_2pq_PGconn(((PyTypeObject *)__pyx_ptype_9psycopg_c_2pq_PGconn), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_rv = ((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":39
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):
 *         cdef PGconn rv = PGconn.__new__(PGconn)
 *         rv._pgconn_ptr = ptr             # <<<<<<<<<<<<<<
 * 
 *         libpq.PQsetNoticeReceiver(ptr, notice_receiver, <void *>rv)
 */
  __pyx_v_rv->_pgconn_ptr = __pyx_v_ptr;

  /* "psycopg_c/pq/pgconn.pyx":41
 *         rv._pgconn_ptr = ptr
 * 
 *         libpq.PQsetNoticeReceiver(ptr, notice_receiver, <void *>rv)             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  (void)(PQsetNoticeReceiver(__pyx_v_ptr, __pyx_f_9psycopg_c_2pq_notice_receiver, ((void *)__pyx_v_rv)));

  /* "psycopg_c/pq/pgconn.pyx":42
 * 
 *         libpq.PQsetNoticeReceiver(ptr, notice_receiver, <void *>rv)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":37
 * cdef class PGconn:
 *     @staticmethod
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):             # <<<<<<<<<<<<<<
 *         cdef PGconn rv = PGconn.__new__(PGconn)
 *         rv._pgconn_ptr = ptr
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn._from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":44
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._pgconn_ptr = NULL
 *         self._procpid = getpid()
 */

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_6PGconn_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_6PGconn_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn___cinit__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_6PGconn___cinit__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "psycopg_c/pq/pgconn.pyx":45
 * 
 *     def __cinit__(self):
 *         self._pgconn_ptr = NULL             # <<<<<<<<<<<<<<
 *         self._procpid = getpid()
 * 
 */
  __pyx_v_self->_pgconn_ptr = NULL;

  /* "psycopg_c/pq/pgconn.pyx":46
 *     def __cinit__(self):
 *         self._pgconn_ptr = NULL
 *         self._procpid = getpid()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->_procpid = getpid();

  /* "psycopg_c/pq/pgconn.pyx":44
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._pgconn_ptr = NULL
 *         self._procpid = getpid()
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":48
 *         self._procpid = getpid()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         # Close the connection only if it was created in this process,
 *         # not if this object is being GC'd after fork.
 */

/* Python wrapper */
static void __pyx_pw_9psycopg_c_2pq_6PGconn_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_9psycopg_c_2pq_6PGconn_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_9psycopg_c_2pq_6PGconn_2__dealloc__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_9psycopg_c_2pq_6PGconn_2__dealloc__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "psycopg_c/pq/pgconn.pyx":51
 *         # Close the connection only if it was created in this process,
 *         # not if this object is being GC'd after fork.
 *         if self._procpid == getpid():             # <<<<<<<<<<<<<<
 *             self.finish()
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_procpid == getpid());
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":52
 *         # not if this object is being GC'd after fork.
 *         if self._procpid == getpid():
 *             self.finish()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self) -> str:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_finish); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[1] = {__pyx_t_4, };
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "psycopg_c/pq/pgconn.pyx":51
 *         # Close the connection only if it was created in this process,
 *         # not if this object is being GC'd after fork.
 *         if self._procpid == getpid():             # <<<<<<<<<<<<<<
 *             self.finish()
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":48
 *         self._procpid = getpid()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         # Close the connection only if it was created in this process,
 *         # not if this object is being GC'd after fork.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("psycopg_c.pq.PGconn.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "psycopg_c/pq/pgconn.pyx":54
 *             self.finish()
 * 
 *     def __repr__(self) -> str:             # <<<<<<<<<<<<<<
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         info = connection_summary(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_5__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_4__repr__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_4__repr__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_v_cls = NULL;
  PyObject *__pyx_v_info = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "psycopg_c/pq/pgconn.pyx":55
 * 
 *     def __repr__(self) -> str:
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *         info = connection_summary(self)
 *         return f"<{cls} {info} at 0x{id(self):x}>"
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_module); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u_);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_qualname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cls = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":56
 *     def __repr__(self) -> str:
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         info = connection_summary(self)             # <<<<<<<<<<<<<<
 *         return f"<{cls} {info} at 0x{id(self):x}>"
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_connection_summary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self)};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_info = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":57
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         info = connection_summary(self)
 *         return f"<{cls} {info} at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u__2);
  __Pyx_INCREF(__pyx_v_cls);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_cls) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_cls) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_cls);
  __Pyx_GIVEREF(__pyx_v_cls);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_cls);
  __Pyx_INCREF(__pyx_kp_u__3);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__3);
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_info, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_at_0x);
  __pyx_t_2 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_at_0x);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_at_0x);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u__4);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":54
 *             self.finish()
 * 
 *     def __repr__(self) -> str:             # <<<<<<<<<<<<<<
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         info = connection_summary(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cls);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":59
 *         return f"<{cls} {info} at 0x{id(self):x}>"
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 */

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_pw_9psycopg_c_2pq_6PGconn_7connect(PyObject *__pyx_v_cls, PyObject *__pyx_arg_conninfo); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_7connect = {"connect", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_7connect, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_pw_9psycopg_c_2pq_6PGconn_7connect(PyObject *__pyx_v_cls, PyObject *__pyx_arg_conninfo) {
  char const *__pyx_v_conninfo;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  assert(__pyx_arg_conninfo); {
    __pyx_v_conninfo = __Pyx_PyObject_AsString(__pyx_arg_conninfo); if (unlikely((!__pyx_v_conninfo) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_6connect(((PyTypeObject*)__pyx_v_cls), ((char const *)__pyx_v_conninfo));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_pf_9psycopg_c_2pq_6PGconn_6connect(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, char const *__pyx_v_conninfo) {
  PGconn *__pyx_v_pgconn;
  struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect", 0);

  /* "psycopg_c/pq/pgconn.pyx":61
 *     @classmethod
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)             # <<<<<<<<<<<<<<
 *         if not pgconn:
 *             raise MemoryError("couldn't allocate PGconn")
 */
  __pyx_v_pgconn = PQconnectdb(__pyx_v_conninfo);

  /* "psycopg_c/pq/pgconn.pyx":62
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 *         if not pgconn:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGconn")
 * 
 */
  __pyx_t_1 = (!(__pyx_v_pgconn != 0));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":63
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 *         if not pgconn:
 *             raise MemoryError("couldn't allocate PGconn")             # <<<<<<<<<<<<<<
 * 
 *         return PGconn._from_ptr(pgconn)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 63, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":62
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 *         if not pgconn:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGconn")
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":65
 *             raise MemoryError("couldn't allocate PGconn")
 * 
 *         return PGconn._from_ptr(pgconn)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_9psycopg_c_2pq_6PGconn__from_ptr(__pyx_v_pgconn)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":59
 *         return f"<{cls} {info} at 0x{id(self):x}>"
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":67
 *         return PGconn._from_ptr(pgconn)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
 */

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_pw_9psycopg_c_2pq_6PGconn_9connect_start(PyObject *__pyx_v_cls, PyObject *__pyx_arg_conninfo); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_9connect_start = {"connect_start", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_9connect_start, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_pw_9psycopg_c_2pq_6PGconn_9connect_start(PyObject *__pyx_v_cls, PyObject *__pyx_arg_conninfo) {
  char const *__pyx_v_conninfo;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect_start (wrapper)", 0);
  assert(__pyx_arg_conninfo); {
    __pyx_v_conninfo = __Pyx_PyObject_AsString(__pyx_arg_conninfo); if (unlikely((!__pyx_v_conninfo) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.connect_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_8connect_start(((PyTypeObject*)__pyx_v_cls), ((char const *)__pyx_v_conninfo));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_pf_9psycopg_c_2pq_6PGconn_8connect_start(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, char const *__pyx_v_conninfo) {
  PGconn *__pyx_v_pgconn;
  struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect_start", 0);

  /* "psycopg_c/pq/pgconn.pyx":69
 *     @classmethod
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)             # <<<<<<<<<<<<<<
 *         if not pgconn:
 *             raise MemoryError("couldn't allocate PGconn")
 */
  __pyx_v_pgconn = PQconnectStart(__pyx_v_conninfo);

  /* "psycopg_c/pq/pgconn.pyx":70
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
 *         if not pgconn:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGconn")
 * 
 */
  __pyx_t_1 = (!(__pyx_v_pgconn != 0));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":71
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
 *         if not pgconn:
 *             raise MemoryError("couldn't allocate PGconn")             # <<<<<<<<<<<<<<
 * 
 *         return PGconn._from_ptr(pgconn)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 71, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":70
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
 *         if not pgconn:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGconn")
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":73
 *             raise MemoryError("couldn't allocate PGconn")
 * 
 *         return PGconn._from_ptr(pgconn)             # <<<<<<<<<<<<<<
 * 
 *     def connect_poll(self) -> int:
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_9psycopg_c_2pq_6PGconn__from_ptr(__pyx_v_pgconn)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":67
 *         return PGconn._from_ptr(pgconn)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.connect_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":75
 *         return PGconn._from_ptr(pgconn)
 * 
 *     def connect_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_11connect_poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_11connect_poll = {"connect_poll", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_11connect_poll, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_11connect_poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect_poll (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_10connect_poll(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_10connect_poll(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect_poll", 0);

  /* "psycopg_c/pq/pgconn.pyx":76
 * 
 *     def connect_poll(self) -> int:
 *         return _call_int(self, <conn_int_f>libpq.PQconnectPoll)             # <<<<<<<<<<<<<<
 * 
 *     def finish(self) -> None:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_int(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f)PQconnectPoll)); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 76, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyInt_CheckExact(__pyx_t_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_2))) __PYX_ERR(0, 76, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":75
 *         return PGconn._from_ptr(pgconn)
 * 
 *     def connect_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.connect_poll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":78
 *         return _call_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         if self._pgconn_ptr is not NULL:
 *             libpq.PQfinish(self._pgconn_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_13finish(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_13finish = {"finish", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_13finish, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_13finish(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finish (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_12finish(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_12finish(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("finish", 0);

  /* "psycopg_c/pq/pgconn.pyx":79
 * 
 *     def finish(self) -> None:
 *         if self._pgconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQfinish(self._pgconn_ptr)
 *             self._pgconn_ptr = NULL
 */
  __pyx_t_1 = (__pyx_v_self->_pgconn_ptr != NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":80
 *     def finish(self) -> None:
 *         if self._pgconn_ptr is not NULL:
 *             libpq.PQfinish(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *             self._pgconn_ptr = NULL
 * 
 */
    PQfinish(__pyx_v_self->_pgconn_ptr);

    /* "psycopg_c/pq/pgconn.pyx":81
 *         if self._pgconn_ptr is not NULL:
 *             libpq.PQfinish(self._pgconn_ptr)
 *             self._pgconn_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __pyx_v_self->_pgconn_ptr = NULL;

    /* "psycopg_c/pq/pgconn.pyx":79
 * 
 *     def finish(self) -> None:
 *         if self._pgconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQfinish(self._pgconn_ptr)
 *             self._pgconn_ptr = NULL
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":78
 *         return _call_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         if self._pgconn_ptr is not NULL:
 *             libpq.PQfinish(self._pgconn_ptr)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":83
 *             self._pgconn_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgconn_ptr(self) -> Optional[int]:
 *         if self._pgconn_ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_10pgconn_ptr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_10pgconn_ptr_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_10pgconn_ptr___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_10pgconn_ptr___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":85
 *     @property
 *     def pgconn_ptr(self) -> Optional[int]:
 *         if self._pgconn_ptr:             # <<<<<<<<<<<<<<
 *             return <long long><void *>self._pgconn_ptr
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->_pgconn_ptr != 0);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":86
 *     def pgconn_ptr(self) -> Optional[int]:
 *         if self._pgconn_ptr:
 *             return <long long><void *>self._pgconn_ptr             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(((PY_LONG_LONG)((void *)__pyx_v_self->_pgconn_ptr))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":85
 *     @property
 *     def pgconn_ptr(self) -> Optional[int]:
 *         if self._pgconn_ptr:             # <<<<<<<<<<<<<<
 *             return <long long><void *>self._pgconn_ptr
 *         else:
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":88
 *             return <long long><void *>self._pgconn_ptr
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgconn.pyx":83
 *             self._pgconn_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgconn_ptr(self) -> Optional[int]:
 *         if self._pgconn_ptr:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.pgconn_ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":90
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def info(self) -> List["ConninfoOption"]:
 *         _ensure_pgconn(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_4info_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_4info_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_4info___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_4info___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PQconninfoOption *__pyx_v_opts;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":92
 *     @property
 *     def info(self) -> List["ConninfoOption"]:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfo(self._pgconn_ptr)
 *         if opts is NULL:
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 92, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":93
 *     def info(self) -> List["ConninfoOption"]:
 *         _ensure_pgconn(self)
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfo(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if opts is NULL:
 *             raise MemoryError("couldn't allocate connection info")
 */
  __pyx_v_opts = PQconninfo(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":94
 *         _ensure_pgconn(self)
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfo(self._pgconn_ptr)
 *         if opts is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate connection info")
 *         rv = _options_from_array(opts)
 */
  __pyx_t_2 = (__pyx_v_opts == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":95
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfo(self._pgconn_ptr)
 *         if opts is NULL:
 *             raise MemoryError("couldn't allocate connection info")             # <<<<<<<<<<<<<<
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 95, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":94
 *         _ensure_pgconn(self)
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfo(self._pgconn_ptr)
 *         if opts is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate connection info")
 *         rv = _options_from_array(opts)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":96
 *         if opts is NULL:
 *             raise MemoryError("couldn't allocate connection info")
 *         rv = _options_from_array(opts)             # <<<<<<<<<<<<<<
 *         libpq.PQconninfoFree(opts)
 *         return rv
 */
  __pyx_t_3 = __pyx_f_9psycopg_c_2pq__options_from_array(__pyx_v_opts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_rv = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "psycopg_c/pq/pgconn.pyx":97
 *             raise MemoryError("couldn't allocate connection info")
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  PQconninfoFree(__pyx_v_opts);

  /* "psycopg_c/pq/pgconn.pyx":98
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def reset(self) -> None:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":90
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def info(self) -> List["ConninfoOption"]:
 *         _ensure_pgconn(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":100
 *         return rv
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         libpq.PQreset(self._pgconn_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_15reset = {"reset", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_15reset, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_14reset(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_14reset(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);

  /* "psycopg_c/pq/pgconn.pyx":101
 * 
 *     def reset(self) -> None:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         libpq.PQreset(self._pgconn_ptr)
 * 
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 101, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":102
 *     def reset(self) -> None:
 *         _ensure_pgconn(self)
 *         libpq.PQreset(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def reset_start(self) -> None:
 */
  PQreset(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":100
 *         return rv
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         libpq.PQreset(self._pgconn_ptr)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":104
 *         libpq.PQreset(self._pgconn_ptr)
 * 
 *     def reset_start(self) -> None:             # <<<<<<<<<<<<<<
 *         if not libpq.PQresetStart(self._pgconn_ptr):
 *             raise e.OperationalError("couldn't reset connection")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_17reset_start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_17reset_start = {"reset_start", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_17reset_start, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_17reset_start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_start (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_16reset_start(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_16reset_start(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset_start", 0);

  /* "psycopg_c/pq/pgconn.pyx":105
 * 
 *     def reset_start(self) -> None:
 *         if not libpq.PQresetStart(self._pgconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't reset connection")
 * 
 */
  __pyx_t_1 = (!(PQresetStart(__pyx_v_self->_pgconn_ptr) != 0));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":106
 *     def reset_start(self) -> None:
 *         if not libpq.PQresetStart(self._pgconn_ptr):
 *             raise e.OperationalError("couldn't reset connection")             # <<<<<<<<<<<<<<
 * 
 *     def reset_poll(self) -> int:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_couldn_t_reset_connection};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 106, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":105
 * 
 *     def reset_start(self) -> None:
 *         if not libpq.PQresetStart(self._pgconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't reset connection")
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":104
 *         libpq.PQreset(self._pgconn_ptr)
 * 
 *     def reset_start(self) -> None:             # <<<<<<<<<<<<<<
 *         if not libpq.PQresetStart(self._pgconn_ptr):
 *             raise e.OperationalError("couldn't reset connection")
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.reset_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":108
 *             raise e.OperationalError("couldn't reset connection")
 * 
 *     def reset_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_19reset_poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_19reset_poll = {"reset_poll", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_19reset_poll, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_19reset_poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_poll (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_18reset_poll(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_18reset_poll(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset_poll", 0);

  /* "psycopg_c/pq/pgconn.pyx":109
 * 
 *     def reset_poll(self) -> int:
 *         return _call_int(self, <conn_int_f>libpq.PQresetPoll)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_int(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f)PQresetPoll)); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 109, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyInt_CheckExact(__pyx_t_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_2))) __PYX_ERR(0, 109, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":108
 *             raise e.OperationalError("couldn't reset connection")
 * 
 *     def reset_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.reset_poll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":111
 *         return _call_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def ping(self, const char *conninfo) -> int:
 *         return libpq.PQping(conninfo)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_21ping(PyObject *__pyx_v_self, PyObject *__pyx_arg_conninfo); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_21ping = {"ping", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_21ping, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_21ping(PyObject *__pyx_v_self, PyObject *__pyx_arg_conninfo) {
  char const *__pyx_v_conninfo;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ping (wrapper)", 0);
  assert(__pyx_arg_conninfo); {
    __pyx_v_conninfo = __Pyx_PyObject_AsString(__pyx_arg_conninfo); if (unlikely((!__pyx_v_conninfo) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_20ping(((PyTypeObject*)__pyx_v_self), ((char const *)__pyx_v_conninfo));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_20ping(CYTHON_UNUSED PyTypeObject *__pyx_v_self, char const *__pyx_v_conninfo) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ping", 0);

  /* "psycopg_c/pq/pgconn.pyx":113
 *     @classmethod
 *     def ping(self, const char *conninfo) -> int:
 *         return libpq.PQping(conninfo)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_PGPing(PQping(__pyx_v_conninfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyInt_CheckExact(__pyx_t_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(0, 113, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":111
 *         return _call_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def ping(self, const char *conninfo) -> int:
 *         return libpq.PQping(conninfo)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":115
 *         return libpq.PQping(conninfo)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def db(self) -> bytes:
 *         return _call_bytes(self, libpq.PQdb)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_2db_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_2db_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_2db___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_2db___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":117
 *     @property
 *     def db(self) -> bytes:
 *         return _call_bytes(self, libpq.PQdb)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_bytes(__pyx_v_self, PQdb); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(0, 117, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":115
 *         return libpq.PQping(conninfo)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def db(self) -> bytes:
 *         return _call_bytes(self, libpq.PQdb)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.db.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":119
 *         return _call_bytes(self, libpq.PQdb)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def user(self) -> bytes:
 *         return _call_bytes(self, libpq.PQuser)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_4user_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_4user_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_4user___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_4user___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":121
 *     @property
 *     def user(self) -> bytes:
 *         return _call_bytes(self, libpq.PQuser)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_bytes(__pyx_v_self, PQuser); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(0, 121, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":119
 *         return _call_bytes(self, libpq.PQdb)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def user(self) -> bytes:
 *         return _call_bytes(self, libpq.PQuser)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.user.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":123
 *         return _call_bytes(self, libpq.PQuser)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def password(self) -> bytes:
 *         return _call_bytes(self, libpq.PQpass)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_8password_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_8password_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_8password___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_8password___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":125
 *     @property
 *     def password(self) -> bytes:
 *         return _call_bytes(self, libpq.PQpass)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_bytes(__pyx_v_self, PQpass); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(0, 125, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":123
 *         return _call_bytes(self, libpq.PQuser)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def password(self) -> bytes:
 *         return _call_bytes(self, libpq.PQpass)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.password.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":127
 *         return _call_bytes(self, libpq.PQpass)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def host(self) -> bytes:
 *         return _call_bytes(self, libpq.PQhost)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_4host_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_4host_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_4host___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_4host___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":129
 *     @property
 *     def host(self) -> bytes:
 *         return _call_bytes(self, libpq.PQhost)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_bytes(__pyx_v_self, PQhost); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(0, 129, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":127
 *         return _call_bytes(self, libpq.PQpass)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def host(self) -> bytes:
 *         return _call_bytes(self, libpq.PQhost)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.host.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":131
 *         return _call_bytes(self, libpq.PQhost)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def hostaddr(self) -> bytes:
 *         if libpq.PG_VERSION_NUM < 120000:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_8hostaddr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_8hostaddr_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_8hostaddr___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_8hostaddr___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  char *__pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":133
 *     @property
 *     def hostaddr(self) -> bytes:
 *         if libpq.PG_VERSION_NUM < 120000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQhostaddr requires libpq from PostgreSQL 12,"
 */
  __pyx_t_1 = (PG_VERSION_NUM < 0x1D4C0);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":134
 *     def hostaddr(self) -> bytes:
 *         if libpq.PG_VERSION_NUM < 120000:
 *             raise e.NotSupportedError(             # <<<<<<<<<<<<<<
 *                 f"PQhostaddr requires libpq from PostgreSQL 12,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NotSupportedError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_c/pq/pgconn.pyx":135
 *         if libpq.PG_VERSION_NUM < 120000:
 *             raise e.NotSupportedError(
 *                 f"PQhostaddr requires libpq from PostgreSQL 12,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_PQhostaddr_requires_libpq_from_P);
    __pyx_t_5 += 46;
    __Pyx_GIVEREF(__pyx_kp_u_PQhostaddr_requires_libpq_from_P);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_PQhostaddr_requires_libpq_from_P);

    /* "psycopg_c/pq/pgconn.pyx":136
 *             raise e.NotSupportedError(
 *                 f"PQhostaddr requires libpq from PostgreSQL 12,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_int(PG_VERSION_NUM, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_available_instead);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_available_instead);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_available_instead);

    /* "psycopg_c/pq/pgconn.pyx":135
 *         if libpq.PG_VERSION_NUM < 120000:
 *             raise e.NotSupportedError(
 *                 f"PQhostaddr requires libpq from PostgreSQL 12,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 134, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":133
 *     @property
 *     def hostaddr(self) -> bytes:
 *         if libpq.PG_VERSION_NUM < 120000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQhostaddr requires libpq from PostgreSQL 12,"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":139
 *             )
 * 
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef char *rv = libpq.PQhostaddr(self._pgconn_ptr)
 *         assert rv is not NULL
 */
  __pyx_t_8 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_8 == ((int)0))) __PYX_ERR(0, 139, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":140
 * 
 *         _ensure_pgconn(self)
 *         cdef char *rv = libpq.PQhostaddr(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         assert rv is not NULL
 *         return rv
 */
  __pyx_v_rv = PQhostaddr(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":141
 *         _ensure_pgconn(self)
 *         cdef char *rv = libpq.PQhostaddr(self._pgconn_ptr)
 *         assert rv is not NULL             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = (__pyx_v_rv != NULL);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 141, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 141, __pyx_L1_error)
  #endif

  /* "psycopg_c/pq/pgconn.pyx":142
 *         cdef char *rv = libpq.PQhostaddr(self._pgconn_ptr)
 *         assert rv is not NULL
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":131
 *         return _call_bytes(self, libpq.PQhost)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def hostaddr(self) -> bytes:
 *         if libpq.PG_VERSION_NUM < 120000:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.hostaddr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":144
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def port(self) -> bytes:
 *         return _call_bytes(self, libpq.PQport)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_4port_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_4port_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_4port___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_4port___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":146
 *     @property
 *     def port(self) -> bytes:
 *         return _call_bytes(self, libpq.PQport)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_bytes(__pyx_v_self, PQport); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(0, 146, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":144
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def port(self) -> bytes:
 *         return _call_bytes(self, libpq.PQport)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.port.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":148
 *         return _call_bytes(self, libpq.PQport)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def tty(self) -> bytes:
 *         return _call_bytes(self, libpq.PQtty)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_3tty_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_3tty_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_3tty___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_3tty___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":150
 *     @property
 *     def tty(self) -> bytes:
 *         return _call_bytes(self, libpq.PQtty)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_bytes(__pyx_v_self, PQtty); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(0, 150, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":148
 *         return _call_bytes(self, libpq.PQport)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def tty(self) -> bytes:
 *         return _call_bytes(self, libpq.PQtty)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.tty.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":152
 *         return _call_bytes(self, libpq.PQtty)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def options(self) -> bytes:
 *         return _call_bytes(self, libpq.PQoptions)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_7options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_7options_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_7options___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_7options___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":154
 *     @property
 *     def options(self) -> bytes:
 *         return _call_bytes(self, libpq.PQoptions)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_bytes(__pyx_v_self, PQoptions); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(0, 154, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":152
 *         return _call_bytes(self, libpq.PQtty)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def options(self) -> bytes:
 *         return _call_bytes(self, libpq.PQoptions)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.options.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":156
 *         return _call_bytes(self, libpq.PQoptions)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         return libpq.PQstatus(self._pgconn_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_6status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_6status_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_6status___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_6status___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":158
 *     @property
 *     def status(self) -> int:
 *         return libpq.PQstatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_ConnStatusType(PQstatus(__pyx_v_self->_pgconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":156
 *         return _call_bytes(self, libpq.PQoptions)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         return libpq.PQstatus(self._pgconn_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":160
 *         return libpq.PQstatus(self._pgconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def transaction_status(self) -> int:
 *         return libpq.PQtransactionStatus(self._pgconn_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_18transaction_status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_18transaction_status_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_18transaction_status___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_18transaction_status___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":162
 *     @property
 *     def transaction_status(self) -> int:
 *         return libpq.PQtransactionStatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def parameter_status(self, const char *name) -> Optional[bytes]:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_PGTransactionStatusType(PQtransactionStatus(__pyx_v_self->_pgconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":160
 *         return libpq.PQstatus(self._pgconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def transaction_status(self) -> int:
 *         return libpq.PQtransactionStatus(self._pgconn_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.transaction_status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":164
 *         return libpq.PQtransactionStatus(self._pgconn_ptr)
 * 
 *     def parameter_status(self, const char *name) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef const char *rv = libpq.PQparameterStatus(self._pgconn_ptr, name)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_23parameter_status(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_23parameter_status = {"parameter_status", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_23parameter_status, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_23parameter_status(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parameter_status (wrapper)", 0);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.parameter_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_22parameter_status(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_22parameter_status(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  char const *__pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parameter_status", 0);

  /* "psycopg_c/pq/pgconn.pyx":165
 * 
 *     def parameter_status(self, const char *name) -> Optional[bytes]:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef const char *rv = libpq.PQparameterStatus(self._pgconn_ptr, name)
 *         if rv is not NULL:
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 165, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":166
 *     def parameter_status(self, const char *name) -> Optional[bytes]:
 *         _ensure_pgconn(self)
 *         cdef const char *rv = libpq.PQparameterStatus(self._pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if rv is not NULL:
 *             return rv
 */
  __pyx_v_rv = PQparameterStatus(__pyx_v_self->_pgconn_ptr, __pyx_v_name);

  /* "psycopg_c/pq/pgconn.pyx":167
 *         _ensure_pgconn(self)
 *         cdef const char *rv = libpq.PQparameterStatus(self._pgconn_ptr, name)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
 */
  __pyx_t_2 = (__pyx_v_rv != NULL);
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":168
 *         cdef const char *rv = libpq.PQparameterStatus(self._pgconn_ptr, name)
 *         if rv is not NULL:
 *             return rv             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":167
 *         _ensure_pgconn(self)
 *         cdef const char *rv = libpq.PQparameterStatus(self._pgconn_ptr, name)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":170
 *             return rv
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgconn.pyx":164
 *         return libpq.PQtransactionStatus(self._pgconn_ptr)
 * 
 *     def parameter_status(self, const char *name) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef const char *rv = libpq.PQparameterStatus(self._pgconn_ptr, name)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.parameter_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":172
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         return libpq.PQerrorMessage(self._pgconn_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_13error_message_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_13error_message_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_13error_message___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_13error_message___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":174
 *     @property
 *     def error_message(self) -> bytes:
 *         return libpq.PQerrorMessage(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(PQerrorMessage(__pyx_v_self->_pgconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":172
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         return libpq.PQerrorMessage(self._pgconn_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.error_message.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":176
 *         return libpq.PQerrorMessage(self._pgconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def protocol_version(self) -> int:
 *         return _call_int(self, libpq.PQprotocolVersion)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_16protocol_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_16protocol_version_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_16protocol_version___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_16protocol_version___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":178
 *     @property
 *     def protocol_version(self) -> int:
 *         return _call_int(self, libpq.PQprotocolVersion)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_int(__pyx_v_self, PQprotocolVersion); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 178, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":176
 *         return libpq.PQerrorMessage(self._pgconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def protocol_version(self) -> int:
 *         return _call_int(self, libpq.PQprotocolVersion)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.protocol_version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":180
 *         return _call_int(self, libpq.PQprotocolVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def server_version(self) -> int:
 *         return _call_int(self, libpq.PQserverVersion)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_14server_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_14server_version_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_14server_version___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_14server_version___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":182
 *     @property
 *     def server_version(self) -> int:
 *         return _call_int(self, libpq.PQserverVersion)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_int(__pyx_v_self, PQserverVersion); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 182, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":180
 *         return _call_int(self, libpq.PQprotocolVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def server_version(self) -> int:
 *         return _call_int(self, libpq.PQserverVersion)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.server_version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":184
 *         return _call_int(self, libpq.PQserverVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def socket(self) -> int:
 *         rv = _call_int(self, libpq.PQsocket)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_6socket_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_6socket_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_6socket___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_6socket___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":186
 *     @property
 *     def socket(self) -> int:
 *         rv = _call_int(self, libpq.PQsocket)             # <<<<<<<<<<<<<<
 *         if rv == -1:
 *             raise e.OperationalError("the connection is lost")
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_int(__pyx_v_self, PQsocket); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 186, __pyx_L1_error)
  __pyx_v_rv = __pyx_t_1;

  /* "psycopg_c/pq/pgconn.pyx":187
 *     def socket(self) -> int:
 *         rv = _call_int(self, libpq.PQsocket)
 *         if rv == -1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is lost")
 *         return rv
 */
  __pyx_t_2 = (__pyx_v_rv == -1L);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":188
 *         rv = _call_int(self, libpq.PQsocket)
 *         if rv == -1:
 *             raise e.OperationalError("the connection is lost")             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_the_connection_is_lost};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 188, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":187
 *     def socket(self) -> int:
 *         rv = _call_int(self, libpq.PQsocket)
 *         if rv == -1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is lost")
 *         return rv
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":189
 *         if rv == -1:
 *             raise e.OperationalError("the connection is lost")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":184
 *         return _call_int(self, libpq.PQserverVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def socket(self) -> int:
 *         rv = _call_int(self, libpq.PQsocket)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.socket.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":191
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def backend_pid(self) -> int:
 *         return _call_int(self, libpq.PQbackendPID)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_11backend_pid_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_11backend_pid_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_11backend_pid___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_11backend_pid___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":193
 *     @property
 *     def backend_pid(self) -> int:
 *         return _call_int(self, libpq.PQbackendPID)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_int(__pyx_v_self, PQbackendPID); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 193, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":191
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def backend_pid(self) -> int:
 *         return _call_int(self, libpq.PQbackendPID)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.backend_pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":195
 *         return _call_int(self, libpq.PQbackendPID)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def needs_password(self) -> bool:
 *         return bool(libpq.PQconnectionNeedsPassword(self._pgconn_ptr))
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_14needs_password_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_14needs_password_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_14needs_password___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_14needs_password___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":197
 *     @property
 *     def needs_password(self) -> bool:
 *         return bool(libpq.PQconnectionNeedsPassword(self._pgconn_ptr))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQconnectionNeedsPassword(__pyx_v_self->_pgconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":195
 *         return _call_int(self, libpq.PQbackendPID)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def needs_password(self) -> bool:
 *         return bool(libpq.PQconnectionNeedsPassword(self._pgconn_ptr))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.needs_password.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":199
 *         return bool(libpq.PQconnectionNeedsPassword(self._pgconn_ptr))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def used_password(self) -> bool:
 *         return bool(libpq.PQconnectionUsedPassword(self._pgconn_ptr))
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_13used_password_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_13used_password_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_13used_password___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_13used_password___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":201
 *     @property
 *     def used_password(self) -> bool:
 *         return bool(libpq.PQconnectionUsedPassword(self._pgconn_ptr))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQconnectionUsedPassword(__pyx_v_self->_pgconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":199
 *         return bool(libpq.PQconnectionNeedsPassword(self._pgconn_ptr))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def used_password(self) -> bool:
 *         return bool(libpq.PQconnectionUsedPassword(self._pgconn_ptr))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.used_password.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":203
 *         return bool(libpq.PQconnectionUsedPassword(self._pgconn_ptr))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ssl_in_use(self) -> bool:
 *         return bool(_call_int(self, <conn_int_f>libpq.PQsslInUse))
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_10ssl_in_use_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_10ssl_in_use_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_10ssl_in_use___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_10ssl_in_use___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":205
 *     @property
 *     def ssl_in_use(self) -> bool:
 *         return bool(_call_int(self, <conn_int_f>libpq.PQsslInUse))             # <<<<<<<<<<<<<<
 * 
 *     def exec_(self, const char *command) -> PGresult:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_int(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f)PQsslInUse)); if (unlikely(__pyx_t_1 == ((int)-2))) __PYX_ERR(0, 205, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":203
 *         return bool(libpq.PQconnectionUsedPassword(self._pgconn_ptr))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ssl_in_use(self) -> bool:
 *         return bool(_call_int(self, <conn_int_f>libpq.PQsslInUse))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.ssl_in_use.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":207
 *         return bool(_call_int(self, <conn_int_f>libpq.PQsslInUse))
 * 
 *     def exec_(self, const char *command) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *pgresult
 */

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_25exec_(PyObject *__pyx_v_self, PyObject *__pyx_arg_command); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_25exec_ = {"exec_", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_25exec_, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_25exec_(PyObject *__pyx_v_self, PyObject *__pyx_arg_command) {
  char const *__pyx_v_command;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exec_ (wrapper)", 0);
  assert(__pyx_arg_command); {
    __pyx_v_command = __Pyx_PyObject_AsString(__pyx_arg_command); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.exec_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_24exec_(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_command));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_24exec_(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command) {
  PGresult *__pyx_v_pgresult;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_", 0);

  /* "psycopg_c/pq/pgconn.pyx":208
 * 
 *     def exec_(self, const char *command) -> PGresult:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         with nogil:
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 208, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":210
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *pgresult
 *         with nogil:             # <<<<<<<<<<<<<<
 *             pgresult = libpq.PQexec(self._pgconn_ptr, command)
 *         if pgresult is NULL:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":211
 *         cdef libpq.PGresult *pgresult
 *         with nogil:
 *             pgresult = libpq.PQexec(self._pgconn_ptr, command)             # <<<<<<<<<<<<<<
 *         if pgresult is NULL:
 *             raise MemoryError("couldn't allocate PGresult")
 */
        __pyx_v_pgresult = PQexec(__pyx_v_self->_pgconn_ptr, __pyx_v_command);
      }

      /* "psycopg_c/pq/pgconn.pyx":210
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *pgresult
 *         with nogil:             # <<<<<<<<<<<<<<
 *             pgresult = libpq.PQexec(self._pgconn_ptr, command)
 *         if pgresult is NULL:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":212
 *         with nogil:
 *             pgresult = libpq.PQexec(self._pgconn_ptr, command)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 * 
 */
  __pyx_t_2 = (__pyx_v_pgresult == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":213
 *             pgresult = libpq.PQexec(self._pgconn_ptr, command)
 *         if pgresult is NULL:
 *             raise MemoryError("couldn't allocate PGresult")             # <<<<<<<<<<<<<<
 * 
 *         return PGresult._from_ptr(pgresult)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 213, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":212
 *         with nogil:
 *             pgresult = libpq.PQexec(self._pgconn_ptr, command)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":215
 *             raise MemoryError("couldn't allocate PGresult")
 * 
 *         return PGresult._from_ptr(pgresult)             # <<<<<<<<<<<<<<
 * 
 *     def send_query(self, const char *command) -> None:
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_pgresult)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":207
 *         return bool(_call_int(self, <conn_int_f>libpq.PQsslInUse))
 * 
 *     def exec_(self, const char *command) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *pgresult
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.exec_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":217
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query(self, const char *command) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_27send_query(PyObject *__pyx_v_self, PyObject *__pyx_arg_command); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_27send_query = {"send_query", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_27send_query, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_27send_query(PyObject *__pyx_v_self, PyObject *__pyx_arg_command) {
  char const *__pyx_v_command;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_query (wrapper)", 0);
  assert(__pyx_arg_command); {
    __pyx_v_command = __Pyx_PyObject_AsString(__pyx_arg_command); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_26send_query(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_command));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_26send_query(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command) {
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query", 0);

  /* "psycopg_c/pq/pgconn.pyx":218
 * 
 *     def send_query(self, const char *command) -> None:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with nogil:
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 218, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":220
 *         _ensure_pgconn(self)
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendQuery(self._pgconn_ptr, command)
 *         if not rv:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":221
 *         cdef int rv
 *         with nogil:
 *             rv = libpq.PQsendQuery(self._pgconn_ptr, command)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(f"sending query failed: {error_message(self)}")
 */
        __pyx_v_rv = PQsendQuery(__pyx_v_self->_pgconn_ptr, __pyx_v_command);
      }

      /* "psycopg_c/pq/pgconn.pyx":220
 *         _ensure_pgconn(self)
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendQuery(self._pgconn_ptr, command)
 *         if not rv:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":222
 *         with nogil:
 *             rv = libpq.PQsendQuery(self._pgconn_ptr, command)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"sending query failed: {error_message(self)}")
 * 
 */
  __pyx_t_2 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":223
 *             rv = libpq.PQsendQuery(self._pgconn_ptr, command)
 *         if not rv:
 *             raise e.OperationalError(f"sending query failed: {error_message(self)}")             # <<<<<<<<<<<<<<
 * 
 *     def exec_params(
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_sending_query_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 223, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":222
 *         with nogil:
 *             rv = libpq.PQsendQuery(self._pgconn_ptr, command)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"sending query failed: {error_message(self)}")
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":217
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query(self, const char *command) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":225
 *             raise e.OperationalError(f"sending query failed: {error_message(self)}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
 */

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_29exec_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_29exec_params = {"exec_params", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_29exec_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_29exec_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_command;
  PyObject *__pyx_v_param_values = 0;
  PyObject *__pyx_v_param_types = 0;
  PyObject *__pyx_v_param_formats = 0;
  int __pyx_v_result_format;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exec_params (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_command,&__pyx_n_s_param_values,&__pyx_n_s_param_types,&__pyx_n_s_param_formats,&__pyx_n_s_result_format,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_command,&__pyx_n_s_param_values,&__pyx_n_s_param_types,&__pyx_n_s_param_formats,&__pyx_n_s_result_format,0};
    #endif
    PyObject* values[5] = {0,0,0,0,0};

    /* "psycopg_c/pq/pgconn.pyx":229
 *         const char *command,
 *         param_values: Optional[Sequence[Optional[bytes]]],
 *         param_types: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *         param_formats: Optional[Sequence[int]] = None,
 *         int result_format = PqFormat.TEXT,
 */
    values[2] = ((PyObject *)Py_None);

    /* "psycopg_c/pq/pgconn.pyx":230
 *         param_values: Optional[Sequence[Optional[bytes]]],
 *         param_types: Optional[Sequence[int]] = None,
 *         param_formats: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
 */
    values[3] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_command)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_values)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("exec_params", 0, 2, 5, 1); __PYX_ERR(0, 225, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_types);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_formats);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result_format);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "exec_params") < 0)) __PYX_ERR(0, 225, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_command = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error)
    __pyx_v_param_values = values[1];
    __pyx_v_param_types = values[2];
    __pyx_v_param_formats = values[3];
    if (values[4]) {
      __pyx_v_result_format = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_k__8;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("exec_params", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 225, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.exec_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_28exec_params(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), __pyx_v_command, __pyx_v_param_values, __pyx_v_param_types, __pyx_v_param_formats, __pyx_v_result_format);

  /* "psycopg_c/pq/pgconn.pyx":225
 *             raise e.OperationalError(f"sending query failed: {error_message(self)}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_28exec_params(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_types, PyObject *__pyx_v_param_formats, int __pyx_v_result_format) {
  Py_ssize_t __pyx_v_cnparams;
  Oid *__pyx_v_ctypes;
  char *const *__pyx_v_cvalues;
  int *__pyx_v_clengths;
  int *__pyx_v_cformats;
  PGresult *__pyx_v_pgresult;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Oid *__pyx_t_4;
  char *const *__pyx_t_5;
  int *__pyx_t_6;
  int *__pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_params", 0);

  /* "psycopg_c/pq/pgconn.pyx":233
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t cnparams
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 233, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":241
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(
 *             param_values, param_types, param_formats)             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.PGresult *pgresult
 */
  if (!(likely(PyList_CheckExact(__pyx_v_param_values))||((__pyx_v_param_values) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_param_values))) __PYX_ERR(0, 241, __pyx_L1_error)
  if (!(likely(PyList_CheckExact(__pyx_v_param_formats))||((__pyx_v_param_formats) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_param_formats))) __PYX_ERR(0, 241, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":240
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, param_types, param_formats)
 * 
 */
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__query_params_args(((PyObject*)__pyx_v_param_values), __pyx_v_param_types, ((PyObject*)__pyx_v_param_formats)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2.f0;
  __pyx_t_4 = __pyx_t_2.f1;
  __pyx_t_5 = __pyx_t_2.f2;
  __pyx_t_6 = __pyx_t_2.f3;
  __pyx_t_7 = __pyx_t_2.f4;
  __pyx_v_cnparams = __pyx_t_3;
  __pyx_v_ctypes = __pyx_t_4;
  __pyx_v_cvalues = __pyx_t_5;
  __pyx_v_clengths = __pyx_t_6;
  __pyx_v_cformats = __pyx_t_7;

  /* "psycopg_c/pq/pgconn.pyx":244
 * 
 *         cdef libpq.PGresult *pgresult
 *         with nogil:             # <<<<<<<<<<<<<<
 *             pgresult = libpq.PQexecParams(
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":245
 *         cdef libpq.PGresult *pgresult
 *         with nogil:
 *             pgresult = libpq.PQexecParams(             # <<<<<<<<<<<<<<
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
 *                 <const char *const *>cvalues, clengths, cformats, result_format)
 */
        __pyx_v_pgresult = PQexecParams(__pyx_v_self->_pgconn_ptr, __pyx_v_command, ((int)__pyx_v_cnparams), __pyx_v_ctypes, ((char const *const *)__pyx_v_cvalues), __pyx_v_clengths, __pyx_v_cformats, __pyx_v_result_format);
      }

      /* "psycopg_c/pq/pgconn.pyx":244
 * 
 *         cdef libpq.PGresult *pgresult
 *         with nogil:             # <<<<<<<<<<<<<<
 *             pgresult = libpq.PQexecParams(
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":248
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
 *                 <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if pgresult is NULL:
 *             raise MemoryError("couldn't allocate PGresult")
 */
  __pyx_f_9psycopg_c_2pq__clear_query_params(__pyx_v_ctypes, __pyx_v_cvalues, __pyx_v_clengths, __pyx_v_cformats);

  /* "psycopg_c/pq/pgconn.pyx":249
 *                 <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(pgresult)
 */
  __pyx_t_8 = (__pyx_v_pgresult == NULL);
  if (unlikely(__pyx_t_8)) {

    /* "psycopg_c/pq/pgconn.pyx":250
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgresult is NULL:
 *             raise MemoryError("couldn't allocate PGresult")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(pgresult)
 * 
 */
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __PYX_ERR(0, 250, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":249
 *                 <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(pgresult)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":251
 *         if pgresult is NULL:
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(pgresult)             # <<<<<<<<<<<<<<
 * 
 *     def send_query_params(
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_9 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_pgresult)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_9);
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":225
 *             raise e.OperationalError(f"sending query failed: {error_message(self)}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.exec_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":253
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_31send_query_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_31send_query_params = {"send_query_params", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_31send_query_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_31send_query_params(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_command;
  PyObject *__pyx_v_param_values = 0;
  PyObject *__pyx_v_param_types = 0;
  PyObject *__pyx_v_param_formats = 0;
  int __pyx_v_result_format;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_query_params (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_command,&__pyx_n_s_param_values,&__pyx_n_s_param_types,&__pyx_n_s_param_formats,&__pyx_n_s_result_format,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_command,&__pyx_n_s_param_values,&__pyx_n_s_param_types,&__pyx_n_s_param_formats,&__pyx_n_s_result_format,0};
    #endif
    PyObject* values[5] = {0,0,0,0,0};

    /* "psycopg_c/pq/pgconn.pyx":257
 *         const char *command,
 *         param_values: Optional[Sequence[Optional[bytes]]],
 *         param_types: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *         param_formats: Optional[Sequence[int]] = None,
 *         int result_format = PqFormat.TEXT,
 */
    values[2] = ((PyObject *)Py_None);

    /* "psycopg_c/pq/pgconn.pyx":258
 *         param_values: Optional[Sequence[Optional[bytes]]],
 *         param_types: Optional[Sequence[int]] = None,
 *         param_formats: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
 */
    values[3] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_command)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_values)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("send_query_params", 0, 2, 5, 1); __PYX_ERR(0, 253, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_types);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_formats);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result_format);
          if (value) { values[4] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "send_query_params") < 0)) __PYX_ERR(0, 253, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_command = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error)
    __pyx_v_param_values = values[1];
    __pyx_v_param_types = values[2];
    __pyx_v_param_formats = values[3];
    if (values[4]) {
      __pyx_v_result_format = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_k__9;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send_query_params", 0, 2, 5, __pyx_nargs); __PYX_ERR(0, 253, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_query_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_30send_query_params(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), __pyx_v_command, __pyx_v_param_values, __pyx_v_param_types, __pyx_v_param_formats, __pyx_v_result_format);

  /* "psycopg_c/pq/pgconn.pyx":253
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_30send_query_params(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_types, PyObject *__pyx_v_param_formats, int __pyx_v_result_format) {
  Py_ssize_t __pyx_v_cnparams;
  Oid *__pyx_v_ctypes;
  char *const *__pyx_v_cvalues;
  int *__pyx_v_clengths;
  int *__pyx_v_cformats;
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Oid *__pyx_t_4;
  char *const *__pyx_t_5;
  int *__pyx_t_6;
  int *__pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query_params", 0);

  /* "psycopg_c/pq/pgconn.pyx":261
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t cnparams
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 261, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":269
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(
 *             param_values, param_types, param_formats)             # <<<<<<<<<<<<<<
 * 
 *         cdef int rv
 */
  if (!(likely(PyList_CheckExact(__pyx_v_param_values))||((__pyx_v_param_values) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_param_values))) __PYX_ERR(0, 269, __pyx_L1_error)
  if (!(likely(PyList_CheckExact(__pyx_v_param_formats))||((__pyx_v_param_formats) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_param_formats))) __PYX_ERR(0, 269, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":268
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, param_types, param_formats)
 * 
 */
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__query_params_args(((PyObject*)__pyx_v_param_values), __pyx_v_param_types, ((PyObject*)__pyx_v_param_formats)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2.f0;
  __pyx_t_4 = __pyx_t_2.f1;
  __pyx_t_5 = __pyx_t_2.f2;
  __pyx_t_6 = __pyx_t_2.f3;
  __pyx_t_7 = __pyx_t_2.f4;
  __pyx_v_cnparams = __pyx_t_3;
  __pyx_v_ctypes = __pyx_t_4;
  __pyx_v_cvalues = __pyx_t_5;
  __pyx_v_clengths = __pyx_t_6;
  __pyx_v_cformats = __pyx_t_7;

  /* "psycopg_c/pq/pgconn.pyx":272
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendQueryParams(
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":273
 *         cdef int rv
 *         with nogil:
 *             rv = libpq.PQsendQueryParams(             # <<<<<<<<<<<<<<
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
 *                 <const char *const *>cvalues, clengths, cformats, result_format)
 */
        __pyx_v_rv = PQsendQueryParams(__pyx_v_self->_pgconn_ptr, __pyx_v_command, ((int)__pyx_v_cnparams), __pyx_v_ctypes, ((char const *const *)__pyx_v_cvalues), __pyx_v_clengths, __pyx_v_cformats, __pyx_v_result_format);
      }

      /* "psycopg_c/pq/pgconn.pyx":272
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendQueryParams(
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":276
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
 *                 <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
 */
  __pyx_f_9psycopg_c_2pq__clear_query_params(__pyx_v_ctypes, __pyx_v_cvalues, __pyx_v_clengths, __pyx_v_cformats);

  /* "psycopg_c/pq/pgconn.pyx":277
 *                 <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {error_message(self)}"
 */
  __pyx_t_8 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_8)) {

    /* "psycopg_c/pq/pgconn.pyx":278
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending query and params failed: {error_message(self)}"
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "psycopg_c/pq/pgconn.pyx":279
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {error_message(self)}"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_error_message); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, ((PyObject *)__pyx_v_self)};
      __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_kp_u_sending_query_and_params_failed, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __PYX_ERR(0, 278, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":277
 *                 <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {error_message(self)}"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":253
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_query_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":282
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_33send_prepare(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_33send_prepare = {"send_prepare", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_33send_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_33send_prepare(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_name;
  char const *__pyx_v_command;
  PyObject *__pyx_v_param_types = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_prepare (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_command,&__pyx_n_s_param_types,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_command,&__pyx_n_s_param_types,0};
    #endif
    PyObject* values[3] = {0,0,0};

    /* "psycopg_c/pq/pgconn.pyx":286
 *         const char *name,
 *         const char *command,
 *         param_types: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         _ensure_pgconn(self)
 */
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_command)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("send_prepare", 0, 2, 3, 1); __PYX_ERR(0, 282, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_types);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "send_prepare") < 0)) __PYX_ERR(0, 282, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L3_error)
    __pyx_v_command = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L3_error)
    __pyx_v_param_types = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send_prepare", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 282, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_32send_prepare(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), __pyx_v_name, __pyx_v_command, __pyx_v_param_types);

  /* "psycopg_c/pq/pgconn.pyx":282
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_32send_prepare(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, char const *__pyx_v_command, PyObject *__pyx_v_param_types) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_nparams;
  Oid *__pyx_v_atypes;
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Oid __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_prepare", 0);

  /* "psycopg_c/pq/pgconn.pyx":288
 *         param_types: Optional[Sequence[int]] = None,
 *     ) -> None:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 * 
 *         cdef int i
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 288, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":291
 * 
 *         cdef int i
 *         cdef Py_ssize_t nparams = len(param_types) if param_types else 0             # <<<<<<<<<<<<<<
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_param_types); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 291, __pyx_L1_error)
  if (__pyx_t_3) {
    __pyx_t_4 = PyObject_Length(__pyx_v_param_types); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 291, __pyx_L1_error)
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = 0;
  }
  __pyx_v_nparams = __pyx_t_2;

  /* "psycopg_c/pq/pgconn.pyx":292
 *         cdef int i
 *         cdef Py_ssize_t nparams = len(param_types) if param_types else 0
 *         cdef libpq.Oid *atypes = NULL             # <<<<<<<<<<<<<<
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 */
  __pyx_v_atypes = NULL;

  /* "psycopg_c/pq/pgconn.pyx":293
 *         cdef Py_ssize_t nparams = len(param_types) if param_types else 0
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
 */
  __pyx_t_3 = (__pyx_v_nparams != 0);
  if (__pyx_t_3) {

    /* "psycopg_c/pq/pgconn.pyx":294
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))             # <<<<<<<<<<<<<<
 *             for i in range(nparams):
 *                 atypes[i] = param_types[i]
 */
    __pyx_v_atypes = ((Oid *)PyMem_Malloc((__pyx_v_nparams * (sizeof(Oid)))));

    /* "psycopg_c/pq/pgconn.pyx":295
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):             # <<<<<<<<<<<<<<
 *                 atypes[i] = param_types[i]
 * 
 */
    __pyx_t_2 = __pyx_v_nparams;
    __pyx_t_4 = __pyx_t_2;
    for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
      __pyx_v_i = __pyx_t_1;

      /* "psycopg_c/pq/pgconn.pyx":296
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
 *                 atypes[i] = param_types[i]             # <<<<<<<<<<<<<<
 * 
 *         cdef int rv
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_param_types, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_As_Oid(__pyx_t_5); if (unlikely((__pyx_t_6 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_6;
    }

    /* "psycopg_c/pq/pgconn.pyx":293
 *         cdef Py_ssize_t nparams = len(param_types) if param_types else 0
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":299
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendPrepare(
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":300
 *         cdef int rv
 *         with nogil:
 *             rv = libpq.PQsendPrepare(             # <<<<<<<<<<<<<<
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes
 *             )
 */
        __pyx_v_rv = PQsendPrepare(__pyx_v_self->_pgconn_ptr, __pyx_v_name, __pyx_v_command, ((int)__pyx_v_nparams), __pyx_v_atypes);
      }

      /* "psycopg_c/pq/pgconn.pyx":299
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendPrepare(
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":303
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes
 *             )
 *         PyMem_Free(atypes)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
 */
  PyMem_Free(__pyx_v_atypes);

  /* "psycopg_c/pq/pgconn.pyx":304
 *             )
 *         PyMem_Free(atypes)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {error_message(self)}"
 */
  __pyx_t_3 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":305
 *         PyMem_Free(atypes)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending query and params failed: {error_message(self)}"
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_e); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "psycopg_c/pq/pgconn.pyx":306
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {error_message(self)}"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_error_message); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, ((PyObject *)__pyx_v_self)};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_sending_query_and_params_failed, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 305, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":304
 *             )
 *         PyMem_Free(atypes)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {error_message(self)}"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":282
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":309
 *             )
 * 
 *     def send_query_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_35send_query_prepared(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_35send_query_prepared = {"send_query_prepared", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_35send_query_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_35send_query_prepared(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_name;
  PyObject *__pyx_v_param_values = 0;
  PyObject *__pyx_v_param_formats = 0;
  int __pyx_v_result_format;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_query_prepared (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_param_values,&__pyx_n_s_param_formats,&__pyx_n_s_result_format,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_param_values,&__pyx_n_s_param_formats,&__pyx_n_s_result_format,0};
    #endif
    PyObject* values[4] = {0,0,0,0};

    /* "psycopg_c/pq/pgconn.pyx":313
 *         const char *name,
 *         param_values: Optional[Sequence[Optional[bytes]]],
 *         param_formats: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
 */
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_values)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("send_query_prepared", 0, 2, 4, 1); __PYX_ERR(0, 309, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_formats);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result_format);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "send_query_prepared") < 0)) __PYX_ERR(0, 309, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 311, __pyx_L3_error)
    __pyx_v_param_values = values[1];
    __pyx_v_param_formats = values[2];
    if (values[3]) {
      __pyx_v_result_format = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 314, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_k__10;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send_query_prepared", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 309, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_query_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_34send_query_prepared(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), __pyx_v_name, __pyx_v_param_values, __pyx_v_param_formats, __pyx_v_result_format);

  /* "psycopg_c/pq/pgconn.pyx":309
 *             )
 * 
 *     def send_query_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_34send_query_prepared(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_formats, int __pyx_v_result_format) {
  Py_ssize_t __pyx_v_cnparams;
  Oid *__pyx_v_ctypes;
  char *const *__pyx_v_cvalues;
  int *__pyx_v_clengths;
  int *__pyx_v_cformats;
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Oid *__pyx_t_4;
  char *const *__pyx_t_5;
  int *__pyx_t_6;
  int *__pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":316
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t cnparams
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 316, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":324
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(
 *             param_values, None, param_formats)             # <<<<<<<<<<<<<<
 * 
 *         cdef int rv
 */
  if (!(likely(PyList_CheckExact(__pyx_v_param_values))||((__pyx_v_param_values) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_param_values))) __PYX_ERR(0, 324, __pyx_L1_error)
  if (!(likely(PyList_CheckExact(__pyx_v_param_formats))||((__pyx_v_param_formats) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_param_formats))) __PYX_ERR(0, 324, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":323
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, None, param_formats)
 * 
 */
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__query_params_args(((PyObject*)__pyx_v_param_values), Py_None, ((PyObject*)__pyx_v_param_formats)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 323, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2.f0;
  __pyx_t_4 = __pyx_t_2.f1;
  __pyx_t_5 = __pyx_t_2.f2;
  __pyx_t_6 = __pyx_t_2.f3;
  __pyx_t_7 = __pyx_t_2.f4;
  __pyx_v_cnparams = __pyx_t_3;
  __pyx_v_ctypes = __pyx_t_4;
  __pyx_v_cvalues = __pyx_t_5;
  __pyx_v_clengths = __pyx_t_6;
  __pyx_v_cformats = __pyx_t_7;

  /* "psycopg_c/pq/pgconn.pyx":327
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendQueryPrepared(
 *                 self._pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":328
 *         cdef int rv
 *         with nogil:
 *             rv = libpq.PQsendQueryPrepared(             # <<<<<<<<<<<<<<
 *                 self._pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
 *                 clengths, cformats, result_format)
 */
        __pyx_v_rv = PQsendQueryPrepared(__pyx_v_self->_pgconn_ptr, __pyx_v_name, ((int)__pyx_v_cnparams), ((char const *const *)__pyx_v_cvalues), __pyx_v_clengths, __pyx_v_cformats, __pyx_v_result_format);
      }

      /* "psycopg_c/pq/pgconn.pyx":327
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendQueryPrepared(
 *                 self._pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":331
 *                 self._pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
 *                 clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
 */
  __pyx_f_9psycopg_c_2pq__clear_query_params(__pyx_v_ctypes, __pyx_v_cvalues, __pyx_v_clengths, __pyx_v_cformats);

  /* "psycopg_c/pq/pgconn.pyx":332
 *                 clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending prepared query failed: {error_message(self)}"
 */
  __pyx_t_8 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_8)) {

    /* "psycopg_c/pq/pgconn.pyx":333
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending prepared query failed: {error_message(self)}"
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "psycopg_c/pq/pgconn.pyx":334
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending prepared query failed: {error_message(self)}"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_error_message); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, ((PyObject *)__pyx_v_self)};
      __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_kp_u_sending_prepared_query_failed, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __PYX_ERR(0, 333, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":332
 *                 clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending prepared query failed: {error_message(self)}"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":309
 *             )
 * 
 *     def send_query_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_query_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":337
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_37prepare(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_37prepare = {"prepare", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_37prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_37prepare(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_name;
  char const *__pyx_v_command;
  PyObject *__pyx_v_param_types = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prepare (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_command,&__pyx_n_s_param_types,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_command,&__pyx_n_s_param_types,0};
    #endif
    PyObject* values[3] = {0,0,0};

    /* "psycopg_c/pq/pgconn.pyx":341
 *         const char *name,
 *         const char *command,
 *         param_types: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         _ensure_pgconn(self)
 */
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_command)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("prepare", 0, 2, 3, 1); __PYX_ERR(0, 337, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_types);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "prepare") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
    __pyx_v_command = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
    __pyx_v_param_types = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prepare", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 337, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_36prepare(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), __pyx_v_name, __pyx_v_command, __pyx_v_param_types);

  /* "psycopg_c/pq/pgconn.pyx":337
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_36prepare(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, char const *__pyx_v_command, PyObject *__pyx_v_param_types) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_nparams;
  Oid *__pyx_v_atypes;
  PGresult *__pyx_v_rv;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Oid __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prepare", 0);

  /* "psycopg_c/pq/pgconn.pyx":343
 *         param_types: Optional[Sequence[int]] = None,
 *     ) -> PGresult:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 * 
 *         cdef int i
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 343, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":346
 * 
 *         cdef int i
 *         cdef Py_ssize_t nparams = len(param_types) if param_types else 0             # <<<<<<<<<<<<<<
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_param_types); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 346, __pyx_L1_error)
  if (__pyx_t_3) {
    __pyx_t_4 = PyObject_Length(__pyx_v_param_types); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 346, __pyx_L1_error)
    __pyx_t_2 = __pyx_t_4;
  } else {
    __pyx_t_2 = 0;
  }
  __pyx_v_nparams = __pyx_t_2;

  /* "psycopg_c/pq/pgconn.pyx":347
 *         cdef int i
 *         cdef Py_ssize_t nparams = len(param_types) if param_types else 0
 *         cdef libpq.Oid *atypes = NULL             # <<<<<<<<<<<<<<
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 */
  __pyx_v_atypes = NULL;

  /* "psycopg_c/pq/pgconn.pyx":348
 *         cdef Py_ssize_t nparams = len(param_types) if param_types else 0
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
 */
  __pyx_t_3 = (__pyx_v_nparams != 0);
  if (__pyx_t_3) {

    /* "psycopg_c/pq/pgconn.pyx":349
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))             # <<<<<<<<<<<<<<
 *             for i in range(nparams):
 *                 atypes[i] = param_types[i]
 */
    __pyx_v_atypes = ((Oid *)PyMem_Malloc((__pyx_v_nparams * (sizeof(Oid)))));

    /* "psycopg_c/pq/pgconn.pyx":350
 *         if nparams:
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):             # <<<<<<<<<<<<<<
 *                 atypes[i] = param_types[i]
 * 
 */
    __pyx_t_2 = __pyx_v_nparams;
    __pyx_t_4 = __pyx_t_2;
    for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
      __pyx_v_i = __pyx_t_1;

      /* "psycopg_c/pq/pgconn.pyx":351
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
 *                 atypes[i] = param_types[i]             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.PGresult *rv
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_param_types, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyInt_As_Oid(__pyx_t_5); if (unlikely((__pyx_t_6 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(0, 351, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_6;
    }

    /* "psycopg_c/pq/pgconn.pyx":348
 *         cdef Py_ssize_t nparams = len(param_types) if param_types else 0
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":354
 * 
 *         cdef libpq.PGresult *rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQprepare(
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":355
 *         cdef libpq.PGresult *rv
 *         with nogil:
 *             rv = libpq.PQprepare(             # <<<<<<<<<<<<<<
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)
 */
        __pyx_v_rv = PQprepare(__pyx_v_self->_pgconn_ptr, __pyx_v_name, __pyx_v_command, ((int)__pyx_v_nparams), __pyx_v_atypes);
      }

      /* "psycopg_c/pq/pgconn.pyx":354
 * 
 *         cdef libpq.PGresult *rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQprepare(
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes)
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":357
 *             rv = libpq.PQprepare(
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")
 */
  PyMem_Free(__pyx_v_atypes);

  /* "psycopg_c/pq/pgconn.pyx":358
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)
 */
  __pyx_t_3 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":359
 *         PyMem_Free(atypes)
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(rv)
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 359, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":358
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":360
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def exec_prepared(
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_5 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":337
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":362
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_39exec_prepared(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_39exec_prepared = {"exec_prepared", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_39exec_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_39exec_prepared(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_name;
  PyObject *__pyx_v_param_values = 0;
  PyObject *__pyx_v_param_formats = 0;
  int __pyx_v_result_format;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exec_prepared (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_param_values,&__pyx_n_s_param_formats,&__pyx_n_s_result_format,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_param_values,&__pyx_n_s_param_formats,&__pyx_n_s_result_format,0};
    #endif
    PyObject* values[4] = {0,0,0,0};

    /* "psycopg_c/pq/pgconn.pyx":366
 *         const char *name,
 *         param_values: Optional[Sequence[bytes]],
 *         param_formats: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
 */
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_values)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("exec_prepared", 0, 2, 4, 1); __PYX_ERR(0, 362, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_param_formats);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_result_format);
          if (value) { values[3] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "exec_prepared") < 0)) __PYX_ERR(0, 362, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L3_error)
    __pyx_v_param_values = values[1];
    __pyx_v_param_formats = values[2];
    if (values[3]) {
      __pyx_v_result_format = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_k__11;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("exec_prepared", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 362, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.exec_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_38exec_prepared(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), __pyx_v_name, __pyx_v_param_values, __pyx_v_param_formats, __pyx_v_result_format);

  /* "psycopg_c/pq/pgconn.pyx":362
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_38exec_prepared(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name, PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_formats, int __pyx_v_result_format) {
  Py_ssize_t __pyx_v_cnparams;
  Oid *__pyx_v_ctypes;
  char *const *__pyx_v_cvalues;
  int *__pyx_v_clengths;
  int *__pyx_v_cformats;
  PGresult *__pyx_v_rv;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Oid *__pyx_t_4;
  char *const *__pyx_t_5;
  int *__pyx_t_6;
  int *__pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":369
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t cnparams
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 369, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":377
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(
 *             param_values, None, param_formats)             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.PGresult *rv
 */
  if (!(likely(PyList_CheckExact(__pyx_v_param_values))||((__pyx_v_param_values) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_param_values))) __PYX_ERR(0, 377, __pyx_L1_error)
  if (!(likely(PyList_CheckExact(__pyx_v_param_formats))||((__pyx_v_param_formats) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_param_formats))) __PYX_ERR(0, 377, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":376
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, None, param_formats)
 * 
 */
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__query_params_args(((PyObject*)__pyx_v_param_values), Py_None, ((PyObject*)__pyx_v_param_formats)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_2.f0;
  __pyx_t_4 = __pyx_t_2.f1;
  __pyx_t_5 = __pyx_t_2.f2;
  __pyx_t_6 = __pyx_t_2.f3;
  __pyx_t_7 = __pyx_t_2.f4;
  __pyx_v_cnparams = __pyx_t_3;
  __pyx_v_ctypes = __pyx_t_4;
  __pyx_v_cvalues = __pyx_t_5;
  __pyx_v_clengths = __pyx_t_6;
  __pyx_v_cformats = __pyx_t_7;

  /* "psycopg_c/pq/pgconn.pyx":380
 * 
 *         cdef libpq.PGresult *rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQexecPrepared(
 *                 self._pgconn_ptr, name, <int>cnparams,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":381
 *         cdef libpq.PGresult *rv
 *         with nogil:
 *             rv = libpq.PQexecPrepared(             # <<<<<<<<<<<<<<
 *                 self._pgconn_ptr, name, <int>cnparams,
 *                 <const char *const *>cvalues,
 */
        __pyx_v_rv = PQexecPrepared(__pyx_v_self->_pgconn_ptr, __pyx_v_name, ((int)__pyx_v_cnparams), ((char const *const *)__pyx_v_cvalues), __pyx_v_clengths, __pyx_v_cformats, __pyx_v_result_format);
      }

      /* "psycopg_c/pq/pgconn.pyx":380
 * 
 *         cdef libpq.PGresult *rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQexecPrepared(
 *                 self._pgconn_ptr, name, <int>cnparams,
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":386
 *                 clengths, cformats, result_format)
 * 
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")
 */
  __pyx_f_9psycopg_c_2pq__clear_query_params(__pyx_v_ctypes, __pyx_v_cvalues, __pyx_v_clengths, __pyx_v_cformats);

  /* "psycopg_c/pq/pgconn.pyx":387
 * 
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)
 */
  __pyx_t_8 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_8)) {

    /* "psycopg_c/pq/pgconn.pyx":388
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(rv)
 * 
 */
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __PYX_ERR(0, 388, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":387
 * 
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":389
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_9 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_9);
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":362
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.exec_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":391
 *         return PGresult._from_ptr(rv)
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)
 */

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_41describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_41describe_prepared = {"describe_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_41describe_prepared, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_41describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("describe_prepared (wrapper)", 0);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.describe_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_40describe_prepared(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_40describe_prepared(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  PGresult *__pyx_v_rv;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("describe_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":392
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)
 *         if rv is NULL:
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 392, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":393
 *     def describe_prepared(self, const char *name) -> PGresult:
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")
 */
  __pyx_v_rv = PQdescribePrepared(__pyx_v_self->_pgconn_ptr, __pyx_v_name);

  /* "psycopg_c/pq/pgconn.pyx":394
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)
 */
  __pyx_t_2 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":395
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(rv)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 395, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":394
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":396
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def send_describe_prepared(self, const char *name) -> None:
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":391
 *         return PGresult._from_ptr(rv)
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.describe_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":398
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePrepared(self._pgconn_ptr, name)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_43send_describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_43send_describe_prepared = {"send_describe_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_43send_describe_prepared, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_43send_describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_describe_prepared (wrapper)", 0);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_describe_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_42send_describe_prepared(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_42send_describe_prepared(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_describe_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":399
 * 
 *     def send_describe_prepared(self, const char *name) -> None:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef int rv = libpq.PQsendDescribePrepared(self._pgconn_ptr, name)
 *         if not rv:
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 399, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":400
 *     def send_describe_prepared(self, const char *name) -> None:
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePrepared(self._pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
 */
  __pyx_v_rv = PQsendDescribePrepared(__pyx_v_self->_pgconn_ptr, __pyx_v_name);

  /* "psycopg_c/pq/pgconn.pyx":401
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePrepared(self._pgconn_ptr, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {error_message(self)}"
 */
  __pyx_t_2 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":402
 *         cdef int rv = libpq.PQsendDescribePrepared(self._pgconn_ptr, name)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending describe prepared failed: {error_message(self)}"
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":403
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {error_message(self)}"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_sending_describe_prepared_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 402, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":401
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePrepared(self._pgconn_ptr, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {error_message(self)}"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":398
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePrepared(self._pgconn_ptr, name)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_describe_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":406
 *             )
 * 
 *     def describe_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
 */

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_45describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_45describe_portal = {"describe_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_45describe_portal, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_45describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("describe_portal (wrapper)", 0);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.describe_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_44describe_portal(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_44describe_portal(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  PGresult *__pyx_v_rv;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("describe_portal", 0);

  /* "psycopg_c/pq/pgconn.pyx":407
 * 
 *     def describe_portal(self, const char *name) -> PGresult:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
 *         if rv is NULL:
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 407, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":408
 *     def describe_portal(self, const char *name) -> PGresult:
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")
 */
  __pyx_v_rv = PQdescribePortal(__pyx_v_self->_pgconn_ptr, __pyx_v_name);

  /* "psycopg_c/pq/pgconn.pyx":409
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)
 */
  __pyx_t_2 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":410
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(rv)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 410, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":409
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":411
 *         if rv is NULL:
 *             raise MemoryError("couldn't allocate PGresult")
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def send_describe_portal(self, const char *name) -> None:
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":406
 *             )
 * 
 *     def describe_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.describe_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":413
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePortal(self._pgconn_ptr, name)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_47send_describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_47send_describe_portal = {"send_describe_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_47send_describe_portal, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_47send_describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_describe_portal (wrapper)", 0);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_describe_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_46send_describe_portal(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((char const *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_46send_describe_portal(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_name) {
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_describe_portal", 0);

  /* "psycopg_c/pq/pgconn.pyx":414
 * 
 *     def send_describe_portal(self, const char *name) -> None:
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef int rv = libpq.PQsendDescribePortal(self._pgconn_ptr, name)
 *         if not rv:
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 414, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":415
 *     def send_describe_portal(self, const char *name) -> None:
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePortal(self._pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
 */
  __pyx_v_rv = PQsendDescribePortal(__pyx_v_self->_pgconn_ptr, __pyx_v_name);

  /* "psycopg_c/pq/pgconn.pyx":416
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePortal(self._pgconn_ptr, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {error_message(self)}"
 */
  __pyx_t_2 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":417
 *         cdef int rv = libpq.PQsendDescribePortal(self._pgconn_ptr, name)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending describe prepared failed: {error_message(self)}"
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":418
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {error_message(self)}"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_sending_describe_prepared_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 417, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":416
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePortal(self._pgconn_ptr, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {error_message(self)}"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":413
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePortal(self._pgconn_ptr, name)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_describe_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":421
 *             )
 * 
 *     def get_result(self) -> Optional["PGresult"]:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_49get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_49get_result = {"get_result", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_49get_result, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_49get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_result (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_48get_result(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_48get_result(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PGresult *__pyx_v_pgresult;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_result", 0);

  /* "psycopg_c/pq/pgconn.pyx":422
 * 
 *     def get_result(self) -> Optional["PGresult"]:
 *         cdef libpq.PGresult *pgresult = libpq.PQgetResult(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgresult is NULL:
 *             return None
 */
  __pyx_v_pgresult = PQgetResult(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":423
 *     def get_result(self) -> Optional["PGresult"]:
 *         cdef libpq.PGresult *pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return PGresult._from_ptr(pgresult)
 */
  __pyx_t_1 = (__pyx_v_pgresult == NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":424
 *         cdef libpq.PGresult *pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(pgresult)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":423
 *     def get_result(self) -> Optional["PGresult"]:
 *         cdef libpq.PGresult *pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return PGresult._from_ptr(pgresult)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":425
 *         if pgresult is NULL:
 *             return None
 *         return PGresult._from_ptr(pgresult)             # <<<<<<<<<<<<<<
 * 
 *     def consume_input(self) -> None:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_pgresult)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":421
 *             )
 * 
 *     def get_result(self) -> Optional["PGresult"]:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":427
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):
 *             raise e.OperationalError(f"consuming input failed: {error_message(self)}")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_51consume_input(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_51consume_input = {"consume_input", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_51consume_input, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_51consume_input(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("consume_input (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_50consume_input(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_50consume_input(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("consume_input", 0);

  /* "psycopg_c/pq/pgconn.pyx":428
 * 
 *     def consume_input(self) -> None:
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"consuming input failed: {error_message(self)}")
 * 
 */
  __pyx_t_1 = (1 != PQconsumeInput(__pyx_v_self->_pgconn_ptr));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":429
 *     def consume_input(self) -> None:
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):
 *             raise e.OperationalError(f"consuming input failed: {error_message(self)}")             # <<<<<<<<<<<<<<
 * 
 *     def is_busy(self) -> int:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_self)};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_consuming_input_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 429, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":428
 * 
 *     def consume_input(self) -> None:
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"consuming input failed: {error_message(self)}")
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":427
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):
 *             raise e.OperationalError(f"consuming input failed: {error_message(self)}")
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.consume_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":431
 *             raise e.OperationalError(f"consuming input failed: {error_message(self)}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_53is_busy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_53is_busy = {"is_busy", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_53is_busy, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_53is_busy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_busy (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_52is_busy(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_52is_busy(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_busy", 0);

  /* "psycopg_c/pq/pgconn.pyx":433
 *     def is_busy(self) -> int:
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisBusy(self._pgconn_ptr)
 *         return rv
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":434
 *         cdef int rv
 *         with nogil:
 *             rv = libpq.PQisBusy(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
        __pyx_v_rv = PQisBusy(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":433
 *     def is_busy(self) -> int:
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisBusy(self._pgconn_ptr)
 *         return rv
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":435
 *         with nogil:
 *             rv = libpq.PQisBusy(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyInt_CheckExact(__pyx_t_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(0, 435, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":431
 *             raise e.OperationalError(f"consuming input failed: {error_message(self)}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.is_busy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":437
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nonblocking(self) -> int:
 *         return libpq.PQisnonblocking(self._pgconn_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_11nonblocking_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_11nonblocking_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_11nonblocking___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_11nonblocking___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":439
 *     @property
 *     def nonblocking(self) -> int:
 *         return libpq.PQisnonblocking(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @nonblocking.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQisnonblocking(__pyx_v_self->_pgconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":437
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nonblocking(self) -> int:
 *         return libpq.PQisnonblocking(self._pgconn_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.nonblocking.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":441
 *         return libpq.PQisnonblocking(self._pgconn_ptr)
 * 
 *     @nonblocking.setter             # <<<<<<<<<<<<<<
 *     def nonblocking(self, int arg) -> None:
 *         if 0 > libpq.PQsetnonblocking(self._pgconn_ptr, arg):
 */

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_6PGconn_11nonblocking_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_arg); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_6PGconn_11nonblocking_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_arg) {
  int __pyx_v_arg;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_arg); {
    __pyx_v_arg = __Pyx_PyInt_As_int(__pyx_arg_arg); if (unlikely((__pyx_v_arg == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.nonblocking.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_11nonblocking_2__set__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((int)__pyx_v_arg));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_6PGconn_11nonblocking_2__set__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, int __pyx_v_arg) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "psycopg_c/pq/pgconn.pyx":443
 *     @nonblocking.setter
 *     def nonblocking(self, int arg) -> None:
 *         if 0 > libpq.PQsetnonblocking(self._pgconn_ptr, arg):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"setting nonblocking failed: {error_message(self)}")
 * 
 */
  __pyx_t_1 = (0 > PQsetnonblocking(__pyx_v_self->_pgconn_ptr, __pyx_v_arg));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":444
 *     def nonblocking(self, int arg) -> None:
 *         if 0 > libpq.PQsetnonblocking(self._pgconn_ptr, arg):
 *             raise e.OperationalError(f"setting nonblocking failed: {error_message(self)}")             # <<<<<<<<<<<<<<
 * 
 *     def flush(self) -> int:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_self)};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_setting_nonblocking_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 444, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":443
 *     @nonblocking.setter
 *     def nonblocking(self, int arg) -> None:
 *         if 0 > libpq.PQsetnonblocking(self._pgconn_ptr, arg):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"setting nonblocking failed: {error_message(self)}")
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":441
 *         return libpq.PQisnonblocking(self._pgconn_ptr)
 * 
 *     @nonblocking.setter             # <<<<<<<<<<<<<<
 *     def nonblocking(self, int arg) -> None:
 *         if 0 > libpq.PQsetnonblocking(self._pgconn_ptr, arg):
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.nonblocking.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":446
 *             raise e.OperationalError(f"setting nonblocking failed: {error_message(self)}")
 * 
 *     def flush(self) -> int:             # <<<<<<<<<<<<<<
 *         if self._pgconn_ptr == NULL:
 *             raise e.OperationalError(f"flushing failed: the connection is closed")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_55flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_55flush = {"flush", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_55flush, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_55flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_54flush(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_54flush(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flush", 0);

  /* "psycopg_c/pq/pgconn.pyx":447
 * 
 *     def flush(self) -> int:
 *         if self._pgconn_ptr == NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"flushing failed: the connection is closed")
 *         cdef int rv = libpq.PQflush(self._pgconn_ptr)
 */
  __pyx_t_1 = (__pyx_v_self->_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":448
 *     def flush(self) -> int:
 *         if self._pgconn_ptr == NULL:
 *             raise e.OperationalError(f"flushing failed: the connection is closed")             # <<<<<<<<<<<<<<
 *         cdef int rv = libpq.PQflush(self._pgconn_ptr)
 *         if rv < 0:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_flushing_failed_the_connection_i};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 448, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":447
 * 
 *     def flush(self) -> int:
 *         if self._pgconn_ptr == NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"flushing failed: the connection is closed")
 *         cdef int rv = libpq.PQflush(self._pgconn_ptr)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":449
 *         if self._pgconn_ptr == NULL:
 *             raise e.OperationalError(f"flushing failed: the connection is closed")
 *         cdef int rv = libpq.PQflush(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv < 0:
 *             raise e.OperationalError(f"flushing failed: {error_message(self)}")
 */
  __pyx_v_rv = PQflush(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":450
 *             raise e.OperationalError(f"flushing failed: the connection is closed")
 *         cdef int rv = libpq.PQflush(self._pgconn_ptr)
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"flushing failed: {error_message(self)}")
 *         return rv
 */
  __pyx_t_1 = (__pyx_v_rv < 0);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":451
 *         cdef int rv = libpq.PQflush(self._pgconn_ptr)
 *         if rv < 0:
 *             raise e.OperationalError(f"flushing failed: {error_message(self)}")             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_flushing_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 451, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":450
 *             raise e.OperationalError(f"flushing failed: the connection is closed")
 *         cdef int rv = libpq.PQflush(self._pgconn_ptr)
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"flushing failed: {error_message(self)}")
 *         return rv
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":452
 *         if rv < 0:
 *             raise e.OperationalError(f"flushing failed: {error_message(self)}")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def set_single_row_mode(self) -> None:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyInt_CheckExact(__pyx_t_2)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_2))) __PYX_ERR(0, 452, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":446
 *             raise e.OperationalError(f"setting nonblocking failed: {error_message(self)}")
 * 
 *     def flush(self) -> int:             # <<<<<<<<<<<<<<
 *         if self._pgconn_ptr == NULL:
 *             raise e.OperationalError(f"flushing failed: the connection is closed")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":454
 *         return rv
 * 
 *     def set_single_row_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         if not libpq.PQsetSingleRowMode(self._pgconn_ptr):
 *             raise e.OperationalError("setting single row mode failed")
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_57set_single_row_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_57set_single_row_mode = {"set_single_row_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_57set_single_row_mode, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_57set_single_row_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_single_row_mode (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_56set_single_row_mode(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_56set_single_row_mode(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_single_row_mode", 0);

  /* "psycopg_c/pq/pgconn.pyx":455
 * 
 *     def set_single_row_mode(self) -> None:
 *         if not libpq.PQsetSingleRowMode(self._pgconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting single row mode failed")
 * 
 */
  __pyx_t_1 = (!(PQsetSingleRowMode(__pyx_v_self->_pgconn_ptr) != 0));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":456
 *     def set_single_row_mode(self) -> None:
 *         if not libpq.PQsetSingleRowMode(self._pgconn_ptr):
 *             raise e.OperationalError("setting single row mode failed")             # <<<<<<<<<<<<<<
 * 
 *     def get_cancel(self) -> PGcancel:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_setting_single_row_mode_failed};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 456, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":455
 * 
 *     def set_single_row_mode(self) -> None:
 *         if not libpq.PQsetSingleRowMode(self._pgconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting single row mode failed")
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":454
 *         return rv
 * 
 *     def set_single_row_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         if not libpq.PQsetSingleRowMode(self._pgconn_ptr):
 *             raise e.OperationalError("setting single row mode failed")
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.set_single_row_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":458
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def get_cancel(self) -> PGcancel:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancel *ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:
 */

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_pw_9psycopg_c_2pq_6PGconn_59get_cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_59get_cancel = {"get_cancel", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_59get_cancel, METH_NOARGS, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_pw_9psycopg_c_2pq_6PGconn_59get_cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_cancel (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_58get_cancel(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_pf_9psycopg_c_2pq_6PGconn_58get_cancel(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PGcancel *__pyx_v_ptr;
  struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_cancel", 0);

  /* "psycopg_c/pq/pgconn.pyx":459
 * 
 *     def get_cancel(self) -> PGcancel:
 *         cdef libpq.PGcancel *ptr = libpq.PQgetCancel(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancel object")
 */
  __pyx_v_ptr = PQgetCancel(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":460
 *     def get_cancel(self) -> PGcancel:
 *         cdef libpq.PGcancel *ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't create cancel object")
 *         return PGcancel._from_ptr(ptr)
 */
  __pyx_t_1 = (!(__pyx_v_ptr != 0));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":461
 *         cdef libpq.PGcancel *ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancel object")             # <<<<<<<<<<<<<<
 *         return PGcancel._from_ptr(ptr)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_couldn_t_create_cancel_object};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 461, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":460
 *     def get_cancel(self) -> PGcancel:
 *         cdef libpq.PGcancel *ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't create cancel object")
 *         return PGcancel._from_ptr(ptr)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":462
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancel object")
 *         return PGcancel._from_ptr(ptr)             # <<<<<<<<<<<<<<
 * 
 *     cpdef object notifies(self):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGcancel__from_ptr(__pyx_v_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGcancel *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":458
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def get_cancel(self) -> PGcancel:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancel *ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.get_cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":464
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with nogil:
 */

static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_61notifies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_6PGconn_notifies(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, int __pyx_skip_dispatch) {
  PGnotify *__pyx_v_ptr;
  PyObject *__pyx_v_ret = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("notifies", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notifies); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9psycopg_c_2pq_6PGconn_61notifies)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[1] = {__pyx_t_4, };
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "psycopg_c/pq/pgconn.pyx":466
 *     cpdef object notifies(self):
 *         cdef libpq.PGnotify *ptr
 *         with nogil:             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":467
 *         cdef libpq.PGnotify *ptr
 *         with nogil:
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if ptr:
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)
 */
        __pyx_v_ptr = PQnotifies(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":466
 *     cpdef object notifies(self):
 *         cdef libpq.PGnotify *ptr
 *         with nogil:             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":468
 *         with nogil:
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:             # <<<<<<<<<<<<<<
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)
 *             libpq.PQfreemem(ptr)
 */
  __pyx_t_6 = (__pyx_v_ptr != 0);
  if (__pyx_t_6) {

    /* "psycopg_c/pq/pgconn.pyx":469
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)             # <<<<<<<<<<<<<<
 *             libpq.PQfreemem(ptr)
 *             return ret
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PGnotify); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_ptr->relname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ptr->be_pid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_ptr->extra); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_v_ret = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "psycopg_c/pq/pgconn.pyx":470
 *         if ptr:
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)
 *             libpq.PQfreemem(ptr)             # <<<<<<<<<<<<<<
 *             return ret
 *         else:
 */
    PQfreemem(__pyx_v_ptr);

    /* "psycopg_c/pq/pgconn.pyx":471
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)
 *             libpq.PQfreemem(ptr)
 *             return ret             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_ret);
    __pyx_r = __pyx_v_ret;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":468
 *         with nogil:
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:             # <<<<<<<<<<<<<<
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)
 *             libpq.PQfreemem(ptr)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":473
 *             return ret
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def put_copy_data(self, buffer) -> int:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgconn.pyx":464
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with nogil:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.notifies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_61notifies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_61notifies = {"notifies", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_61notifies, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_61notifies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("notifies (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_60notifies(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_60notifies(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("notifies", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq_6PGconn_notifies(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.notifies", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":475
 *             return None
 * 
 *     def put_copy_data(self, buffer) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef char *cbuffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_63put_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_v_buffer); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_63put_copy_data = {"put_copy_data", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_63put_copy_data, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_63put_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_v_buffer) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put_copy_data (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_62put_copy_data(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((PyObject *)__pyx_v_buffer));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_62put_copy_data(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_buffer) {
  int __pyx_v_rv;
  char *__pyx_v_cbuffer;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put_copy_data", 0);

  /* "psycopg_c/pq/pgconn.pyx":480
 *         cdef Py_ssize_t length
 * 
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)             # <<<<<<<<<<<<<<
 *         rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(__pyx_v_buffer, (&__pyx_v_cbuffer), (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 480, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":481
 * 
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)
 *         rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)             # <<<<<<<<<<<<<<
 *         if rv < 0:
 *             raise e.OperationalError(f"sending copy data failed: {error_message(self)}")
 */
  __pyx_v_rv = PQputCopyData(__pyx_v_self->_pgconn_ptr, __pyx_v_cbuffer, ((int)__pyx_v_length));

  /* "psycopg_c/pq/pgconn.pyx":482
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)
 *         rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"sending copy data failed: {error_message(self)}")
 *         return rv
 */
  __pyx_t_2 = (__pyx_v_rv < 0);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":483
 *         rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:
 *             raise e.OperationalError(f"sending copy data failed: {error_message(self)}")             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_sending_copy_data_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_1 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 483, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":482
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)
 *         rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"sending copy data failed: {error_message(self)}")
 *         return rv
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":484
 *         if rv < 0:
 *             raise e.OperationalError(f"sending copy data failed: {error_message(self)}")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def put_copy_end(self, error: Optional[bytes] = None) -> int:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyInt_CheckExact(__pyx_t_3)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_3))) __PYX_ERR(0, 484, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":475
 *             return None
 * 
 *     def put_copy_data(self, buffer) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef char *cbuffer
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.put_copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":486
 *         return rv
 * 
 *     def put_copy_end(self, error: Optional[bytes] = None) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef const char *cerr = NULL
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_65put_copy_end(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_65put_copy_end = {"put_copy_end", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_65put_copy_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_65put_copy_end(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_error = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put_copy_end (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_error,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_error,0};
    #endif
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_error);
          if (value) { values[0] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "put_copy_end") < 0)) __PYX_ERR(0, 486, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_error = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("put_copy_end", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 486, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.put_copy_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_64put_copy_end(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), __pyx_v_error);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_64put_copy_end(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_error) {
  int __pyx_v_rv;
  char const *__pyx_v_cerr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  char *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put_copy_end", 0);

  /* "psycopg_c/pq/pgconn.pyx":488
 *     def put_copy_end(self, error: Optional[bytes] = None) -> int:
 *         cdef int rv
 *         cdef const char *cerr = NULL             # <<<<<<<<<<<<<<
 *         if error is not None:
 *             cerr = PyBytes_AsString(error)
 */
  __pyx_v_cerr = NULL;

  /* "psycopg_c/pq/pgconn.pyx":489
 *         cdef int rv
 *         cdef const char *cerr = NULL
 *         if error is not None:             # <<<<<<<<<<<<<<
 *             cerr = PyBytes_AsString(error)
 *         rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 */
  __pyx_t_1 = (__pyx_v_error != Py_None);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":490
 *         cdef const char *cerr = NULL
 *         if error is not None:
 *             cerr = PyBytes_AsString(error)             # <<<<<<<<<<<<<<
 *         rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:
 */
    __pyx_t_2 = PyBytes_AsString(__pyx_v_error); if (unlikely(__pyx_t_2 == ((char *)NULL))) __PYX_ERR(0, 490, __pyx_L1_error)
    __pyx_v_cerr = __pyx_t_2;

    /* "psycopg_c/pq/pgconn.pyx":489
 *         cdef int rv
 *         cdef const char *cerr = NULL
 *         if error is not None:             # <<<<<<<<<<<<<<
 *             cerr = PyBytes_AsString(error)
 *         rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":491
 *         if error is not None:
 *             cerr = PyBytes_AsString(error)
 *         rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)             # <<<<<<<<<<<<<<
 *         if rv < 0:
 *             raise e.OperationalError(f"sending copy end failed: {error_message(self)}")
 */
  __pyx_v_rv = PQputCopyEnd(__pyx_v_self->_pgconn_ptr, __pyx_v_cerr);

  /* "psycopg_c/pq/pgconn.pyx":492
 *             cerr = PyBytes_AsString(error)
 *         rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"sending copy end failed: {error_message(self)}")
 *         return rv
 */
  __pyx_t_1 = (__pyx_v_rv < 0);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":493
 *         rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:
 *             raise e.OperationalError(f"sending copy end failed: {error_message(self)}")             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_error_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_sending_copy_end_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 493, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":492
 *             cerr = PyBytes_AsString(error)
 *         rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"sending copy end failed: {error_message(self)}")
 *         return rv
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":494
 *         if rv < 0:
 *             raise e.OperationalError(f"sending copy end failed: {error_message(self)}")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def get_copy_data(self, int async_) -> Tuple[int, memoryview]:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyInt_CheckExact(__pyx_t_3)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_3))) __PYX_ERR(0, 494, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":486
 *         return rv
 * 
 *     def put_copy_end(self, error: Optional[bytes] = None) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef const char *cerr = NULL
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.put_copy_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":496
 *         return rv
 * 
 *     def get_copy_data(self, int async_) -> Tuple[int, memoryview]:             # <<<<<<<<<<<<<<
 *         cdef char *buffer_ptr = NULL
 *         cdef int nbytes
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_67get_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_arg_async_); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_67get_copy_data = {"get_copy_data", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_67get_copy_data, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_67get_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_arg_async_) {
  int __pyx_v_async_;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_copy_data (wrapper)", 0);
  assert(__pyx_arg_async_); {
    __pyx_v_async_ = __Pyx_PyInt_As_int(__pyx_arg_async_); if (unlikely((__pyx_v_async_ == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.get_copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_66get_copy_data(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((int)__pyx_v_async_));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_66get_copy_data(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, int __pyx_v_async_) {
  char *__pyx_v_buffer_ptr;
  int __pyx_v_nbytes;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_copy_data", 0);

  /* "psycopg_c/pq/pgconn.pyx":497
 * 
 *     def get_copy_data(self, int async_) -> Tuple[int, memoryview]:
 *         cdef char *buffer_ptr = NULL             # <<<<<<<<<<<<<<
 *         cdef int nbytes
 *         nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 */
  __pyx_v_buffer_ptr = NULL;

  /* "psycopg_c/pq/pgconn.pyx":499
 *         cdef char *buffer_ptr = NULL
 *         cdef int nbytes
 *         nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)             # <<<<<<<<<<<<<<
 *         if nbytes == -2:
 *             raise e.OperationalError(f"receiving copy data failed: {error_message(self)}")
 */
  __pyx_v_nbytes = PQgetCopyData(__pyx_v_self->_pgconn_ptr, (&__pyx_v_buffer_ptr), __pyx_v_async_);

  /* "psycopg_c/pq/pgconn.pyx":500
 *         cdef int nbytes
 *         nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 *         if nbytes == -2:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"receiving copy data failed: {error_message(self)}")
 *         if buffer_ptr is not NULL:
 */
  __pyx_t_1 = (__pyx_v_nbytes == -2L);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":501
 *         nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 *         if nbytes == -2:
 *             raise e.OperationalError(f"receiving copy data failed: {error_message(self)}")             # <<<<<<<<<<<<<<
 *         if buffer_ptr is not NULL:
 *             data = PyMemoryView_FromObject(
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_self)};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_receiving_copy_data_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 501, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":500
 *         cdef int nbytes
 *         nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 *         if nbytes == -2:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"receiving copy data failed: {error_message(self)}")
 *         if buffer_ptr is not NULL:
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":502
 *         if nbytes == -2:
 *             raise e.OperationalError(f"receiving copy data failed: {error_message(self)}")
 *         if buffer_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             data = PyMemoryView_FromObject(
 *                 PQBuffer._from_buffer(<unsigned char *>buffer_ptr, nbytes))
 */
  __pyx_t_1 = (__pyx_v_buffer_ptr != NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":504
 *         if buffer_ptr is not NULL:
 *             data = PyMemoryView_FromObject(
 *                 PQBuffer._from_buffer(<unsigned char *>buffer_ptr, nbytes))             # <<<<<<<<<<<<<<
 *             return nbytes, data
 *         else:
 */
    __pyx_t_2 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PQBuffer__from_buffer(((unsigned char *)__pyx_v_buffer_ptr), __pyx_v_nbytes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "psycopg_c/pq/pgconn.pyx":503
 *             raise e.OperationalError(f"receiving copy data failed: {error_message(self)}")
 *         if buffer_ptr is not NULL:
 *             data = PyMemoryView_FromObject(             # <<<<<<<<<<<<<<
 *                 PQBuffer._from_buffer(<unsigned char *>buffer_ptr, nbytes))
 *             return nbytes, data
 */
    __pyx_t_4 = PyMemoryView_FromObject(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_data = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":505
 *             data = PyMemoryView_FromObject(
 *                 PQBuffer._from_buffer(<unsigned char *>buffer_ptr, nbytes))
 *             return nbytes, data             # <<<<<<<<<<<<<<
 *         else:
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_data);
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":502
 *         if nbytes == -2:
 *             raise e.OperationalError(f"receiving copy data failed: {error_message(self)}")
 *         if buffer_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             data = PyMemoryView_FromObject(
 *                 PQBuffer._from_buffer(<unsigned char *>buffer_ptr, nbytes))
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":507
 *             return nbytes, data
 *         else:
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview             # <<<<<<<<<<<<<<
 * 
 *     def encrypt_password(
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_INCREF(__pyx_kp_b__12);
    __Pyx_GIVEREF(__pyx_kp_b__12);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_kp_b__12);
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgconn.pyx":496
 *         return rv
 * 
 *     def get_copy_data(self, int async_) -> Tuple[int, memoryview]:             # <<<<<<<<<<<<<<
 *         cdef char *buffer_ptr = NULL
 *         cdef int nbytes
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.get_copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":509
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_69encrypt_password(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_69encrypt_password = {"encrypt_password", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_69encrypt_password, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_69encrypt_password(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  char const *__pyx_v_passwd;
  char const *__pyx_v_user;
  PyObject *__pyx_v_algorithm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("encrypt_password (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_passwd,&__pyx_n_s_user,&__pyx_n_s_algorithm,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_passwd,&__pyx_n_s_user,&__pyx_n_s_algorithm,0};
    #endif
    PyObject* values[3] = {0,0,0};

    /* "psycopg_c/pq/pgconn.pyx":510
 * 
 *     def encrypt_password(
 *         self, const char *passwd, const char *user, algorithm = None             # <<<<<<<<<<<<<<
 *     ) -> bytes:
 *         if libpq.PG_VERSION_NUM < 100000:
 */
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_passwd)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_user)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("encrypt_password", 0, 2, 3, 1); __PYX_ERR(0, 509, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_algorithm);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 509, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "encrypt_password") < 0)) __PYX_ERR(0, 509, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_passwd = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_passwd) && PyErr_Occurred())) __PYX_ERR(0, 510, __pyx_L3_error)
    __pyx_v_user = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_user) && PyErr_Occurred())) __PYX_ERR(0, 510, __pyx_L3_error)
    __pyx_v_algorithm = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("encrypt_password", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 509, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.encrypt_password", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_68encrypt_password(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), __pyx_v_passwd, __pyx_v_user, __pyx_v_algorithm);

  /* "psycopg_c/pq/pgconn.pyx":509
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_68encrypt_password(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_passwd, char const *__pyx_v_user, PyObject *__pyx_v_algorithm) {
  char *__pyx_v_out;
  char const *__pyx_v_calgo;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  char const *__pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encrypt_password", 0);

  /* "psycopg_c/pq/pgconn.pyx":512
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
 *         if libpq.PG_VERSION_NUM < 100000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQencryptPasswordConn requires libpq from PostgreSQL 10,"
 */
  __pyx_t_1 = (PG_VERSION_NUM < 0x186A0);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":513
 *     ) -> bytes:
 *         if libpq.PG_VERSION_NUM < 100000:
 *             raise e.NotSupportedError(             # <<<<<<<<<<<<<<
 *                 f"PQencryptPasswordConn requires libpq from PostgreSQL 10,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NotSupportedError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_c/pq/pgconn.pyx":514
 *         if libpq.PG_VERSION_NUM < 100000:
 *             raise e.NotSupportedError(
 *                 f"PQencryptPasswordConn requires libpq from PostgreSQL 10,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_PQencryptPasswordConn_requires_l);
    __pyx_t_5 += 57;
    __Pyx_GIVEREF(__pyx_kp_u_PQencryptPasswordConn_requires_l);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_PQencryptPasswordConn_requires_l);

    /* "psycopg_c/pq/pgconn.pyx":515
 *             raise e.NotSupportedError(
 *                 f"PQencryptPasswordConn requires libpq from PostgreSQL 10,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_int(PG_VERSION_NUM, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_available_instead);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_available_instead);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_available_instead);

    /* "psycopg_c/pq/pgconn.pyx":514
 *         if libpq.PG_VERSION_NUM < 100000:
 *             raise e.NotSupportedError(
 *                 f"PQencryptPasswordConn requires libpq from PostgreSQL 10,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 513, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":512
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
 *         if libpq.PG_VERSION_NUM < 100000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQencryptPasswordConn requires libpq from PostgreSQL 10,"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":519
 * 
 *         cdef char *out
 *         cdef const char *calgo = NULL             # <<<<<<<<<<<<<<
 *         if algorithm:
 *             calgo = algorithm
 */
  __pyx_v_calgo = NULL;

  /* "psycopg_c/pq/pgconn.pyx":520
 *         cdef char *out
 *         cdef const char *calgo = NULL
 *         if algorithm:             # <<<<<<<<<<<<<<
 *             calgo = algorithm
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_algorithm); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 520, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":521
 *         cdef const char *calgo = NULL
 *         if algorithm:
 *             calgo = algorithm             # <<<<<<<<<<<<<<
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:
 */
    __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_algorithm); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 521, __pyx_L1_error)
    __pyx_v_calgo = __pyx_t_9;

    /* "psycopg_c/pq/pgconn.pyx":520
 *         cdef char *out
 *         cdef const char *calgo = NULL
 *         if algorithm:             # <<<<<<<<<<<<<<
 *             calgo = algorithm
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":522
 *         if algorithm:
 *             calgo = algorithm
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)             # <<<<<<<<<<<<<<
 *         if not out:
 *             raise e.OperationalError(
 */
  __pyx_v_out = PQencryptPasswordConn(__pyx_v_self->_pgconn_ptr, __pyx_v_passwd, __pyx_v_user, __pyx_v_calgo);

  /* "psycopg_c/pq/pgconn.pyx":523
 *             calgo = algorithm
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"password encryption failed: {error_message(self)}"
 */
  __pyx_t_1 = (!(__pyx_v_out != 0));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":524
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"password encryption failed: {error_message(self)}"
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":525
 *         if not out:
 *             raise e.OperationalError(
 *                 f"password encryption failed: {error_message(self)}"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, ((PyObject *)__pyx_v_self)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_password_encryption_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 524, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":523
 *             calgo = algorithm
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"password encryption failed: {error_message(self)}"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":528
 *             )
 * 
 *         rv = bytes(out)             # <<<<<<<<<<<<<<
 *         libpq.PQfreemem(out)
 *         return rv
 */
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_out); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_rv = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "psycopg_c/pq/pgconn.pyx":529
 * 
 *         rv = bytes(out)
 *         libpq.PQfreemem(out)             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  PQfreemem(__pyx_v_out);

  /* "psycopg_c/pq/pgconn.pyx":530
 *         rv = bytes(out)
 *         libpq.PQfreemem(out)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":509
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.encrypt_password", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":532
 *         return rv
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = libpq.PQmakeEmptyPGresult(
 *             self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 */

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_71make_empty_result(PyObject *__pyx_v_self, PyObject *__pyx_arg_exec_status); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_71make_empty_result = {"make_empty_result", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_71make_empty_result, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_71make_empty_result(PyObject *__pyx_v_self, PyObject *__pyx_arg_exec_status) {
  int __pyx_v_exec_status;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_empty_result (wrapper)", 0);
  assert(__pyx_arg_exec_status); {
    __pyx_v_exec_status = __Pyx_PyInt_As_int(__pyx_arg_exec_status); if (unlikely((__pyx_v_exec_status == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.make_empty_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_70make_empty_result(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((int)__pyx_v_exec_status));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_70make_empty_result(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, int __pyx_v_exec_status) {
  PGresult *__pyx_v_rv;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_empty_result", 0);

  /* "psycopg_c/pq/pgconn.pyx":533
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:
 *         cdef libpq.PGresult *rv = libpq.PQmakeEmptyPGresult(             # <<<<<<<<<<<<<<
 *             self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 *         if not rv:
 */
  __pyx_v_rv = PQmakeEmptyPGresult(__pyx_v_self->_pgconn_ptr, ((ExecStatusType)__pyx_v_exec_status));

  /* "psycopg_c/pq/pgconn.pyx":535
 *         cdef libpq.PGresult *rv = libpq.PQmakeEmptyPGresult(
 *             self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate empty PGresult")
 *         return PGresult._from_ptr(rv)
 */
  __pyx_t_1 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":536
 *             self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 *         if not rv:
 *             raise MemoryError("couldn't allocate empty PGresult")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(rv)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 536, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":535
 *         cdef libpq.PGresult *rv = libpq.PQmakeEmptyPGresult(
 *             self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate empty PGresult")
 *         return PGresult._from_ptr(rv)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":537
 *         if not rv:
 *             raise MemoryError("couldn't allocate empty PGresult")
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":532
 *         return rv
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = libpq.PQmakeEmptyPGresult(
 *             self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.make_empty_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":539
 *         return PGresult._from_ptr(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pipeline_status(self) -> int:
 *         """The current pipeline mode status.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_15pipeline_status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_15pipeline_status_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_15pipeline_status___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_15pipeline_status___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":545
 *         For libpq < 14.0, always return 0 (PQ_PIPELINE_OFF).
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef int status = libpq.PQpipelineStatus(self._pgconn_ptr)
 */
  __pyx_t_1 = (PG_VERSION_NUM < 0x222E0);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":546
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:
 *             return libpq.PQ_PIPELINE_OFF             # <<<<<<<<<<<<<<
 *         cdef int status = libpq.PQpipelineStatus(self._pgconn_ptr)
 *         return status
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_PGpipelineStatus(PQ_PIPELINE_OFF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":545
 *         For libpq < 14.0, always return 0 (PQ_PIPELINE_OFF).
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef int status = libpq.PQpipelineStatus(self._pgconn_ptr)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":547
 *         if libpq.PG_VERSION_NUM < 140000:
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef int status = libpq.PQpipelineStatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return status
 * 
 */
  __pyx_v_status = PQpipelineStatus(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":548
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef int status = libpq.PQpipelineStatus(self._pgconn_ptr)
 *         return status             # <<<<<<<<<<<<<<
 * 
 *     def enter_pipeline_mode(self) -> None:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":539
 *         return PGresult._from_ptr(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pipeline_status(self) -> int:
 *         """The current pipeline mode status.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.pipeline_status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":550
 *         return status
 * 
 *     def enter_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enter pipeline mode.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_73enter_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_9psycopg_c_2pq_6PGconn_72enter_pipeline_mode, "Enter pipeline mode.\n\n        :raises ~e.OperationalError: in case of failure to enter the pipeline\n            mode.\n        ");
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_73enter_pipeline_mode = {"enter_pipeline_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_73enter_pipeline_mode, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_72enter_pipeline_mode};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_73enter_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enter_pipeline_mode (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_72enter_pipeline_mode(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_72enter_pipeline_mode(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enter_pipeline_mode", 0);

  /* "psycopg_c/pq/pgconn.pyx":556
 *             mode.
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQenterPipelineMode requires libpq from PostgreSQL 14,"
 */
  __pyx_t_1 = (PG_VERSION_NUM < 0x222E0);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":557
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(             # <<<<<<<<<<<<<<
 *                 f"PQenterPipelineMode requires libpq from PostgreSQL 14,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NotSupportedError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_c/pq/pgconn.pyx":558
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(
 *                 f"PQenterPipelineMode requires libpq from PostgreSQL 14,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_PQenterPipelineMode_requires_lib);
    __pyx_t_5 += 55;
    __Pyx_GIVEREF(__pyx_kp_u_PQenterPipelineMode_requires_lib);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_PQenterPipelineMode_requires_lib);

    /* "psycopg_c/pq/pgconn.pyx":559
 *             raise e.NotSupportedError(
 *                 f"PQenterPipelineMode requires libpq from PostgreSQL 14,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"             # <<<<<<<<<<<<<<
 *             )
 *         if libpq.PQenterPipelineMode(self._pgconn_ptr) != 1:
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_int(PG_VERSION_NUM, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_available_instead);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_available_instead);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_available_instead);

    /* "psycopg_c/pq/pgconn.pyx":558
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(
 *                 f"PQenterPipelineMode requires libpq from PostgreSQL 14,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 557, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":556
 *             mode.
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQenterPipelineMode requires libpq from PostgreSQL 14,"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":561
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 *         if libpq.PQenterPipelineMode(self._pgconn_ptr) != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
 */
  __pyx_t_1 = (PQenterPipelineMode(__pyx_v_self->_pgconn_ptr) != 1);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":562
 *             )
 *         if libpq.PQenterPipelineMode(self._pgconn_ptr) != 1:
 *             raise e.OperationalError("failed to enter pipeline mode")             # <<<<<<<<<<<<<<
 * 
 *     def exit_pipeline_mode(self) -> None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_failed_to_enter_pipeline_mode};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 562, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":561
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 *         if libpq.PQenterPipelineMode(self._pgconn_ptr) != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":550
 *         return status
 * 
 *     def enter_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enter pipeline mode.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.enter_pipeline_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":564
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
 *     def exit_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Exit pipeline mode.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_75exit_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_9psycopg_c_2pq_6PGconn_74exit_pipeline_mode, "Exit pipeline mode.\n\n        :raises ~e.OperationalError: in case of failure to exit the pipeline\n            mode.\n        ");
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_75exit_pipeline_mode = {"exit_pipeline_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_75exit_pipeline_mode, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_74exit_pipeline_mode};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_75exit_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exit_pipeline_mode (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_74exit_pipeline_mode(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_74exit_pipeline_mode(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exit_pipeline_mode", 0);

  /* "psycopg_c/pq/pgconn.pyx":570
 *             mode.
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQexitPipelineMode requires libpq from PostgreSQL 14,"
 */
  __pyx_t_1 = (PG_VERSION_NUM < 0x222E0);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":571
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(             # <<<<<<<<<<<<<<
 *                 f"PQexitPipelineMode requires libpq from PostgreSQL 14,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NotSupportedError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_c/pq/pgconn.pyx":572
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(
 *                 f"PQexitPipelineMode requires libpq from PostgreSQL 14,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_PQexitPipelineMode_requires_libp);
    __pyx_t_5 += 54;
    __Pyx_GIVEREF(__pyx_kp_u_PQexitPipelineMode_requires_libp);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_PQexitPipelineMode_requires_libp);

    /* "psycopg_c/pq/pgconn.pyx":573
 *             raise e.NotSupportedError(
 *                 f"PQexitPipelineMode requires libpq from PostgreSQL 14,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"             # <<<<<<<<<<<<<<
 *             )
 *         if libpq.PQexitPipelineMode(self._pgconn_ptr) != 1:
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_int(PG_VERSION_NUM, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_available_instead);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_available_instead);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_available_instead);

    /* "psycopg_c/pq/pgconn.pyx":572
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(
 *                 f"PQexitPipelineMode requires libpq from PostgreSQL 14,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 571, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":570
 *             mode.
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQexitPipelineMode requires libpq from PostgreSQL 14,"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":575
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 *         if libpq.PQexitPipelineMode(self._pgconn_ptr) != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(error_message(self))
 * 
 */
  __pyx_t_1 = (PQexitPipelineMode(__pyx_v_self->_pgconn_ptr) != 1);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":576
 *             )
 *         if libpq.PQexitPipelineMode(self._pgconn_ptr) != 1:
 *             raise e.OperationalError(error_message(self))             # <<<<<<<<<<<<<<
 * 
 *     def pipeline_sync(self) -> None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, ((PyObject *)__pyx_v_self)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 576, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":575
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 *         if libpq.PQexitPipelineMode(self._pgconn_ptr) != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(error_message(self))
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":564
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
 *     def exit_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Exit pipeline mode.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.exit_pipeline_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":578
 *             raise e.OperationalError(error_message(self))
 * 
 *     def pipeline_sync(self) -> None:             # <<<<<<<<<<<<<<
 *         """Mark a synchronization point in a pipeline.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_77pipeline_sync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_9psycopg_c_2pq_6PGconn_76pipeline_sync, "Mark a synchronization point in a pipeline.\n\n        :raises ~e.OperationalError: if the connection is not in pipeline mode\n            or if sync failed.\n        ");
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_77pipeline_sync = {"pipeline_sync", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_77pipeline_sync, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_76pipeline_sync};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_77pipeline_sync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pipeline_sync (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_76pipeline_sync(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_76pipeline_sync(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pipeline_sync", 0);

  /* "psycopg_c/pq/pgconn.pyx":584
 *             or if sync failed.
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQpipelineSync requires libpq from PostgreSQL 14,"
 */
  __pyx_t_1 = (PG_VERSION_NUM < 0x222E0);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":585
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(             # <<<<<<<<<<<<<<
 *                 f"PQpipelineSync requires libpq from PostgreSQL 14,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NotSupportedError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_c/pq/pgconn.pyx":586
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(
 *                 f"PQpipelineSync requires libpq from PostgreSQL 14,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_PQpipelineSync_requires_libpq_fr);
    __pyx_t_5 += 50;
    __Pyx_GIVEREF(__pyx_kp_u_PQpipelineSync_requires_libpq_fr);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_PQpipelineSync_requires_libpq_fr);

    /* "psycopg_c/pq/pgconn.pyx":587
 *             raise e.NotSupportedError(
 *                 f"PQpipelineSync requires libpq from PostgreSQL 14,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"             # <<<<<<<<<<<<<<
 *             )
 *         rv = libpq.PQpipelineSync(self._pgconn_ptr)
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_int(PG_VERSION_NUM, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_available_instead);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_available_instead);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_available_instead);

    /* "psycopg_c/pq/pgconn.pyx":586
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(
 *                 f"PQpipelineSync requires libpq from PostgreSQL 14,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 585, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":584
 *             or if sync failed.
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQpipelineSync requires libpq from PostgreSQL 14,"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":589
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 *         rv = libpq.PQpipelineSync(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv == 0:
 *             raise e.OperationalError("connection not in pipeline mode")
 */
  __pyx_v_rv = PQpipelineSync(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":590
 *             )
 *         rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:
 */
  __pyx_t_1 = (__pyx_v_rv == 0);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":591
 *         rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:
 *             raise e.OperationalError("connection not in pipeline mode")             # <<<<<<<<<<<<<<
 *         if rv != 1:
 *             raise e.OperationalError("failed to sync pipeline")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_connection_not_in_pipeline_mode};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 591, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":590
 *             )
 *         rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":592
 *         if rv == 0:
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to sync pipeline")
 * 
 */
  __pyx_t_1 = (__pyx_v_rv != 1);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":593
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:
 *             raise e.OperationalError("failed to sync pipeline")             # <<<<<<<<<<<<<<
 * 
 *     def send_flush_request(self) -> None:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_e); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_failed_to_sync_pipeline};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 593, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":592
 *         if rv == 0:
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to sync pipeline")
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":578
 *             raise e.OperationalError(error_message(self))
 * 
 *     def pipeline_sync(self) -> None:             # <<<<<<<<<<<<<<
 *         """Mark a synchronization point in a pipeline.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.pipeline_sync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":595
 *             raise e.OperationalError("failed to sync pipeline")
 * 
 *     def send_flush_request(self) -> None:             # <<<<<<<<<<<<<<
 *         """Sends a request for the server to flush its output buffer.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_79send_flush_request(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_9psycopg_c_2pq_6PGconn_78send_flush_request, "Sends a request for the server to flush its output buffer.\n\n        :raises ~e.OperationalError: if the flush request failed.\n        ");
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_79send_flush_request = {"send_flush_request", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_79send_flush_request, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_78send_flush_request};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_79send_flush_request(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_flush_request (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_78send_flush_request(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_78send_flush_request(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_flush_request", 0);

  /* "psycopg_c/pq/pgconn.pyx":600
 *         :raises ~e.OperationalError: if the flush request failed.
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQsendFlushRequest requires libpq from PostgreSQL 14,"
 */
  __pyx_t_1 = (PG_VERSION_NUM < 0x222E0);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":601
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(             # <<<<<<<<<<<<<<
 *                 f"PQsendFlushRequest requires libpq from PostgreSQL 14,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NotSupportedError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_c/pq/pgconn.pyx":602
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(
 *                 f"PQsendFlushRequest requires libpq from PostgreSQL 14,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_PQsendFlushRequest_requires_libp);
    __pyx_t_5 += 54;
    __Pyx_GIVEREF(__pyx_kp_u_PQsendFlushRequest_requires_libp);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_PQsendFlushRequest_requires_libp);

    /* "psycopg_c/pq/pgconn.pyx":603
 *             raise e.NotSupportedError(
 *                 f"PQsendFlushRequest requires libpq from PostgreSQL 14,"
 *                 f" {libpq.PG_VERSION_NUM} available instead"             # <<<<<<<<<<<<<<
 *             )
 *         cdef int rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_int(PG_VERSION_NUM, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_available_instead);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_available_instead);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_available_instead);

    /* "psycopg_c/pq/pgconn.pyx":602
 *         if libpq.PG_VERSION_NUM < 140000:
 *             raise e.NotSupportedError(
 *                 f"PQsendFlushRequest requires libpq from PostgreSQL 14,"             # <<<<<<<<<<<<<<
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 601, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":600
 *         :raises ~e.OperationalError: if the flush request failed.
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError(
 *                 f"PQsendFlushRequest requires libpq from PostgreSQL 14,"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":605
 *                 f" {libpq.PG_VERSION_NUM} available instead"
 *             )
 *         cdef int rv = libpq.PQsendFlushRequest(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv == 0:
 *             raise e.OperationalError(f"flush request failed: {error_message(self)}")
 */
  __pyx_v_rv = PQsendFlushRequest(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":606
 *             )
 *         cdef int rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"flush request failed: {error_message(self)}")
 * 
 */
  __pyx_t_1 = (__pyx_v_rv == 0);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":607
 *         cdef int rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:
 *             raise e.OperationalError(f"flush request failed: {error_message(self)}")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, ((PyObject *)__pyx_v_self)};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_flush_request_failed, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 607, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":606
 *             )
 *         cdef int rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"flush request failed: {error_message(self)}")
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":595
 *             raise e.OperationalError("failed to sync pipeline")
 * 
 *     def send_flush_request(self) -> None:             # <<<<<<<<<<<<<<
 *         """Sends a request for the server to flush its output buffer.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_flush_request", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq.pxd":23
 *     cdef libpq.PGconn* _pgconn_ptr
 *     cdef object __weakref__
 *     cdef public object notice_handler             # <<<<<<<<<<<<<<
 *     cdef public object notify_handler
 *     cdef pid_t _procpid
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_14notice_handler_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_14notice_handler_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_14notice_handler___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_14notice_handler___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->notice_handler);
  __pyx_r = __pyx_v_self->notice_handler;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_6PGconn_14notice_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_6PGconn_14notice_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_14notice_handler_2__set__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_6PGconn_14notice_handler_2__set__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->notice_handler);
  __Pyx_DECREF(__pyx_v_self->notice_handler);
  __pyx_v_self->notice_handler = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_6PGconn_14notice_handler_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_6PGconn_14notice_handler_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_14notice_handler_4__del__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_6PGconn_14notice_handler_4__del__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->notice_handler);
  __Pyx_DECREF(__pyx_v_self->notice_handler);
  __pyx_v_self->notice_handler = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq.pxd":24
 *     cdef object __weakref__
 *     cdef public object notice_handler
 *     cdef public object notify_handler             # <<<<<<<<<<<<<<
 *     cdef pid_t _procpid
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_14notify_handler_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_14notify_handler_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_14notify_handler___get__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_14notify_handler___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->notify_handler);
  __pyx_r = __pyx_v_self->notify_handler;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_6PGconn_14notify_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_6PGconn_14notify_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_14notify_handler_2__set__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_6PGconn_14notify_handler_2__set__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->notify_handler);
  __Pyx_DECREF(__pyx_v_self->notify_handler);
  __pyx_v_self->notify_handler = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_6PGconn_14notify_handler_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_6PGconn_14notify_handler_5__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_14notify_handler_4__del__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_6PGconn_14notify_handler_4__del__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->notify_handler);
  __Pyx_DECREF(__pyx_v_self->notify_handler);
  __pyx_v_self->notify_handler = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_81__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_81__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_81__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_81__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_80__reduce_cython__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_80__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_83__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_83__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_83__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_83__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_82__setstate_cython__(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_82__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":610
 * 
 * 
 * cdef int _ensure_pgconn(PGconn pgconn) except 0:             # <<<<<<<<<<<<<<
 *     if pgconn._pgconn_ptr is not NULL:
 *         return 1
 */

static int __pyx_f_9psycopg_c_2pq__ensure_pgconn(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_pgconn) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ensure_pgconn", 0);

  /* "psycopg_c/pq/pgconn.pyx":611
 * 
 * cdef int _ensure_pgconn(PGconn pgconn) except 0:
 *     if pgconn._pgconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */
  __pyx_t_1 = (__pyx_v_pgconn->_pgconn_ptr != NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":612
 * cdef int _ensure_pgconn(PGconn pgconn) except 0:
 *     if pgconn._pgconn_ptr is not NULL:
 *         return 1             # <<<<<<<<<<<<<<
 * 
 *     raise e.OperationalError("the connection is closed")
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":611
 * 
 * cdef int _ensure_pgconn(PGconn pgconn) except 0:
 *     if pgconn._pgconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":614
 *         return 1
 * 
 *     raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_the_connection_is_closed};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(0, 614, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":610
 * 
 * 
 * cdef int _ensure_pgconn(PGconn pgconn) except 0:             # <<<<<<<<<<<<<<
 *     if pgconn._pgconn_ptr is not NULL:
 *         return 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("psycopg_c.pq._ensure_pgconn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":617
 * 
 * 
 * cdef char *_call_bytes(PGconn pgconn, conn_bytes_f func) except NULL:             # <<<<<<<<<<<<<<
 *     """
 *     Call one of the pgconn libpq functions returning a bytes pointer.
 */

static char *__pyx_f_9psycopg_c_2pq__call_bytes(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_pgconn, __pyx_t_9psycopg_c_2pq_conn_bytes_f __pyx_v_func) {
  char *__pyx_v_rv;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_bytes", 0);

  /* "psycopg_c/pq/pgconn.pyx":621
 *     Call one of the pgconn libpq functions returning a bytes pointer.
 *     """
 *     if not _ensure_pgconn(pgconn):             # <<<<<<<<<<<<<<
 *         return NULL
 *     cdef char *rv = func(pgconn._pgconn_ptr)
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_pgconn); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 621, __pyx_L1_error)
  __pyx_t_2 = (!(__pyx_t_1 != 0));
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":622
 *     """
 *     if not _ensure_pgconn(pgconn):
 *         return NULL             # <<<<<<<<<<<<<<
 *     cdef char *rv = func(pgconn._pgconn_ptr)
 *     assert rv is not NULL
 */
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":621
 *     Call one of the pgconn libpq functions returning a bytes pointer.
 *     """
 *     if not _ensure_pgconn(pgconn):             # <<<<<<<<<<<<<<
 *         return NULL
 *     cdef char *rv = func(pgconn._pgconn_ptr)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":623
 *     if not _ensure_pgconn(pgconn):
 *         return NULL
 *     cdef char *rv = func(pgconn._pgconn_ptr)             # <<<<<<<<<<<<<<
 *     assert rv is not NULL
 *     return rv
 */
  __pyx_v_rv = __pyx_v_func(__pyx_v_pgconn->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":624
 *         return NULL
 *     cdef char *rv = func(pgconn._pgconn_ptr)
 *     assert rv is not NULL             # <<<<<<<<<<<<<<
 *     return rv
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = (__pyx_v_rv != NULL);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(0, 624, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 624, __pyx_L1_error)
  #endif

  /* "psycopg_c/pq/pgconn.pyx":625
 *     cdef char *rv = func(pgconn._pgconn_ptr)
 *     assert rv is not NULL
 *     return rv             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":617
 * 
 * 
 * cdef char *_call_bytes(PGconn pgconn, conn_bytes_f func) except NULL:             # <<<<<<<<<<<<<<
 *     """
 *     Call one of the pgconn libpq functions returning a bytes pointer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq._call_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":628
 * 
 * 
 * cdef int _call_int(PGconn pgconn, conn_int_f func) except -2:             # <<<<<<<<<<<<<<
 *     """
 *     Call one of the pgconn libpq functions returning an int.
 */

static int __pyx_f_9psycopg_c_2pq__call_int(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_pgconn, __pyx_t_9psycopg_c_2pq_conn_int_f __pyx_v_func) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_int", 0);

  /* "psycopg_c/pq/pgconn.pyx":632
 *     Call one of the pgconn libpq functions returning an int.
 *     """
 *     if not _ensure_pgconn(pgconn):             # <<<<<<<<<<<<<<
 *         return -2
 *     return func(pgconn._pgconn_ptr)
 */
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_pgconn); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 632, __pyx_L1_error)
  __pyx_t_2 = (!(__pyx_t_1 != 0));
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":633
 *     """
 *     if not _ensure_pgconn(pgconn):
 *         return -2             # <<<<<<<<<<<<<<
 *     return func(pgconn._pgconn_ptr)
 * 
 */
    __pyx_r = -2;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":632
 *     Call one of the pgconn libpq functions returning an int.
 *     """
 *     if not _ensure_pgconn(pgconn):             # <<<<<<<<<<<<<<
 *         return -2
 *     return func(pgconn._pgconn_ptr)
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":634
 *     if not _ensure_pgconn(pgconn):
 *         return -2
 *     return func(pgconn._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_func(__pyx_v_pgconn->_pgconn_ptr);
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":628
 * 
 * 
 * cdef int _call_int(PGconn pgconn, conn_int_f func) except -2:             # <<<<<<<<<<<<<<
 *     """
 *     Call one of the pgconn libpq functions returning an int.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq._call_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -2;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":637
 * 
 * 
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) with gil:             # <<<<<<<<<<<<<<
 *     cdef PGconn pgconn = <object>arg
 *     if pgconn.notice_handler is None:
 */

static void __pyx_f_9psycopg_c_2pq_notice_receiver(void *__pyx_v_arg, PGresult const *__pyx_v_res_ptr) {
  struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_pgconn = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_res = 0;
  PyObject *__pyx_v_e = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  char const *__pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("notice_receiver", 0);

  /* "psycopg_c/pq/pgconn.pyx":638
 * 
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) with gil:
 *     cdef PGconn pgconn = <object>arg             # <<<<<<<<<<<<<<
 *     if pgconn.notice_handler is None:
 *         return
 */
  if (!(likely(((((PyObject *)__pyx_v_arg)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_arg), __pyx_ptype_9psycopg_c_2pq_PGconn))))) __PYX_ERR(0, 638, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_v_arg);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_pgconn = ((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":639
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) with gil:
 *     cdef PGconn pgconn = <object>arg
 *     if pgconn.notice_handler is None:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = (__pyx_v_pgconn->notice_handler == Py_None);
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":640
 *     cdef PGconn pgconn = <object>arg
 *     if pgconn.notice_handler is None:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)
 */
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":639
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) with gil:
 *     cdef PGconn pgconn = <object>arg
 *     if pgconn.notice_handler is None:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":642
 *         return
 * 
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)             # <<<<<<<<<<<<<<
 *     try:
 *         pgconn.notice_handler(res)
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(((PGresult *)__pyx_v_res_ptr))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":643
 * 
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)
 *     try:             # <<<<<<<<<<<<<<
 *         pgconn.notice_handler(res)
 *     except Exception as e:
 */
  /*try:*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":644
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)
 *     try:
 *         pgconn.notice_handler(res)             # <<<<<<<<<<<<<<
 *     except Exception as e:
 *         logger.exception("error in notice receiver: %s", e)
 */
        __Pyx_INCREF(__pyx_v_pgconn->notice_handler);
        __pyx_t_6 = __pyx_v_pgconn->notice_handler; __pyx_t_7 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_8 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_res)};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "psycopg_c/pq/pgconn.pyx":643
 * 
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)
 *     try:             # <<<<<<<<<<<<<<
 *         pgconn.notice_handler(res)
 *     except Exception as e:
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L12_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "psycopg_c/pq/pgconn.pyx":645
 *     try:
 *         pgconn.notice_handler(res)
 *     except Exception as e:             # <<<<<<<<<<<<<<
 *         logger.exception("error in notice receiver: %s", e)
 *     finally:
 */
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
      if (__pyx_t_8) {
        __Pyx_AddTraceback("psycopg_c.pq.notice_receiver", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 645, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_v_e = __pyx_t_6;
        /*try:*/ {

          /* "psycopg_c/pq/pgconn.pyx":646
 *         pgconn.notice_handler(res)
 *     except Exception as e:
 *         logger.exception("error in notice receiver: %s", e)             # <<<<<<<<<<<<<<
 *     finally:
 *         res._pgresult_ptr = NULL  # avoid destroying the pgresult_ptr
 */
          __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 646, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_exception); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 646, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = NULL;
          __pyx_t_8 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_11, function);
              __pyx_t_8 = 1;
            }
          }
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_kp_u_error_in_notice_receiver_s, __pyx_v_e};
            __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 646, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }

        /* "psycopg_c/pq/pgconn.pyx":645
 *     try:
 *         pgconn.notice_handler(res)
 *     except Exception as e:             # <<<<<<<<<<<<<<
 *         logger.exception("error in notice receiver: %s", e)
 *     finally:
 */
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            goto __pyx_L19;
          }
          __pyx_L18_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __pyx_t_8 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
            }
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
            __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
            __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
            goto __pyx_L9_except_error;
          }
          __pyx_L19:;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L8_exception_handled;
      }
      goto __pyx_L9_except_error;
      __pyx_L9_except_error:;

      /* "psycopg_c/pq/pgconn.pyx":643
 * 
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)
 *     try:             # <<<<<<<<<<<<<<
 *         pgconn.notice_handler(res)
 *     except Exception as e:
 */
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L5_error;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L12_try_end:;
    }
  }

  /* "psycopg_c/pq/pgconn.pyx":648
 *         logger.exception("error in notice receiver: %s", e)
 *     finally:
 *         res._pgresult_ptr = NULL  # avoid destroying the pgresult_ptr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_v_res->_pgresult_ptr = NULL;
      goto __pyx_L6;
    }
    __pyx_L5_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_12 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
      {
        __pyx_v_res->_pgresult_ptr = NULL;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_3);
      __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_20;
      goto __pyx_L1_error;
    }
    __pyx_L6:;
  }

  /* "psycopg_c/pq/pgconn.pyx":637
 * 
 * 
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) with gil:             # <<<<<<<<<<<<<<
 *     cdef PGconn pgconn = <object>arg
 *     if pgconn.notice_handler is None:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_WriteUnraisable("psycopg_c.pq.notice_receiver", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pgconn);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "psycopg_c/pq/pgconn.pyx":651
 * 
 * 
 * cdef (Py_ssize_t, libpq.Oid *, char * const*, int *, int *) _query_params_args(             # <<<<<<<<<<<<<<
 *     list param_values: Optional[Sequence[Optional[bytes]]],
 *     param_types: Optional[Sequence[int]],
 */

static __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc __pyx_f_9psycopg_c_2pq__query_params_args(PyObject *__pyx_v_param_values, PyObject *__pyx_v_param_types, PyObject *__pyx_v_param_formats) {
  int __pyx_v_i;
  PyObject *__pyx_v_tparam_types = 0;
  Py_ssize_t __pyx_v_nparams;
  char **__pyx_v_aparams;
  int *__pyx_v_alenghts;
  char *__pyx_v_ptr;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_obj = NULL;
  Oid *__pyx_v_atypes;
  int *__pyx_v_aformats;
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  Oid __pyx_t_11;
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst__ptr__and_int__ptr__and_int__ptr__etc __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_query_params_args", 0);

  /* "psycopg_c/pq/pgconn.pyx":661
 *     # is most often no-op
 *     cdef tuple tparam_types
 *     if param_types is not None and not isinstance(param_types, tuple):             # <<<<<<<<<<<<<<
 *         tparam_types = tuple(param_types)
 *     else:
 */
  __pyx_t_2 = (__pyx_v_param_types != Py_None);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyTuple_Check(__pyx_v_param_types); 
  __pyx_t_3 = (!__pyx_t_2);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":662
 *     cdef tuple tparam_types
 *     if param_types is not None and not isinstance(param_types, tuple):
 *         tparam_types = tuple(param_types)             # <<<<<<<<<<<<<<
 *     else:
 *         tparam_types = param_types
 */
    __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_param_types); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_tparam_types = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":661
 *     # is most often no-op
 *     cdef tuple tparam_types
 *     if param_types is not None and not isinstance(param_types, tuple):             # <<<<<<<<<<<<<<
 *         tparam_types = tuple(param_types)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "psycopg_c/pq/pgconn.pyx":664
 *         tparam_types = tuple(param_types)
 *     else:
 *         tparam_types = param_types             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t nparams = len(param_values) if param_values else 0
 */
  /*else*/ {
    if (!(likely(PyTuple_CheckExact(__pyx_v_param_types))||((__pyx_v_param_types) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v_param_types))) __PYX_ERR(0, 664, __pyx_L1_error)
    __pyx_t_4 = __pyx_v_param_types;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_tparam_types = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "psycopg_c/pq/pgconn.pyx":666
 *         tparam_types = param_types
 * 
 *     cdef Py_ssize_t nparams = len(param_values) if param_values else 0             # <<<<<<<<<<<<<<
 *     if tparam_types is not None and len(tparam_types) != nparams:
 *         raise ValueError(
 */
  __pyx_t_1 = (__pyx_v_param_values != Py_None)&&(PyList_GET_SIZE(__pyx_v_param_values) != 0);
  if (__pyx_t_1) {
    if (unlikely(__pyx_v_param_values == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 666, __pyx_L1_error)
    }
    __pyx_t_6 = PyList_GET_SIZE(__pyx_v_param_values); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 666, __pyx_L1_error)
    __pyx_t_5 = __pyx_t_6;
  } else {
    __pyx_t_5 = 0;
  }
  __pyx_v_nparams = __pyx_t_5;

  /* "psycopg_c/pq/pgconn.pyx":667
 * 
 *     cdef Py_ssize_t nparams = len(param_values) if param_values else 0
 *     if tparam_types is not None and len(tparam_types) != nparams:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "got %d param_values but %d param_types"
 */
  __pyx_t_3 = (__pyx_v_tparam_types != ((PyObject*)Py_None));
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L7_bool_binop_done;
  }
  if (unlikely(__pyx_v_tparam_types == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 667, __pyx_L1_error)
  }
  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v_tparam_types); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 667, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_5 != __pyx_v_nparams);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L7_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":669
 *     if tparam_types is not None and len(tparam_types) != nparams:
 *         raise ValueError(
 *             "got %d param_values but %d param_types"             # <<<<<<<<<<<<<<
 *             % (nparams, len(tparam_types))
 *         )
 */
    __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_got);
    __pyx_t_5 += 4;
    __Pyx_GIVEREF(__pyx_kp_u_got);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_got);

    /* "psycopg_c/pq/pgconn.pyx":670
 *         raise ValueError(
 *             "got %d param_values but %d param_types"
 *             % (nparams, len(tparam_types))             # <<<<<<<<<<<<<<
 *         )
 *     if param_formats is not None and len(param_formats) != nparams:
 */
    __pyx_t_8 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_nparams, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u_param_values_but);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_param_values_but);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_param_values_but);
    if (unlikely(__pyx_v_tparam_types == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 670, __pyx_L1_error)
    }
    __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v_tparam_types); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 670, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_6, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u_param_types_2);
    __pyx_t_5 += 12;
    __Pyx_GIVEREF(__pyx_kp_u_param_types_2);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_param_types_2);

    /* "psycopg_c/pq/pgconn.pyx":669
 *     if tparam_types is not None and len(tparam_types) != nparams:
 *         raise ValueError(
 *             "got %d param_values but %d param_types"             # <<<<<<<<<<<<<<
 *             % (nparams, len(tparam_types))
 *         )
 */
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":668
 *     cdef Py_ssize_t nparams = len(param_values) if param_values else 0
 *     if tparam_types is not None and len(tparam_types) != nparams:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "got %d param_values but %d param_types"
 *             % (nparams, len(tparam_types))
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 668, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":667
 * 
 *     cdef Py_ssize_t nparams = len(param_values) if param_values else 0
 *     if tparam_types is not None and len(tparam_types) != nparams:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "got %d param_values but %d param_types"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":672
 *             % (nparams, len(tparam_types))
 *         )
 *     if param_formats is not None and len(param_formats) != nparams:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "got %d param_values but %d param_formats"
 */
  __pyx_t_3 = (__pyx_v_param_formats != ((PyObject*)Py_None));
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L10_bool_binop_done;
  }
  if (unlikely(__pyx_v_param_formats == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 672, __pyx_L1_error)
  }
  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_param_formats); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 672, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_5 != __pyx_v_nparams);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L10_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":674
 *     if param_formats is not None and len(param_formats) != nparams:
 *         raise ValueError(
 *             "got %d param_values but %d param_formats"             # <<<<<<<<<<<<<<
 *             % (nparams, len(param_formats))
 *         )
 */
    __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_got);
    __pyx_t_5 += 4;
    __Pyx_GIVEREF(__pyx_kp_u_got);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_got);

    /* "psycopg_c/pq/pgconn.pyx":675
 *         raise ValueError(
 *             "got %d param_values but %d param_formats"
 *             % (nparams, len(param_formats))             # <<<<<<<<<<<<<<
 *         )
 * 
 */
    __pyx_t_8 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_nparams, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u_param_values_but);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_param_values_but);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_param_values_but);
    if (unlikely(__pyx_v_param_formats == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 675, __pyx_L1_error)
    }
    __pyx_t_6 = PyList_GET_SIZE(__pyx_v_param_formats); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 675, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_6, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u_param_formats_2);
    __pyx_t_5 += 14;
    __Pyx_GIVEREF(__pyx_kp_u_param_formats_2);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_param_formats_2);

    /* "psycopg_c/pq/pgconn.pyx":674
 *     if param_formats is not None and len(param_formats) != nparams:
 *         raise ValueError(
 *             "got %d param_values but %d param_formats"             # <<<<<<<<<<<<<<
 *             % (nparams, len(param_formats))
 *         )
 */
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":673
 *         )
 *     if param_formats is not None and len(param_formats) != nparams:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "got %d param_values but %d param_formats"
 *             % (nparams, len(param_formats))
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 673, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":672
 *             % (nparams, len(tparam_types))
 *         )
 *     if param_formats is not None and len(param_formats) != nparams:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "got %d param_values but %d param_formats"
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":678
 *         )
 * 
 *     cdef char **aparams = NULL             # <<<<<<<<<<<<<<
 *     cdef int *alenghts = NULL
 *     cdef char *ptr
 */
  __pyx_v_aparams = NULL;

  /* "psycopg_c/pq/pgconn.pyx":679
 * 
 *     cdef char **aparams = NULL
 *     cdef int *alenghts = NULL             # <<<<<<<<<<<<<<
 *     cdef char *ptr
 *     cdef Py_ssize_t length
 */
  __pyx_v_alenghts = NULL;

  /* "psycopg_c/pq/pgconn.pyx":683
 *     cdef Py_ssize_t length
 * 
 *     if nparams:             # <<<<<<<<<<<<<<
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
 */
  __pyx_t_1 = (__pyx_v_nparams != 0);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":684
 * 
 *     if nparams:
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))             # <<<<<<<<<<<<<<
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
 *         for i in range(nparams):
 */
    __pyx_v_aparams = ((char **)PyMem_Malloc((__pyx_v_nparams * (sizeof(char *)))));

    /* "psycopg_c/pq/pgconn.pyx":685
 *     if nparams:
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))             # <<<<<<<<<<<<<<
 *         for i in range(nparams):
 *             obj = param_values[i]
 */
    __pyx_v_alenghts = ((int *)PyMem_Malloc((__pyx_v_nparams * (sizeof(int)))));

    /* "psycopg_c/pq/pgconn.pyx":686
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
 *         for i in range(nparams):             # <<<<<<<<<<<<<<
 *             obj = param_values[i]
 *             if obj is None:
 */
    __pyx_t_5 = __pyx_v_nparams;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
      __pyx_v_i = __pyx_t_9;

      /* "psycopg_c/pq/pgconn.pyx":687
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
 *         for i in range(nparams):
 *             obj = param_values[i]             # <<<<<<<<<<<<<<
 *             if obj is None:
 *                 aparams[i] = NULL
 */
      if (unlikely(__pyx_v_param_values == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 687, __pyx_L1_error)
      }
      __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_param_values, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "psycopg_c/pq/pgconn.pyx":688
 *         for i in range(nparams):
 *             obj = param_values[i]
 *             if obj is None:             # <<<<<<<<<<<<<<
 *                 aparams[i] = NULL
 *                 alenghts[i] = 0
 */
      __pyx_t_1 = (__pyx_v_obj == Py_None);
      if (__pyx_t_1) {

        /* "psycopg_c/pq/pgconn.pyx":689
 *             obj = param_values[i]
 *             if obj is None:
 *                 aparams[i] = NULL             # <<<<<<<<<<<<<<
 *                 alenghts[i] = 0
 *             else:
 */
        (__pyx_v_aparams[__pyx_v_i]) = NULL;

        /* "psycopg_c/pq/pgconn.pyx":690
 *             if obj is None:
 *                 aparams[i] = NULL
 *                 alenghts[i] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 # TODO: it is a leak if this fails (but it should only fail
 */
        (__pyx_v_alenghts[__pyx_v_i]) = 0;

        /* "psycopg_c/pq/pgconn.pyx":688
 *         for i in range(nparams):
 *             obj = param_values[i]
 *             if obj is None:             # <<<<<<<<<<<<<<
 *                 aparams[i] = NULL
 *                 alenghts[i] = 0
 */
        goto __pyx_L15;
      }

      /* "psycopg_c/pq/pgconn.pyx":694
 *                 # TODO: it is a leak if this fails (but it should only fail
 *                 # on internal error, e.g. if obj is not a buffer)
 *                 _buffer_as_string_and_size(obj, &ptr, &length)             # <<<<<<<<<<<<<<
 *                 aparams[i] = ptr
 *                 alenghts[i] = <int>length
 */
      /*else*/ {
        __pyx_t_10 = __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(__pyx_v_obj, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 694, __pyx_L1_error)

        /* "psycopg_c/pq/pgconn.pyx":695
 *                 # on internal error, e.g. if obj is not a buffer)
 *                 _buffer_as_string_and_size(obj, &ptr, &length)
 *                 aparams[i] = ptr             # <<<<<<<<<<<<<<
 *                 alenghts[i] = <int>length
 * 
 */
        (__pyx_v_aparams[__pyx_v_i]) = __pyx_v_ptr;

        /* "psycopg_c/pq/pgconn.pyx":696
 *                 _buffer_as_string_and_size(obj, &ptr, &length)
 *                 aparams[i] = ptr
 *                 alenghts[i] = <int>length             # <<<<<<<<<<<<<<
 * 
 *     cdef libpq.Oid *atypes = NULL
 */
        (__pyx_v_alenghts[__pyx_v_i]) = ((int)__pyx_v_length);
      }
      __pyx_L15:;
    }

    /* "psycopg_c/pq/pgconn.pyx":683
 *     cdef Py_ssize_t length
 * 
 *     if nparams:             # <<<<<<<<<<<<<<
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":698
 *                 alenghts[i] = <int>length
 * 
 *     cdef libpq.Oid *atypes = NULL             # <<<<<<<<<<<<<<
 *     if tparam_types:
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 */
  __pyx_v_atypes = NULL;

  /* "psycopg_c/pq/pgconn.pyx":699
 * 
 *     cdef libpq.Oid *atypes = NULL
 *     if tparam_types:             # <<<<<<<<<<<<<<
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):
 */
  __pyx_t_1 = (__pyx_v_tparam_types != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_tparam_types) != 0);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":700
 *     cdef libpq.Oid *atypes = NULL
 *     if tparam_types:
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))             # <<<<<<<<<<<<<<
 *         for i in range(nparams):
 *             atypes[i] = tparam_types[i]
 */
    __pyx_v_atypes = ((Oid *)PyMem_Malloc((__pyx_v_nparams * (sizeof(Oid)))));

    /* "psycopg_c/pq/pgconn.pyx":701
 *     if tparam_types:
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):             # <<<<<<<<<<<<<<
 *             atypes[i] = tparam_types[i]
 * 
 */
    __pyx_t_5 = __pyx_v_nparams;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
      __pyx_v_i = __pyx_t_9;

      /* "psycopg_c/pq/pgconn.pyx":702
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):
 *             atypes[i] = tparam_types[i]             # <<<<<<<<<<<<<<
 * 
 *     cdef int *aformats = NULL
 */
      if (unlikely(__pyx_v_tparam_types == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 702, __pyx_L1_error)
      }
      __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_tparam_types, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = __Pyx_PyInt_As_Oid(__pyx_t_4); if (unlikely((__pyx_t_11 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_11;
    }

    /* "psycopg_c/pq/pgconn.pyx":699
 * 
 *     cdef libpq.Oid *atypes = NULL
 *     if tparam_types:             # <<<<<<<<<<<<<<
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":704
 *             atypes[i] = tparam_types[i]
 * 
 *     cdef int *aformats = NULL             # <<<<<<<<<<<<<<
 *     if param_formats is not None:
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
 */
  __pyx_v_aformats = NULL;

  /* "psycopg_c/pq/pgconn.pyx":705
 * 
 *     cdef int *aformats = NULL
 *     if param_formats is not None:             # <<<<<<<<<<<<<<
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
 *         for i in range(nparams):
 */
  __pyx_t_1 = (__pyx_v_param_formats != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":706
 *     cdef int *aformats = NULL
 *     if param_formats is not None:
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))             # <<<<<<<<<<<<<<
 *         for i in range(nparams):
 *             aformats[i] = param_formats[i]
 */
    __pyx_v_aformats = ((int *)PyMem_Malloc((__pyx_v_nparams * (sizeof(int *)))));

    /* "psycopg_c/pq/pgconn.pyx":707
 *     if param_formats is not None:
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
 *         for i in range(nparams):             # <<<<<<<<<<<<<<
 *             aformats[i] = param_formats[i]
 * 
 */
    __pyx_t_5 = __pyx_v_nparams;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
      __pyx_v_i = __pyx_t_9;

      /* "psycopg_c/pq/pgconn.pyx":708
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
 *         for i in range(nparams):
 *             aformats[i] = param_formats[i]             # <<<<<<<<<<<<<<
 * 
 *     return (nparams, atypes, aparams, alenghts, aformats)
 */
      if (unlikely(__pyx_v_param_formats == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 708, __pyx_L1_error)
      }
      __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_param_formats, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      (__pyx_v_aformats[__pyx_v_i]) = __pyx_t_10;
    }

    /* "psycopg_c/pq/pgconn.pyx":705
 * 
 *     cdef int *aformats = NULL
 *     if param_formats is not None:             # <<<<<<<<<<<<<<
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
 *         for i in range(nparams):
 */
  }

  /* "psycopg_c/pq/pgconn.pyx":710
 *             aformats[i] = param_formats[i]
 * 
 *     return (nparams, atypes, aparams, alenghts, aformats)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_12.f0 = __pyx_v_nparams;
  __pyx_t_12.f1 = __pyx_v_atypes;
  __pyx_t_12.f2 = __pyx_v_aparams;
  __pyx_t_12.f3 = __pyx_v_alenghts;
  __pyx_t_12.f4 = __pyx_v_aformats;
  __pyx_r = __pyx_t_12;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":651
 * 
 * 
 * cdef (Py_ssize_t, libpq.Oid *, char * const*, int *, int *) _query_params_args(             # <<<<<<<<<<<<<<
 *     list param_values: Optional[Sequence[Optional[bytes]]],
 *     param_types: Optional[Sequence[int]],
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("psycopg_c.pq._query_params_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tparam_types);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":713
 * 
 * 
 * cdef void _clear_query_params(             # <<<<<<<<<<<<<<
 *     libpq.Oid *ctypes, char *const *cvalues, int *clenghst, int *cformats
 * ):
 */

static void __pyx_f_9psycopg_c_2pq__clear_query_params(Oid *__pyx_v_ctypes, char *const *__pyx_v_cvalues, int *__pyx_v_clenghst, int *__pyx_v_cformats) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_clear_query_params", 0);

  /* "psycopg_c/pq/pgconn.pyx":716
 *     libpq.Oid *ctypes, char *const *cvalues, int *clenghst, int *cformats
 * ):
 *     PyMem_Free(ctypes)             # <<<<<<<<<<<<<<
 *     PyMem_Free(<char **>cvalues)
 *     PyMem_Free(clenghst)
 */
  PyMem_Free(__pyx_v_ctypes);

  /* "psycopg_c/pq/pgconn.pyx":717
 * ):
 *     PyMem_Free(ctypes)
 *     PyMem_Free(<char **>cvalues)             # <<<<<<<<<<<<<<
 *     PyMem_Free(clenghst)
 *     PyMem_Free(cformats)
 */
  PyMem_Free(((char **)__pyx_v_cvalues));

  /* "psycopg_c/pq/pgconn.pyx":718
 *     PyMem_Free(ctypes)
 *     PyMem_Free(<char **>cvalues)
 *     PyMem_Free(clenghst)             # <<<<<<<<<<<<<<
 *     PyMem_Free(cformats)
 */
  PyMem_Free(__pyx_v_clenghst);

  /* "psycopg_c/pq/pgconn.pyx":719
 *     PyMem_Free(<char **>cvalues)
 *     PyMem_Free(clenghst)
 *     PyMem_Free(cformats)             # <<<<<<<<<<<<<<
 */
  PyMem_Free(__pyx_v_cformats);

  /* "psycopg_c/pq/pgconn.pyx":713
 * 
 * 
 * cdef void _clear_query_params(             # <<<<<<<<<<<<<<
 *     libpq.Oid *ctypes, char *const *cvalues, int *clenghst, int *cformats
 * ):
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "psycopg_c/pq/pgresult.pyx":16
 * @cython.freelist(8)
 * cdef class PGresult:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._pgresult_ptr = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_8PGresult_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_8PGresult_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult___cinit__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_8PGresult___cinit__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "psycopg_c/pq/pgresult.pyx":17
 * cdef class PGresult:
 *     def __cinit__(self):
 *         self._pgresult_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_v_self->_pgresult_ptr = NULL;

  /* "psycopg_c/pq/pgresult.pyx":16
 * @cython.freelist(8)
 * cdef class PGresult:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._pgresult_ptr = NULL
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":20
 * 
 *     @staticmethod
 *     cdef PGresult _from_ptr(libpq.PGresult *ptr):             # <<<<<<<<<<<<<<
 *         cdef PGresult rv = PGresult.__new__(PGresult)
 *         rv._pgresult_ptr = ptr
 */

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(PGresult *__pyx_v_ptr) {
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_rv = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_ptr", 0);

  /* "psycopg_c/pq/pgresult.pyx":21
 *     @staticmethod
 *     cdef PGresult _from_ptr(libpq.PGresult *ptr):
 *         cdef PGresult rv = PGresult.__new__(PGresult)             # <<<<<<<<<<<<<<
 *         rv._pgresult_ptr = ptr
 *         return rv
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9psycopg_c_2pq_PGresult(((PyTypeObject *)__pyx_ptype_9psycopg_c_2pq_PGresult), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 21, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_rv = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgresult.pyx":22
 *     cdef PGresult _from_ptr(libpq.PGresult *ptr):
 *         cdef PGresult rv = PGresult.__new__(PGresult)
 *         rv._pgresult_ptr = ptr             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __pyx_v_rv->_pgresult_ptr = __pyx_v_ptr;

  /* "psycopg_c/pq/pgresult.pyx":23
 *         cdef PGresult rv = PGresult.__new__(PGresult)
 *         rv._pgresult_ptr = ptr
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self) -> None:
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":20
 * 
 *     @staticmethod
 *     cdef PGresult _from_ptr(libpq.PGresult *ptr):             # <<<<<<<<<<<<<<
 *         cdef PGresult rv = PGresult.__new__(PGresult)
 *         rv._pgresult_ptr = ptr
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult._from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":25
 *         return rv
 * 
 *     def __dealloc__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.clear()
 * 
 */

/* Python wrapper */
static void __pyx_pw_9psycopg_c_2pq_8PGresult_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_9psycopg_c_2pq_8PGresult_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_9psycopg_c_2pq_8PGresult_2__dealloc__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_9psycopg_c_2pq_8PGresult_2__dealloc__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "psycopg_c/pq/pgresult.pyx":26
 * 
 *     def __dealloc__(self) -> None:
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self) -> str:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[1] = {__pyx_t_3, };
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgresult.pyx":25
 *         return rv
 * 
 *     def __dealloc__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.clear()
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("psycopg_c.pq.PGresult.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "psycopg_c/pq/pgresult.pyx":28
 *         self.clear()
 * 
 *     def __repr__(self) -> str:             # <<<<<<<<<<<<<<
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         status = ExecStatus(self.status)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_5__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_4__repr__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_4__repr__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_v_cls = NULL;
  PyObject *__pyx_v_status = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "psycopg_c/pq/pgresult.pyx":29
 * 
 *     def __repr__(self) -> str:
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *         status = ExecStatus(self.status)
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_module); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u_);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_qualname); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cls = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgresult.pyx":30
 *     def __repr__(self) -> str:
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         status = ExecStatus(self.status)             # <<<<<<<<<<<<<<
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ExecStatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_status); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_status = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgresult.pyx":31
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         status = ExecStatus(self.status)
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *     def clear(self) -> None:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u__2);
  __Pyx_INCREF(__pyx_v_cls);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_cls) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_cls) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_cls);
  __Pyx_GIVEREF(__pyx_v_cls);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_cls);
  __Pyx_INCREF(__pyx_kp_u__14);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__14);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__14);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_status, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u_at_0x_2);
  __pyx_t_2 += 7;
  __Pyx_GIVEREF(__pyx_kp_u_at_0x_2);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_at_0x_2);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_5, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__4);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__4);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u__4);
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":28
 *         self.clear()
 * 
 *     def __repr__(self) -> str:             # <<<<<<<<<<<<<<
 *         cls = f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *         status = ExecStatus(self.status)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cls);
  __Pyx_XDECREF(__pyx_v_status);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":33
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"
 * 
 *     def clear(self) -> None:             # <<<<<<<<<<<<<<
 *         if self._pgresult_ptr is not NULL:
 *             libpq.PQclear(self._pgresult_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_7clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_7clear = {"clear", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_7clear, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_7clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_6clear(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_6clear(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("clear", 0);

  /* "psycopg_c/pq/pgresult.pyx":34
 * 
 *     def clear(self) -> None:
 *         if self._pgresult_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQclear(self._pgresult_ptr)
 *             self._pgresult_ptr = NULL
 */
  __pyx_t_1 = (__pyx_v_self->_pgresult_ptr != NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgresult.pyx":35
 *     def clear(self) -> None:
 *         if self._pgresult_ptr is not NULL:
 *             libpq.PQclear(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 *             self._pgresult_ptr = NULL
 * 
 */
    PQclear(__pyx_v_self->_pgresult_ptr);

    /* "psycopg_c/pq/pgresult.pyx":36
 *         if self._pgresult_ptr is not NULL:
 *             libpq.PQclear(self._pgresult_ptr)
 *             self._pgresult_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __pyx_v_self->_pgresult_ptr = NULL;

    /* "psycopg_c/pq/pgresult.pyx":34
 * 
 *     def clear(self) -> None:
 *         if self._pgresult_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQclear(self._pgresult_ptr)
 *             self._pgresult_ptr = NULL
 */
  }

  /* "psycopg_c/pq/pgresult.pyx":33
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"
 * 
 *     def clear(self) -> None:             # <<<<<<<<<<<<<<
 *         if self._pgresult_ptr is not NULL:
 *             libpq.PQclear(self._pgresult_ptr)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":38
 *             self._pgresult_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgresult_ptr(self) -> Optional[int]:
 *         if self._pgresult_ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_12pgresult_ptr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_12pgresult_ptr_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_12pgresult_ptr___get__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_12pgresult_ptr___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgresult.pyx":40
 *     @property
 *     def pgresult_ptr(self) -> Optional[int]:
 *         if self._pgresult_ptr:             # <<<<<<<<<<<<<<
 *             return <long long><void *>self._pgresult_ptr
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->_pgresult_ptr != 0);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgresult.pyx":41
 *     def pgresult_ptr(self) -> Optional[int]:
 *         if self._pgresult_ptr:
 *             return <long long><void *>self._pgresult_ptr             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(((PY_LONG_LONG)((void *)__pyx_v_self->_pgresult_ptr))); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgresult.pyx":40
 *     @property
 *     def pgresult_ptr(self) -> Optional[int]:
 *         if self._pgresult_ptr:             # <<<<<<<<<<<<<<
 *             return <long long><void *>self._pgresult_ptr
 *         else:
 */
  }

  /* "psycopg_c/pq/pgresult.pyx":43
 *             return <long long><void *>self._pgresult_ptr
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgresult.pyx":38
 *             self._pgresult_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgresult_ptr(self) -> Optional[int]:
 *         if self._pgresult_ptr:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.pgresult_ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":45
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         return libpq.PQresultStatus(self._pgresult_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_6status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_6status_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_6status___get__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_6status___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgresult.pyx":47
 *     @property
 *     def status(self) -> int:
 *         return libpq.PQresultStatus(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_ExecStatusType(PQresultStatus(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":45
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         return libpq.PQresultStatus(self._pgresult_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":49
 *         return libpq.PQresultStatus(self._pgresult_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_13error_message_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_13error_message_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_13error_message___get__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_13error_message___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgresult.pyx":51
 *     @property
 *     def error_message(self) -> bytes:
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def error_field(self, int fieldcode) -> Optional[bytes]:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(PQresultErrorMessage(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":49
 *         return libpq.PQresultStatus(self._pgresult_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.error_message.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":53
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 * 
 *     def error_field(self, int fieldcode) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_9error_field(PyObject *__pyx_v_self, PyObject *__pyx_arg_fieldcode); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_9error_field = {"error_field", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_9error_field, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_9error_field(PyObject *__pyx_v_self, PyObject *__pyx_arg_fieldcode) {
  int __pyx_v_fieldcode;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("error_field (wrapper)", 0);
  assert(__pyx_arg_fieldcode); {
    __pyx_v_fieldcode = __Pyx_PyInt_As_int(__pyx_arg_fieldcode); if (unlikely((__pyx_v_fieldcode == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 53, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.error_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_8error_field(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_fieldcode));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_8error_field(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_fieldcode) {
  char *__pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("error_field", 0);

  /* "psycopg_c/pq/pgresult.pyx":54
 * 
 *     def error_field(self, int fieldcode) -> Optional[bytes]:
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)             # <<<<<<<<<<<<<<
 *         if rv is not NULL:
 *             return rv
 */
  __pyx_v_rv = PQresultErrorField(__pyx_v_self->_pgresult_ptr, __pyx_v_fieldcode);

  /* "psycopg_c/pq/pgresult.pyx":55
 *     def error_field(self, int fieldcode) -> Optional[bytes]:
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
 */
  __pyx_t_1 = (__pyx_v_rv != NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgresult.pyx":56
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:
 *             return rv             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgresult.pyx":55
 *     def error_field(self, int fieldcode) -> Optional[bytes]:
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
 */
  }

  /* "psycopg_c/pq/pgresult.pyx":58
 *             return rv
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgresult.pyx":53
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 * 
 *     def error_field(self, int fieldcode) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.error_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":60
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ntuples(self) -> int:
 *         return libpq.PQntuples(self._pgresult_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_7ntuples_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_7ntuples_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_7ntuples___get__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_7ntuples___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgresult.pyx":62
 *     @property
 *     def ntuples(self) -> int:
 *         return libpq.PQntuples(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQntuples(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":60
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ntuples(self) -> int:
 *         return libpq.PQntuples(self._pgresult_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.ntuples.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":64
 *         return libpq.PQntuples(self._pgresult_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nfields(self) -> int:
 *         return libpq.PQnfields(self._pgresult_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_7nfields_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_7nfields_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_7nfields___get__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_7nfields___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgresult.pyx":66
 *     @property
 *     def nfields(self) -> int:
 *         return libpq.PQnfields(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def fname(self, int column_number) -> Optional[bytes]:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQnfields(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":64
 *         return libpq.PQntuples(self._pgresult_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nfields(self) -> int:
 *         return libpq.PQnfields(self._pgresult_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.nfields.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":68
 *         return libpq.PQnfields(self._pgresult_ptr)
 * 
 *     def fname(self, int column_number) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_11fname(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_11fname = {"fname", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_11fname, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_11fname(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fname (wrapper)", 0);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyInt_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 68, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.fname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_10fname(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_10fname(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  char *__pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fname", 0);

  /* "psycopg_c/pq/pgresult.pyx":69
 * 
 *     def fname(self, int column_number) -> Optional[bytes]:
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 *         if rv is not NULL:
 *             return rv
 */
  __pyx_v_rv = PQfname(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number);

  /* "psycopg_c/pq/pgresult.pyx":70
 *     def fname(self, int column_number) -> Optional[bytes]:
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
 */
  __pyx_t_1 = (__pyx_v_rv != NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgresult.pyx":71
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:
 *             return rv             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgresult.pyx":70
 *     def fname(self, int column_number) -> Optional[bytes]:
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
 */
  }

  /* "psycopg_c/pq/pgresult.pyx":73
 *             return rv
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def ftable(self, int column_number) -> int:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgresult.pyx":68
 *         return libpq.PQnfields(self._pgresult_ptr)
 * 
 *     def fname(self, int column_number) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.fname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":75
 *             return None
 * 
 *     def ftable(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_13ftable(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_13ftable = {"ftable", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_13ftable, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_13ftable(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ftable (wrapper)", 0);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyInt_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 75, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.ftable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_12ftable(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_12ftable(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ftable", 0);

  /* "psycopg_c/pq/pgresult.pyx":76
 * 
 *     def ftable(self, int column_number) -> int:
 *         return libpq.PQftable(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     def ftablecol(self, int column_number) -> int:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_Oid(PQftable(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyInt_CheckExact(__pyx_t_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(3, 76, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":75
 *             return None
 * 
 *     def ftable(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.ftable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":78
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
 *     def ftablecol(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_15ftablecol(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_15ftablecol = {"ftablecol", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_15ftablecol, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_15ftablecol(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ftablecol (wrapper)", 0);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyInt_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 78, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.ftablecol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_14ftablecol(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_14ftablecol(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ftablecol", 0);

  /* "psycopg_c/pq/pgresult.pyx":79
 * 
 *     def ftablecol(self, int column_number) -> int:
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     def fformat(self, int column_number) -> int:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQftablecol(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyInt_CheckExact(__pyx_t_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(3, 79, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":78
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
 *     def ftablecol(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.ftablecol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":81
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
 *     def fformat(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_17fformat(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_17fformat = {"fformat", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_17fformat, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_17fformat(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fformat (wrapper)", 0);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyInt_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 81, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.fformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_16fformat(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_16fformat(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fformat", 0);

  /* "psycopg_c/pq/pgresult.pyx":82
 * 
 *     def fformat(self, int column_number) -> int:
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     def ftype(self, int column_number) -> int:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQfformat(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyInt_CheckExact(__pyx_t_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(3, 82, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":81
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
 *     def fformat(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.fformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":84
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
 *     def ftype(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_19ftype(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_19ftype = {"ftype", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_19ftype, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_19ftype(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ftype (wrapper)", 0);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyInt_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 84, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.ftype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_18ftype(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_18ftype(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ftype", 0);

  /* "psycopg_c/pq/pgresult.pyx":85
 * 
 *     def ftype(self, int column_number) -> int:
 *         return libpq.PQftype(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     def fmod(self, int column_number) -> int:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_Oid(PQftype(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyInt_CheckExact(__pyx_t_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(3, 85, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":84
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
 *     def ftype(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.ftype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":87
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
 *     def fmod(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_21fmod(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_21fmod = {"fmod", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_21fmod, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_21fmod(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fmod (wrapper)", 0);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyInt_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 87, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.fmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_20fmod(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_20fmod(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fmod", 0);

  /* "psycopg_c/pq/pgresult.pyx":88
 * 
 *     def fmod(self, int column_number) -> int:
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     def fsize(self, int column_number) -> int:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQfmod(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyInt_CheckExact(__pyx_t_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(3, 88, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":87
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
 *     def fmod(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.fmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":90
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
 *     def fsize(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_23fsize(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_23fsize = {"fsize", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_23fsize, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_23fsize(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fsize (wrapper)", 0);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyInt_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 90, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.fsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_22fsize(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_column_number));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_22fsize(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fsize", 0);

  /* "psycopg_c/pq/pgresult.pyx":91
 * 
 *     def fsize(self, int column_number) -> int:
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQfsize(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyInt_CheckExact(__pyx_t_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(3, 91, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":90
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
 *     def fsize(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.fsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":93
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def binary_tuples(self) -> int:
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_13binary_tuples_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_13binary_tuples_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_13binary_tuples___get__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_13binary_tuples___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgresult.pyx":95
 *     @property
 *     def binary_tuples(self) -> int:
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_value(self, int row_number, int column_number) -> Optional[bytes]:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQbinaryTuples(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":93
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def binary_tuples(self) -> int:
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.binary_tuples.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":97
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 * 
 *     def get_value(self, int row_number, int column_number) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef int crow = row_number
 *         cdef int ccol = column_number
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_25get_value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_25get_value = {"get_value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_8PGresult_25get_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_25get_value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int __pyx_v_row_number;
  int __pyx_v_column_number;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_value (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row_number,&__pyx_n_s_column_number,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row_number,&__pyx_n_s_column_number,0};
    #endif
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_row_number)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 97, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_column_number)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 97, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, 1); __PYX_ERR(3, 97, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "get_value") < 0)) __PYX_ERR(3, 97, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_row_number = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_row_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 97, __pyx_L3_error)
    __pyx_v_column_number = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 97, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 97, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_24get_value(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), __pyx_v_row_number, __pyx_v_column_number);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_24get_value(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_row_number, int __pyx_v_column_number) {
  int __pyx_v_crow;
  int __pyx_v_ccol;
  int __pyx_v_length;
  char *__pyx_v_v;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value", 0);

  /* "psycopg_c/pq/pgresult.pyx":98
 * 
 *     def get_value(self, int row_number, int column_number) -> Optional[bytes]:
 *         cdef int crow = row_number             # <<<<<<<<<<<<<<
 *         cdef int ccol = column_number
 *         cdef int length = libpq.PQgetlength(self._pgresult_ptr, crow, ccol)
 */
  __pyx_v_crow = __pyx_v_row_number;

  /* "psycopg_c/pq/pgresult.pyx":99
 *     def get_value(self, int row_number, int column_number) -> Optional[bytes]:
 *         cdef int crow = row_number
 *         cdef int ccol = column_number             # <<<<<<<<<<<<<<
 *         cdef int length = libpq.PQgetlength(self._pgresult_ptr, crow, ccol)
 *         cdef char *v
 */
  __pyx_v_ccol = __pyx_v_column_number;

  /* "psycopg_c/pq/pgresult.pyx":100
 *         cdef int crow = row_number
 *         cdef int ccol = column_number
 *         cdef int length = libpq.PQgetlength(self._pgresult_ptr, crow, ccol)             # <<<<<<<<<<<<<<
 *         cdef char *v
 *         if length:
 */
  __pyx_v_length = PQgetlength(__pyx_v_self->_pgresult_ptr, __pyx_v_crow, __pyx_v_ccol);

  /* "psycopg_c/pq/pgresult.pyx":102
 *         cdef int length = libpq.PQgetlength(self._pgresult_ptr, crow, ccol)
 *         cdef char *v
 *         if length:             # <<<<<<<<<<<<<<
 *             v = libpq.PQgetvalue(self._pgresult_ptr, crow, ccol)
 *             # TODO: avoid copy
 */
  __pyx_t_1 = (__pyx_v_length != 0);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgresult.pyx":103
 *         cdef char *v
 *         if length:
 *             v = libpq.PQgetvalue(self._pgresult_ptr, crow, ccol)             # <<<<<<<<<<<<<<
 *             # TODO: avoid copy
 *             return v[:length]
 */
    __pyx_v_v = PQgetvalue(__pyx_v_self->_pgresult_ptr, __pyx_v_crow, __pyx_v_ccol);

    /* "psycopg_c/pq/pgresult.pyx":105
 *             v = libpq.PQgetvalue(self._pgresult_ptr, crow, ccol)
 *             # TODO: avoid copy
 *             return v[:length]             # <<<<<<<<<<<<<<
 *         else:
 *             if libpq.PQgetisnull(self._pgresult_ptr, crow, ccol):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_v + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgresult.pyx":102
 *         cdef int length = libpq.PQgetlength(self._pgresult_ptr, crow, ccol)
 *         cdef char *v
 *         if length:             # <<<<<<<<<<<<<<
 *             v = libpq.PQgetvalue(self._pgresult_ptr, crow, ccol)
 *             # TODO: avoid copy
 */
  }

  /* "psycopg_c/pq/pgresult.pyx":107
 *             return v[:length]
 *         else:
 *             if libpq.PQgetisnull(self._pgresult_ptr, crow, ccol):             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
  /*else*/ {
    __pyx_t_1 = (PQgetisnull(__pyx_v_self->_pgresult_ptr, __pyx_v_crow, __pyx_v_ccol) != 0);
    if (__pyx_t_1) {

      /* "psycopg_c/pq/pgresult.pyx":108
 *         else:
 *             if libpq.PQgetisnull(self._pgresult_ptr, crow, ccol):
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return b""
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "psycopg_c/pq/pgresult.pyx":107
 *             return v[:length]
 *         else:
 *             if libpq.PQgetisnull(self._pgresult_ptr, crow, ccol):             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
 */
    }

    /* "psycopg_c/pq/pgresult.pyx":110
 *                 return None
 *             else:
 *                 return b""             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_kp_b__12);
      __pyx_r = __pyx_kp_b__12;
      goto __pyx_L0;
    }
  }

  /* "psycopg_c/pq/pgresult.pyx":97
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 * 
 *     def get_value(self, int row_number, int column_number) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef int crow = row_number
 *         cdef int ccol = column_number
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":112
 *                 return b""
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nparams(self) -> int:
 *         return libpq.PQnparams(self._pgresult_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_7nparams_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_7nparams_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_7nparams___get__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_7nparams___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgresult.pyx":114
 *     @property
 *     def nparams(self) -> int:
 *         return libpq.PQnparams(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def param_type(self, int param_number) -> int:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(PQnparams(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":112
 *                 return b""
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nparams(self) -> int:
 *         return libpq.PQnparams(self._pgresult_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.nparams.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":116
 *         return libpq.PQnparams(self._pgresult_ptr)
 * 
 *     def param_type(self, int param_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_27param_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_param_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_27param_type = {"param_type", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_27param_type, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_27param_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_param_number) {
  int __pyx_v_param_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("param_type (wrapper)", 0);
  assert(__pyx_arg_param_number); {
    __pyx_v_param_number = __Pyx_PyInt_As_int(__pyx_arg_param_number); if (unlikely((__pyx_v_param_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 116, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.param_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_26param_type(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((int)__pyx_v_param_number));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_26param_type(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_param_number) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("param_type", 0);

  /* "psycopg_c/pq/pgresult.pyx":117
 * 
 *     def param_type(self, int param_number) -> int:
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_Oid(PQparamtype(__pyx_v_self->_pgresult_ptr, __pyx_v_param_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyInt_CheckExact(__pyx_t_1)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(3, 117, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":116
 *         return libpq.PQnparams(self._pgresult_ptr)
 * 
 *     def param_type(self, int param_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.param_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":119
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_status(self) -> Optional[bytes]:
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_14command_status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_14command_status_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_14command_status___get__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_14command_status___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  char *__pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgresult.pyx":121
 *     @property
 *     def command_status(self) -> Optional[bytes]:
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 *         if rv is not NULL:
 *             return rv
 */
  __pyx_v_rv = PQcmdStatus(__pyx_v_self->_pgresult_ptr);

  /* "psycopg_c/pq/pgresult.pyx":122
 *     def command_status(self) -> Optional[bytes]:
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
 */
  __pyx_t_1 = (__pyx_v_rv != NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgresult.pyx":123
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)
 *         if rv is not NULL:
 *             return rv             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgresult.pyx":122
 *     def command_status(self) -> Optional[bytes]:
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
 */
  }

  /* "psycopg_c/pq/pgresult.pyx":125
 *             return rv
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgresult.pyx":119
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_status(self) -> Optional[bytes]:
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.command_status.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":127
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_tuples(self) -> Optional[int]:
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_14command_tuples_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_14command_tuples_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_14command_tuples___get__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_14command_tuples___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  char *__pyx_v_rv;
  PyObject *__pyx_v_brv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgresult.pyx":129
 *     @property
 *     def command_tuples(self) -> Optional[int]:
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             return None
 */
  __pyx_v_rv = PQcmdTuples(__pyx_v_self->_pgresult_ptr);

  /* "psycopg_c/pq/pgresult.pyx":130
 *     def command_tuples(self) -> Optional[int]:
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         cdef bytes brv = rv
 */
  __pyx_t_1 = (__pyx_v_rv == NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgresult.pyx":131
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)
 *         if rv is NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         cdef bytes brv = rv
 *         return int(brv) if brv else None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "psycopg_c/pq/pgresult.pyx":130
 *     def command_tuples(self) -> Optional[int]:
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         cdef bytes brv = rv
 */
  }

  /* "psycopg_c/pq/pgresult.pyx":132
 *         if rv is NULL:
 *             return None
 *         cdef bytes brv = rv             # <<<<<<<<<<<<<<
 *         return int(brv) if brv else None
 * 
 */
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_brv = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgresult.pyx":133
 *             return None
 *         cdef bytes brv = rv
 *         return int(brv) if brv else None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (PyBytes_GET_SIZE(__pyx_v_brv) != 0);
  if (__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_brv); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_2 = Py_None;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":127
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_tuples(self) -> Optional[int]:
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.command_tuples.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_brv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":135
 *         return int(brv) if brv else None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def oid_value(self) -> int:
 *         return libpq.PQoidValue(self._pgresult_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_9oid_value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_9oid_value_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_9oid_value___get__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_9oid_value___get__(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgresult.pyx":137
 *     @property
 *     def oid_value(self) -> int:
 *         return libpq.PQoidValue(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def set_attributes(self, descriptions: List[PGresAttDesc]):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_Oid(PQoidValue(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":135
 *         return int(brv) if brv else None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def oid_value(self) -> int:
 *         return libpq.PQoidValue(self._pgresult_ptr)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.oid_value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":139
 *         return libpq.PQoidValue(self._pgresult_ptr)
 * 
 *     def set_attributes(self, descriptions: List[PGresAttDesc]):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t num = len(descriptions)
 *         cdef libpq.PGresAttDesc *attrs = <libpq.PGresAttDesc *>PyMem_Malloc(
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_29set_attributes(PyObject *__pyx_v_self, PyObject *__pyx_v_descriptions); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_29set_attributes = {"set_attributes", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_29set_attributes, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_29set_attributes(PyObject *__pyx_v_self, PyObject *__pyx_v_descriptions) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_attributes (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_28set_attributes(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((PyObject *)__pyx_v_descriptions));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_28set_attributes(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, PyObject *__pyx_v_descriptions) {
  Py_ssize_t __pyx_v_num;
  PGresAttDesc *__pyx_v_attrs;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_descr = NULL;
  int __pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  Oid __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_attributes", 0);

  /* "psycopg_c/pq/pgresult.pyx":140
 * 
 *     def set_attributes(self, descriptions: List[PGresAttDesc]):
 *         cdef Py_ssize_t num = len(descriptions)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresAttDesc *attrs = <libpq.PGresAttDesc *>PyMem_Malloc(
 *             num * sizeof(libpq.PGresAttDesc))
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_descriptions); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 140, __pyx_L1_error)
  __pyx_v_num = __pyx_t_1;

  /* "psycopg_c/pq/pgresult.pyx":141
 *     def set_attributes(self, descriptions: List[PGresAttDesc]):
 *         cdef Py_ssize_t num = len(descriptions)
 *         cdef libpq.PGresAttDesc *attrs = <libpq.PGresAttDesc *>PyMem_Malloc(             # <<<<<<<<<<<<<<
 *             num * sizeof(libpq.PGresAttDesc))
 * 
 */
  __pyx_v_attrs = ((PGresAttDesc *)PyMem_Malloc((__pyx_v_num * (sizeof(PGresAttDesc)))));

  /* "psycopg_c/pq/pgresult.pyx":144
 *             num * sizeof(libpq.PGresAttDesc))
 * 
 *         for i in range(num):             # <<<<<<<<<<<<<<
 *             descr = descriptions[i]
 *             attrs[i].name = descr.name
 */
  __pyx_t_1 = __pyx_v_num;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "psycopg_c/pq/pgresult.pyx":145
 * 
 *         for i in range(num):
 *             descr = descriptions[i]             # <<<<<<<<<<<<<<
 *             attrs[i].name = descr.name
 *             attrs[i].tableid = descr.tableid
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_descriptions, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_descr, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgresult.pyx":146
 *         for i in range(num):
 *             descr = descriptions[i]
 *             attrs[i].name = descr.name             # <<<<<<<<<<<<<<
 *             attrs[i].tableid = descr.tableid
 *             attrs[i].columnid = descr.columnid
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_AsWritableString(__pyx_t_4); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(3, 146, __pyx_L1_error)
    (__pyx_v_attrs[__pyx_v_i]).name = __pyx_t_5;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgresult.pyx":147
 *             descr = descriptions[i]
 *             attrs[i].name = descr.name
 *             attrs[i].tableid = descr.tableid             # <<<<<<<<<<<<<<
 *             attrs[i].columnid = descr.columnid
 *             attrs[i].format = descr.format
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_n_s_tableid); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyInt_As_Oid(__pyx_t_4); if (unlikely((__pyx_t_6 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(3, 147, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).tableid = __pyx_t_6;

    /* "psycopg_c/pq/pgresult.pyx":148
 *             attrs[i].name = descr.name
 *             attrs[i].tableid = descr.tableid
 *             attrs[i].columnid = descr.columnid             # <<<<<<<<<<<<<<
 *             attrs[i].format = descr.format
 *             attrs[i].typid = descr.typid
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_n_s_columnid); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 148, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).columnid = __pyx_t_7;

    /* "psycopg_c/pq/pgresult.pyx":149
 *             attrs[i].tableid = descr.tableid
 *             attrs[i].columnid = descr.columnid
 *             attrs[i].format = descr.format             # <<<<<<<<<<<<<<
 *             attrs[i].typid = descr.typid
 *             attrs[i].typlen = descr.typlen
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 149, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).format = __pyx_t_7;

    /* "psycopg_c/pq/pgresult.pyx":150
 *             attrs[i].columnid = descr.columnid
 *             attrs[i].format = descr.format
 *             attrs[i].typid = descr.typid             # <<<<<<<<<<<<<<
 *             attrs[i].typlen = descr.typlen
 *             attrs[i].atttypmod = descr.atttypmod
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_n_s_typid); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyInt_As_Oid(__pyx_t_4); if (unlikely((__pyx_t_6 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(3, 150, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).typid = __pyx_t_6;

    /* "psycopg_c/pq/pgresult.pyx":151
 *             attrs[i].format = descr.format
 *             attrs[i].typid = descr.typid
 *             attrs[i].typlen = descr.typlen             # <<<<<<<<<<<<<<
 *             attrs[i].atttypmod = descr.atttypmod
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_n_s_typlen); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 151, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).typlen = __pyx_t_7;

    /* "psycopg_c/pq/pgresult.pyx":152
 *             attrs[i].typid = descr.typid
 *             attrs[i].typlen = descr.typlen
 *             attrs[i].atttypmod = descr.atttypmod             # <<<<<<<<<<<<<<
 * 
 *         cdef int res = libpq.PQsetResultAttrs(self._pgresult_ptr, <int>num, attrs)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_descr, __pyx_n_s_atttypmod); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 152, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_attrs[__pyx_v_i]).atttypmod = __pyx_t_7;
  }

  /* "psycopg_c/pq/pgresult.pyx":154
 *             attrs[i].atttypmod = descr.atttypmod
 * 
 *         cdef int res = libpq.PQsetResultAttrs(self._pgresult_ptr, <int>num, attrs)             # <<<<<<<<<<<<<<
 *         PyMem_Free(attrs)
 *         if (res == 0):
 */
  __pyx_v_res = PQsetResultAttrs(__pyx_v_self->_pgresult_ptr, ((int)__pyx_v_num), __pyx_v_attrs);

  /* "psycopg_c/pq/pgresult.pyx":155
 * 
 *         cdef int res = libpq.PQsetResultAttrs(self._pgresult_ptr, <int>num, attrs)
 *         PyMem_Free(attrs)             # <<<<<<<<<<<<<<
 *         if (res == 0):
 *             raise e.OperationalError("PQsetResultAttrs failed")
 */
  PyMem_Free(__pyx_v_attrs);

  /* "psycopg_c/pq/pgresult.pyx":156
 *         cdef int res = libpq.PQsetResultAttrs(self._pgresult_ptr, <int>num, attrs)
 *         PyMem_Free(attrs)
 *         if (res == 0):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("PQsetResultAttrs failed")
 */
  __pyx_t_8 = (__pyx_v_res == 0);
  if (unlikely(__pyx_t_8)) {

    /* "psycopg_c/pq/pgresult.pyx":157
 *         PyMem_Free(attrs)
 *         if (res == 0):
 *             raise e.OperationalError("PQsetResultAttrs failed")             # <<<<<<<<<<<<<<
 */
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_e); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_7 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_kp_u_PQsetResultAttrs_failed};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 157, __pyx_L1_error)

    /* "psycopg_c/pq/pgresult.pyx":156
 *         cdef int res = libpq.PQsetResultAttrs(self._pgresult_ptr, <int>num, attrs)
 *         PyMem_Free(attrs)
 *         if (res == 0):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("PQsetResultAttrs failed")
 */
  }

  /* "psycopg_c/pq/pgresult.pyx":139
 *         return libpq.PQoidValue(self._pgresult_ptr)
 * 
 *     def set_attributes(self, descriptions: List[PGresAttDesc]):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t num = len(descriptions)
 *         cdef libpq.PGresAttDesc *attrs = <libpq.PGresAttDesc *>PyMem_Malloc(
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.set_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_descr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_31__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_31__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_30__reduce_cython__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_33__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_33__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_32__setstate_cython__(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgcancel.pyx":9
 * 
 * cdef class PGcancel:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.pgcancel_ptr = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_8PGcancel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_8PGcancel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGcancel___cinit__(((struct __pyx_obj_9psycopg_c_2pq_PGcancel *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_8PGcancel___cinit__(struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "psycopg_c/pq/pgcancel.pyx":10
 * cdef class PGcancel:
 *     def __cinit__(self):
 *         self.pgcancel_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_v_self->pgcancel_ptr = NULL;

  /* "psycopg_c/pq/pgcancel.pyx":9
 * 
 * cdef class PGcancel:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.pgcancel_ptr = NULL
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgcancel.pyx":13
 * 
 *     @staticmethod
 *     cdef PGcancel _from_ptr(libpq.PGcancel *ptr):             # <<<<<<<<<<<<<<
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)
 *         rv.pgcancel_ptr = ptr
 */

static struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_f_9psycopg_c_2pq_8PGcancel__from_ptr(PGcancel *__pyx_v_ptr) {
  struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_rv = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_ptr", 0);

  /* "psycopg_c/pq/pgcancel.pyx":14
 *     @staticmethod
 *     cdef PGcancel _from_ptr(libpq.PGcancel *ptr):
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)             # <<<<<<<<<<<<<<
 *         rv.pgcancel_ptr = ptr
 *         return rv
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9psycopg_c_2pq_PGcancel(((PyTypeObject *)__pyx_ptype_9psycopg_c_2pq_PGcancel), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 14, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_rv = ((struct __pyx_obj_9psycopg_c_2pq_PGcancel *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":15
 *     cdef PGcancel _from_ptr(libpq.PGcancel *ptr):
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)
 *         rv.pgcancel_ptr = ptr             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __pyx_v_rv->pgcancel_ptr = __pyx_v_ptr;

  /* "psycopg_c/pq/pgcancel.pyx":16
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)
 *         rv.pgcancel_ptr = ptr
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self) -> None:
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgcancel.pyx":13
 * 
 *     @staticmethod
 *     cdef PGcancel _from_ptr(libpq.PGcancel *ptr):             # <<<<<<<<<<<<<<
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)
 *         rv.pgcancel_ptr = ptr
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGcancel._from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgcancel.pyx":18
 *         return rv
 * 
 *     def __dealloc__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.free()
 * 
 */

/* Python wrapper */
static void __pyx_pw_9psycopg_c_2pq_8PGcancel_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_9psycopg_c_2pq_8PGcancel_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_9psycopg_c_2pq_8PGcancel_2__dealloc__(((struct __pyx_obj_9psycopg_c_2pq_PGcancel *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_9psycopg_c_2pq_8PGcancel_2__dealloc__(struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "psycopg_c/pq/pgcancel.pyx":19
 * 
 *     def __dealloc__(self) -> None:
 *         self.free()             # <<<<<<<<<<<<<<
 * 
 *     def free(self) -> None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_free); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[1] = {__pyx_t_3, };
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":18
 *         return rv
 * 
 *     def __dealloc__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.free()
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("psycopg_c.pq.PGcancel.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "psycopg_c/pq/pgcancel.pyx":21
 *         self.free()
 * 
 *     def free(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGcancel_5free(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGcancel_5free = {"free", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGcancel_5free, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGcancel_5free(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGcancel_4free(((struct __pyx_obj_9psycopg_c_2pq_PGcancel *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGcancel_4free(struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("free", 0);

  /* "psycopg_c/pq/pgcancel.pyx":22
 * 
 *     def free(self) -> None:
 *         if self.pgcancel_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
 *             self.pgcancel_ptr = NULL
 */
  __pyx_t_1 = (__pyx_v_self->pgcancel_ptr != NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgcancel.pyx":23
 *     def free(self) -> None:
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)             # <<<<<<<<<<<<<<
 *             self.pgcancel_ptr = NULL
 * 
 */
    PQfreeCancel(__pyx_v_self->pgcancel_ptr);

    /* "psycopg_c/pq/pgcancel.pyx":24
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
 *             self.pgcancel_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     def cancel(self) -> None:
 */
    __pyx_v_self->pgcancel_ptr = NULL;

    /* "psycopg_c/pq/pgcancel.pyx":22
 * 
 *     def free(self) -> None:
 *         if self.pgcancel_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
 *             self.pgcancel_ptr = NULL
 */
  }

  /* "psycopg_c/pq/pgcancel.pyx":21
 *         self.free()
 * 
 *     def free(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgcancel.pyx":26
 *             self.pgcancel_ptr = NULL
 * 
 *     def cancel(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGcancel_7cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGcancel_7cancel = {"cancel", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGcancel_7cancel, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGcancel_7cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGcancel_6cancel(((struct __pyx_obj_9psycopg_c_2pq_PGcancel *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGcancel_6cancel(struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self) {
  char __pyx_v_buf[0x100];
  int __pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cancel", 0);

  /* "psycopg_c/pq/pgcancel.pyx":28
 *     def cancel(self) -> None:
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))             # <<<<<<<<<<<<<<
 *         if not res:
 *             raise e.OperationalError(
 */
  __pyx_v_res = PQcancel(__pyx_v_self->pgcancel_ptr, __pyx_v_buf, (sizeof(__pyx_v_buf)));

  /* "psycopg_c/pq/pgcancel.pyx":29
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
 *         if not res:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"cancel failed: {buf.decode('utf8', 'ignore')}"
 */
  __pyx_t_1 = (!(__pyx_v_res != 0));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgcancel.pyx":30
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
 *         if not res:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"cancel failed: {buf.decode('utf8', 'ignore')}"
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_c/pq/pgcancel.pyx":31
 *         if not res:
 *             raise e.OperationalError(
 *                 f"cancel failed: {buf.decode('utf8', 'ignore')}"             # <<<<<<<<<<<<<<
 *             )
 */
    __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_buf, 0, strlen(__pyx_v_buf), NULL, ((char const *)"ignore"), PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_cancel_failed, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(4, 30, __pyx_L1_error)

    /* "psycopg_c/pq/pgcancel.pyx":29
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
 *         if not res:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"cancel failed: {buf.decode('utf8', 'ignore')}"
 */
  }

  /* "psycopg_c/pq/pgcancel.pyx":26
 *             self.pgcancel_ptr = NULL
 * 
 *     def cancel(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_c.pq.PGcancel.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGcancel_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGcancel_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGcancel_9__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGcancel_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGcancel_8__reduce_cython__(((struct __pyx_obj_9psycopg_c_2pq_PGcancel *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGcancel_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGcancel.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGcancel_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGcancel_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGcancel_11__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGcancel_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGcancel_10__setstate_cython__(((struct __pyx_obj_9psycopg_c_2pq_PGcancel *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGcancel_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGcancel.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/conninfo.pyx":11
 * 
 * class Conninfo:
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_defaults(cls) -> List[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8Conninfo_1get_defaults(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8Conninfo_1get_defaults = {"get_defaults", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8Conninfo_1get_defaults, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8Conninfo_1get_defaults(PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_defaults (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8Conninfo_get_defaults(__pyx_self, ((PyObject *)__pyx_v_cls));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8Conninfo_get_defaults(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls) {
  PQconninfoOption *__pyx_v_opts;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_defaults", 0);

  /* "psycopg_c/pq/conninfo.pyx":13
 *     @classmethod
 *     def get_defaults(cls) -> List[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()             # <<<<<<<<<<<<<<
 *         if opts is NULL :
 *             raise MemoryError("couldn't allocate connection defaults")
 */
  __pyx_v_opts = PQconndefaults();

  /* "psycopg_c/pq/conninfo.pyx":14
 *     def get_defaults(cls) -> List[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
 *         if opts is NULL :             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate connection defaults")
 *         rv = _options_from_array(opts)
 */
  __pyx_t_1 = (__pyx_v_opts == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/conninfo.pyx":15
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
 *         if opts is NULL :
 *             raise MemoryError("couldn't allocate connection defaults")             # <<<<<<<<<<<<<<
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(5, 15, __pyx_L1_error)

    /* "psycopg_c/pq/conninfo.pyx":14
 *     def get_defaults(cls) -> List[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
 *         if opts is NULL :             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate connection defaults")
 *         rv = _options_from_array(opts)
 */
  }

  /* "psycopg_c/pq/conninfo.pyx":16
 *         if opts is NULL :
 *             raise MemoryError("couldn't allocate connection defaults")
 *         rv = _options_from_array(opts)             # <<<<<<<<<<<<<<
 *         libpq.PQconninfoFree(opts)
 *         return rv
 */
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__options_from_array(__pyx_v_opts); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_rv = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "psycopg_c/pq/conninfo.pyx":17
 *             raise MemoryError("couldn't allocate connection defaults")
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  PQconninfoFree(__pyx_v_opts);

  /* "psycopg_c/pq/conninfo.pyx":18
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/conninfo.pyx":11
 * 
 * class Conninfo:
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_defaults(cls) -> List[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("psycopg_c.pq.Conninfo.get_defaults", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/conninfo.pyx":20
 *         return rv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(cls, const char *conninfo) -> List[ConninfoOption]:
 *         cdef char *errmsg = NULL
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8Conninfo_3parse(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8Conninfo_3parse = {"parse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_8Conninfo_3parse, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8Conninfo_3parse(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_cls = 0;
  char const *__pyx_v_conninfo;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_conninfo,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_conninfo,0};
    #endif
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 20, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_conninfo)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 20, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, 1); __PYX_ERR(5, 20, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse") < 0)) __PYX_ERR(5, 20, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_cls = values[0];
    __pyx_v_conninfo = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_conninfo) && PyErr_Occurred())) __PYX_ERR(5, 21, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, __pyx_nargs); __PYX_ERR(5, 20, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.Conninfo.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8Conninfo_2parse(__pyx_self, __pyx_v_cls, __pyx_v_conninfo);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8Conninfo_2parse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_cls, char const *__pyx_v_conninfo) {
  char *__pyx_v_errmsg;
  PQconninfoOption *__pyx_v_opts;
  PyObject *__pyx_v_exc = NULL;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse", 0);

  /* "psycopg_c/pq/conninfo.pyx":22
 *     @classmethod
 *     def parse(cls, const char *conninfo) -> List[ConninfoOption]:
 *         cdef char *errmsg = NULL             # <<<<<<<<<<<<<<
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)
 *         if opts is NULL:
 */
  __pyx_v_errmsg = NULL;

  /* "psycopg_c/pq/conninfo.pyx":23
 *     def parse(cls, const char *conninfo) -> List[ConninfoOption]:
 *         cdef char *errmsg = NULL
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)             # <<<<<<<<<<<<<<
 *         if opts is NULL:
 *             if errmsg is NULL:
 */
  __pyx_v_opts = PQconninfoParse(__pyx_v_conninfo, (&__pyx_v_errmsg));

  /* "psycopg_c/pq/conninfo.pyx":24
 *         cdef char *errmsg = NULL
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)
 *         if opts is NULL:             # <<<<<<<<<<<<<<
 *             if errmsg is NULL:
 *                 raise MemoryError("couldn't allocate on conninfo parse")
 */
  __pyx_t_1 = (__pyx_v_opts == NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/conninfo.pyx":25
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)
 *         if opts is NULL:
 *             if errmsg is NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError("couldn't allocate on conninfo parse")
 *             else:
 */
    __pyx_t_1 = (__pyx_v_errmsg == NULL);
    if (unlikely(__pyx_t_1)) {

      /* "psycopg_c/pq/conninfo.pyx":26
 *         if opts is NULL:
 *             if errmsg is NULL:
 *                 raise MemoryError("couldn't allocate on conninfo parse")             # <<<<<<<<<<<<<<
 *             else:
 *                 exc = e.OperationalError(errmsg.decode("utf8", "replace"))
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 26, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(5, 26, __pyx_L1_error)

      /* "psycopg_c/pq/conninfo.pyx":25
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)
 *         if opts is NULL:
 *             if errmsg is NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError("couldn't allocate on conninfo parse")
 *             else:
 */
    }

    /* "psycopg_c/pq/conninfo.pyx":28
 *                 raise MemoryError("couldn't allocate on conninfo parse")
 *             else:
 *                 exc = e.OperationalError(errmsg.decode("utf8", "replace"))             # <<<<<<<<<<<<<<
 *                 libpq.PQfreemem(errmsg)
 *                 raise exc
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_errmsg, 0, strlen(__pyx_v_errmsg), NULL, ((char const *)"replace"), PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 28, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_v_exc = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "psycopg_c/pq/conninfo.pyx":29
 *             else:
 *                 exc = e.OperationalError(errmsg.decode("utf8", "replace"))
 *                 libpq.PQfreemem(errmsg)             # <<<<<<<<<<<<<<
 *                 raise exc
 * 
 */
      PQfreemem(__pyx_v_errmsg);

      /* "psycopg_c/pq/conninfo.pyx":30
 *                 exc = e.OperationalError(errmsg.decode("utf8", "replace"))
 *                 libpq.PQfreemem(errmsg)
 *                 raise exc             # <<<<<<<<<<<<<<
 * 
 *         rv = _options_from_array(opts)
 */
      __Pyx_Raise(__pyx_v_exc, 0, 0, 0);
      __PYX_ERR(5, 30, __pyx_L1_error)
    }

    /* "psycopg_c/pq/conninfo.pyx":24
 *         cdef char *errmsg = NULL
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfoParse(conninfo, &errmsg)
 *         if opts is NULL:             # <<<<<<<<<<<<<<
 *             if errmsg is NULL:
 *                 raise MemoryError("couldn't allocate on conninfo parse")
 */
  }

  /* "psycopg_c/pq/conninfo.pyx":32
 *                 raise exc
 * 
 *         rv = _options_from_array(opts)             # <<<<<<<<<<<<<<
 *         libpq.PQconninfoFree(opts)
 *         return rv
 */
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__options_from_array(__pyx_v_opts); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_rv = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "psycopg_c/pq/conninfo.pyx":33
 * 
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  PQconninfoFree(__pyx_v_opts);

  /* "psycopg_c/pq/conninfo.pyx":34
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/conninfo.pyx":20
 *         return rv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(cls, const char *conninfo) -> List[ConninfoOption]:
 *         cdef char *errmsg = NULL
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_c.pq.Conninfo.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exc);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/conninfo.pyx":36
 *         return rv
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8Conninfo_5__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8Conninfo_5__repr__ = {"__repr__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8Conninfo_5__repr__, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8Conninfo_5__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8Conninfo_4__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8Conninfo_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "psycopg_c/pq/conninfo.pyx":37
 * 
 *     def __repr__(self):
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u__2);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__17);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__17);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__17);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_keyword); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_n_u_ascii};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_INCREF(__pyx_kp_u__18);
  __pyx_t_2 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__18);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__18);
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/conninfo.pyx":36
 *         return rv
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_c.pq.Conninfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/conninfo.pyx":40
 * 
 * 
 * cdef _options_from_array(libpq.PQconninfoOption *opts):             # <<<<<<<<<<<<<<
 *     rv = []
 *     cdef int i = 0
 */

static PyObject *__pyx_f_9psycopg_c_2pq__options_from_array(PQconninfoOption *__pyx_v_opts) {
  PyObject *__pyx_v_rv = NULL;
  int __pyx_v_i;
  PQconninfoOption *__pyx_v_opt;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_options_from_array", 0);

  /* "psycopg_c/pq/conninfo.pyx":41
 * 
 * cdef _options_from_array(libpq.PQconninfoOption *opts):
 *     rv = []             # <<<<<<<<<<<<<<
 *     cdef int i = 0
 *     cdef libpq.PQconninfoOption* opt
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/conninfo.pyx":42
 * cdef _options_from_array(libpq.PQconninfoOption *opts):
 *     rv = []
 *     cdef int i = 0             # <<<<<<<<<<<<<<
 *     cdef libpq.PQconninfoOption* opt
 *     while 1:
 */
  __pyx_v_i = 0;

  /* "psycopg_c/pq/conninfo.pyx":44
 *     cdef int i = 0
 *     cdef libpq.PQconninfoOption* opt
 *     while 1:             # <<<<<<<<<<<<<<
 *         opt = opts + i
 *         if opt.keyword is NULL:
 */
  while (1) {

    /* "psycopg_c/pq/conninfo.pyx":45
 *     cdef libpq.PQconninfoOption* opt
 *     while 1:
 *         opt = opts + i             # <<<<<<<<<<<<<<
 *         if opt.keyword is NULL:
 *             break
 */
    __pyx_v_opt = (__pyx_v_opts + __pyx_v_i);

    /* "psycopg_c/pq/conninfo.pyx":46
 *     while 1:
 *         opt = opts + i
 *         if opt.keyword is NULL:             # <<<<<<<<<<<<<<
 *             break
 *         rv.append(
 */
    __pyx_t_2 = (__pyx_v_opt->keyword == NULL);
    if (__pyx_t_2) {

      /* "psycopg_c/pq/conninfo.pyx":47
 *         opt = opts + i
 *         if opt.keyword is NULL:
 *             break             # <<<<<<<<<<<<<<
 *         rv.append(
 *             ConninfoOption(
 */
      goto __pyx_L4_break;

      /* "psycopg_c/pq/conninfo.pyx":46
 *     while 1:
 *         opt = opts + i
 *         if opt.keyword is NULL:             # <<<<<<<<<<<<<<
 *             break
 *         rv.append(
 */
    }

    /* "psycopg_c/pq/conninfo.pyx":49
 *             break
 *         rv.append(
 *             ConninfoOption(             # <<<<<<<<<<<<<<
 *                 keyword=opt.keyword,
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ConninfoOption); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "psycopg_c/pq/conninfo.pyx":50
 *         rv.append(
 *             ConninfoOption(
 *                 keyword=opt.keyword,             # <<<<<<<<<<<<<<
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,
 *                 compiled=opt.compiled if opt.compiled is not NULL else None,
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_opt->keyword); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_keyword, __pyx_t_4) < 0) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/conninfo.pyx":51
 *             ConninfoOption(
 *                 keyword=opt.keyword,
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,             # <<<<<<<<<<<<<<
 *                 compiled=opt.compiled if opt.compiled is not NULL else None,
 *                 val=opt.val if opt.val is not NULL else None,
 */
    if ((__pyx_v_opt->envvar != NULL)) {
      __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_opt->envvar); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 51, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_4 = Py_None;
    }
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_envvar, __pyx_t_4) < 0) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/conninfo.pyx":52
 *                 keyword=opt.keyword,
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,
 *                 compiled=opt.compiled if opt.compiled is not NULL else None,             # <<<<<<<<<<<<<<
 *                 val=opt.val if opt.val is not NULL else None,
 *                 label=opt.label if opt.label is not NULL else None,
 */
    if ((__pyx_v_opt->compiled != NULL)) {
      __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_opt->compiled); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_4 = Py_None;
    }
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_compiled, __pyx_t_4) < 0) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/conninfo.pyx":53
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,
 *                 compiled=opt.compiled if opt.compiled is not NULL else None,
 *                 val=opt.val if opt.val is not NULL else None,             # <<<<<<<<<<<<<<
 *                 label=opt.label if opt.label is not NULL else None,
 *                 dispchar=opt.dispchar if opt.dispchar is not NULL else None,
 */
    if ((__pyx_v_opt->val != NULL)) {
      __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_opt->val); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_4 = Py_None;
    }
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_val, __pyx_t_4) < 0) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/conninfo.pyx":54
 *                 compiled=opt.compiled if opt.compiled is not NULL else None,
 *                 val=opt.val if opt.val is not NULL else None,
 *                 label=opt.label if opt.label is not NULL else None,             # <<<<<<<<<<<<<<
 *                 dispchar=opt.dispchar if opt.dispchar is not NULL else None,
 *                 dispsize=opt.dispsize,
 */
    if ((__pyx_v_opt->label != NULL)) {
      __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_opt->label); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_4 = Py_None;
    }
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_label, __pyx_t_4) < 0) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/conninfo.pyx":55
 *                 val=opt.val if opt.val is not NULL else None,
 *                 label=opt.label if opt.label is not NULL else None,
 *                 dispchar=opt.dispchar if opt.dispchar is not NULL else None,             # <<<<<<<<<<<<<<
 *                 dispsize=opt.dispsize,
 *             )
 */
    if ((__pyx_v_opt->dispchar != NULL)) {
      __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_opt->dispchar); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 55, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_4 = Py_None;
    }
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dispchar, __pyx_t_4) < 0) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/conninfo.pyx":56
 *                 label=opt.label if opt.label is not NULL else None,
 *                 dispchar=opt.dispchar if opt.dispchar is not NULL else None,
 *                 dispsize=opt.dispsize,             # <<<<<<<<<<<<<<
 *             )
 *         )
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_opt->dispsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dispsize, __pyx_t_4) < 0) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/conninfo.pyx":49
 *             break
 *         rv.append(
 *             ConninfoOption(             # <<<<<<<<<<<<<<
 *                 keyword=opt.keyword,
 *                 envvar=opt.envvar if opt.envvar is not NULL else None,
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_c/pq/conninfo.pyx":48
 *         if opt.keyword is NULL:
 *             break
 *         rv.append(             # <<<<<<<<<<<<<<
 *             ConninfoOption(
 *                 keyword=opt.keyword,
 */
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 48, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/conninfo.pyx":59
 *             )
 *         )
 *         i += 1             # <<<<<<<<<<<<<<
 * 
 *     return rv
 */
    __pyx_v_i = (__pyx_v_i + 1);
  }
  __pyx_L4_break:;

  /* "psycopg_c/pq/conninfo.pyx":61
 *         i += 1
 * 
 *     return rv             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/conninfo.pyx":40
 * 
 * 
 * cdef _options_from_array(libpq.PQconninfoOption *opts):             # <<<<<<<<<<<<<<
 *     rv = []
 *     cdef int i = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_c.pq._options_from_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/escaping.pyx":14
 * 
 * cdef class Escaping:
 *     def __init__(self, PGconn conn = None):             # <<<<<<<<<<<<<<
 *         self.conn = conn
 * 
 */

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_8Escaping_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_8Escaping_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_conn = 0;
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_conn,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_conn,0};
    #endif
    PyObject* values[1] = {0};
    values[0] = (PyObject *)((struct __pyx_obj_9psycopg_c_2pq_PGconn *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_conn);
          if (value) { values[0] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 14, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(6, 14, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_conn = ((struct __pyx_obj_9psycopg_c_2pq_PGconn *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(6, 14, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conn), __pyx_ptype_9psycopg_c_2pq_PGconn, 1, "conn", 0))) __PYX_ERR(6, 14, __pyx_L1_error)
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8Escaping___init__(((struct __pyx_obj_9psycopg_c_2pq_Escaping *)__pyx_v_self), __pyx_v_conn);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_8Escaping___init__(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_conn) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "psycopg_c/pq/escaping.pyx":15
 * cdef class Escaping:
 *     def __init__(self, PGconn conn = None):
 *         self.conn = conn             # <<<<<<<<<<<<<<
 * 
 *     cpdef escape_literal(self, data):
 */
  __Pyx_INCREF((PyObject *)__pyx_v_conn);
  __Pyx_GIVEREF((PyObject *)__pyx_v_conn);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->conn);
  __Pyx_DECREF((PyObject *)__pyx_v_self->conn);
  __pyx_v_self->conn = __pyx_v_conn;

  /* "psycopg_c/pq/escaping.pyx":14
 * 
 * cdef class Escaping:
 *     def __init__(self, PGconn conn = None):             # <<<<<<<<<<<<<<
 *         self.conn = conn
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/escaping.pyx":17
 *         self.conn = conn
 * 
 *     cpdef escape_literal(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef bytes rv
 */

static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_3escape_literal(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_8Escaping_escape_literal(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) {
  char *__pyx_v_out;
  char *__pyx_v_ptr;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_literal", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_escape_literal); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 17, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9psycopg_c_2pq_8Escaping_3escape_literal)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 17, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "psycopg_c/pq/escaping.pyx":23
 *         cdef Py_ssize_t length
 * 
 *         if self.conn is None:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("escape_literal failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
 */
  __pyx_t_6 = (((PyObject *)__pyx_v_self->conn) == Py_None);
  if (unlikely(__pyx_t_6)) {

    /* "psycopg_c/pq/escaping.pyx":24
 * 
 *         if self.conn is None:
 *             raise e.OperationalError("escape_literal failed: no connection provided")             # <<<<<<<<<<<<<<
 *         if self.conn._pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_escape_literal_failed_no_connect};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 24, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 24, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":23
 *         cdef Py_ssize_t length
 * 
 *         if self.conn is None:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("escape_literal failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
 */
  }

  /* "psycopg_c/pq/escaping.pyx":25
 *         if self.conn is None:
 *             raise e.OperationalError("escape_literal failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
 */
  __pyx_t_6 = (__pyx_v_self->conn->_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_6)) {

    /* "psycopg_c/pq/escaping.pyx":26
 *             raise e.OperationalError("escape_literal failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_the_connection_is_closed};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 26, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 26, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":25
 *         if self.conn is None:
 *             raise e.OperationalError("escape_literal failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
 */
  }

  /* "psycopg_c/pq/escaping.pyx":28
 *             raise e.OperationalError("the connection is closed")
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)             # <<<<<<<<<<<<<<
 * 
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)
 */
  __pyx_t_5 = __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 28, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":30
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)             # <<<<<<<<<<<<<<
 *         if out is NULL:
 *             raise e.OperationalError(
 */
  __pyx_v_out = PQescapeLiteral(__pyx_v_self->conn->_pgconn_ptr, __pyx_v_ptr, __pyx_v_length);

  /* "psycopg_c/pq/escaping.pyx":31
 * 
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_literal failed: {error_message(self.conn)}"
 */
  __pyx_t_6 = (__pyx_v_out == NULL);
  if (unlikely(__pyx_t_6)) {

    /* "psycopg_c/pq/escaping.pyx":32
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"escape_literal failed: {error_message(self.conn)}"
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "psycopg_c/pq/escaping.pyx":33
 *         if out is NULL:
 *             raise e.OperationalError(
 *                 f"escape_literal failed: {error_message(self.conn)}"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self->conn)};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_escape_literal_failed, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 32, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":31
 * 
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_literal failed: {error_message(self.conn)}"
 */
  }

  /* "psycopg_c/pq/escaping.pyx":36
 *             )
 * 
 *         return PyMemoryView_FromObject(             # <<<<<<<<<<<<<<
 *             PQBuffer._from_buffer(<unsigned char *>out, strlen(out))
 *         )
 */
  __Pyx_XDECREF(__pyx_r);

  /* "psycopg_c/pq/escaping.pyx":37
 * 
 *         return PyMemoryView_FromObject(
 *             PQBuffer._from_buffer(<unsigned char *>out, strlen(out))             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PQBuffer__from_buffer(((unsigned char *)__pyx_v_out), strlen(__pyx_v_out))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "psycopg_c/pq/escaping.pyx":36
 *             )
 * 
 *         return PyMemoryView_FromObject(             # <<<<<<<<<<<<<<
 *             PQBuffer._from_buffer(<unsigned char *>out, strlen(out))
 *         )
 */
  __pyx_t_3 = PyMemoryView_FromObject(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/escaping.pyx":17
 *         self.conn = conn
 * 
 *     cpdef escape_literal(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef bytes rv
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.escape_literal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_3escape_literal(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8Escaping_3escape_literal = {"escape_literal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8Escaping_3escape_literal, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_3escape_literal(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_literal (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8Escaping_2escape_literal(((struct __pyx_obj_9psycopg_c_2pq_Escaping *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_2escape_literal(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_literal", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq_8Escaping_escape_literal(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.escape_literal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/escaping.pyx":40
 *         )
 * 
 *     cpdef escape_identifier(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
 */

static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_5escape_identifier(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_8Escaping_escape_identifier(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) {
  char *__pyx_v_out;
  char *__pyx_v_ptr;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_identifier", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_escape_identifier); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 40, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9psycopg_c_2pq_8Escaping_5escape_identifier)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 40, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "psycopg_c/pq/escaping.pyx":45
 *         cdef Py_ssize_t length
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)             # <<<<<<<<<<<<<<
 * 
 *         if self.conn is None:
 */
  __pyx_t_5 = __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 45, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":47
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         if self.conn is None:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("escape_identifier failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
 */
  __pyx_t_6 = (((PyObject *)__pyx_v_self->conn) == Py_None);
  if (unlikely(__pyx_t_6)) {

    /* "psycopg_c/pq/escaping.pyx":48
 * 
 *         if self.conn is None:
 *             raise e.OperationalError("escape_identifier failed: no connection provided")             # <<<<<<<<<<<<<<
 *         if self.conn._pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_escape_identifier_failed_no_conn};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 48, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 48, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":47
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         if self.conn is None:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("escape_identifier failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
 */
  }

  /* "psycopg_c/pq/escaping.pyx":49
 *         if self.conn is None:
 *             raise e.OperationalError("escape_identifier failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
 */
  __pyx_t_6 = (__pyx_v_self->conn->_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_6)) {

    /* "psycopg_c/pq/escaping.pyx":50
 *             raise e.OperationalError("escape_identifier failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_the_connection_is_closed};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 50, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":49
 *         if self.conn is None:
 *             raise e.OperationalError("escape_identifier failed: no connection provided")
 *         if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
 */
  }

  /* "psycopg_c/pq/escaping.pyx":52
 *             raise e.OperationalError("the connection is closed")
 * 
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)             # <<<<<<<<<<<<<<
 *         if out is NULL:
 *             raise e.OperationalError(
 */
  __pyx_v_out = PQescapeIdentifier(__pyx_v_self->conn->_pgconn_ptr, __pyx_v_ptr, __pyx_v_length);

  /* "psycopg_c/pq/escaping.pyx":53
 * 
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_identifier failed: {error_message(self.conn)}"
 */
  __pyx_t_6 = (__pyx_v_out == NULL);
  if (unlikely(__pyx_t_6)) {

    /* "psycopg_c/pq/escaping.pyx":54
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"escape_identifier failed: {error_message(self.conn)}"
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "psycopg_c/pq/escaping.pyx":55
 *         if out is NULL:
 *             raise e.OperationalError(
 *                 f"escape_identifier failed: {error_message(self.conn)}"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self->conn)};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 55, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_escape_identifier_failed, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 54, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":53
 * 
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_identifier failed: {error_message(self.conn)}"
 */
  }

  /* "psycopg_c/pq/escaping.pyx":58
 *             )
 * 
 *         return PyMemoryView_FromObject(             # <<<<<<<<<<<<<<
 *             PQBuffer._from_buffer(<unsigned char *>out, strlen(out))
 *         )
 */
  __Pyx_XDECREF(__pyx_r);

  /* "psycopg_c/pq/escaping.pyx":59
 * 
 *         return PyMemoryView_FromObject(
 *             PQBuffer._from_buffer(<unsigned char *>out, strlen(out))             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PQBuffer__from_buffer(((unsigned char *)__pyx_v_out), strlen(__pyx_v_out))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "psycopg_c/pq/escaping.pyx":58
 *             )
 * 
 *         return PyMemoryView_FromObject(             # <<<<<<<<<<<<<<
 *             PQBuffer._from_buffer(<unsigned char *>out, strlen(out))
 *         )
 */
  __pyx_t_3 = PyMemoryView_FromObject(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/escaping.pyx":40
 *         )
 * 
 *     cpdef escape_identifier(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.escape_identifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_5escape_identifier(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8Escaping_5escape_identifier = {"escape_identifier", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8Escaping_5escape_identifier, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_5escape_identifier(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_identifier (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8Escaping_4escape_identifier(((struct __pyx_obj_9psycopg_c_2pq_Escaping *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_4escape_identifier(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_identifier", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq_8Escaping_escape_identifier(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.escape_identifier", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/escaping.pyx":62
 *         )
 * 
 *     cpdef escape_string(self, data):             # <<<<<<<<<<<<<<
 *         cdef int error
 *         cdef size_t len_out
 */

static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_7escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_8Escaping_escape_string(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) {
  int __pyx_v_error;
  size_t __pyx_v_len_out;
  char *__pyx_v_ptr;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_rv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_string", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_escape_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 62, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9psycopg_c_2pq_8Escaping_7escape_string)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 62, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "psycopg_c/pq/escaping.pyx":69
 *         cdef bytearray rv
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)             # <<<<<<<<<<<<<<
 * 
 *         rv = PyByteArray_FromStringAndSize("", 0)
 */
  __pyx_t_5 = __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 69, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":71
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         rv = PyByteArray_FromStringAndSize("", 0)             # <<<<<<<<<<<<<<
 *         PyByteArray_Resize(rv, length * 2 + 1)
 * 
 */
  __pyx_t_1 = PyByteArray_FromStringAndSize(((char *)""), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/escaping.pyx":72
 * 
 *         rv = PyByteArray_FromStringAndSize("", 0)
 *         PyByteArray_Resize(rv, length * 2 + 1)             # <<<<<<<<<<<<<<
 * 
 *         if self.conn is not None:
 */
  (void)(PyByteArray_Resize(__pyx_v_rv, ((__pyx_v_length * 2) + 1)));

  /* "psycopg_c/pq/escaping.pyx":74
 *         PyByteArray_Resize(rv, length * 2 + 1)
 * 
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")
 */
  __pyx_t_6 = (((PyObject *)__pyx_v_self->conn) != Py_None);
  if (__pyx_t_6) {

    /* "psycopg_c/pq/escaping.pyx":75
 * 
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError("the connection is closed")
 * 
 */
    __pyx_t_6 = (__pyx_v_self->conn->_pgconn_ptr == NULL);
    if (unlikely(__pyx_t_6)) {

      /* "psycopg_c/pq/escaping.pyx":76
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *             len_out = libpq.PQescapeStringConn(
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_the_connection_is_closed};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 76, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(6, 76, __pyx_L1_error)

      /* "psycopg_c/pq/escaping.pyx":75
 * 
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError("the connection is closed")
 * 
 */
    }

    /* "psycopg_c/pq/escaping.pyx":78
 *                 raise e.OperationalError("the connection is closed")
 * 
 *             len_out = libpq.PQescapeStringConn(             # <<<<<<<<<<<<<<
 *                 self.conn._pgconn_ptr, PyByteArray_AS_STRING(rv),
 *                 ptr, length, &error
 */
    __pyx_v_len_out = PQescapeStringConn(__pyx_v_self->conn->_pgconn_ptr, PyByteArray_AS_STRING(__pyx_v_rv), __pyx_v_ptr, __pyx_v_length, (&__pyx_v_error));

    /* "psycopg_c/pq/escaping.pyx":82
 *                 ptr, length, &error
 *             )
 *             if error:             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError(
 *                     f"escape_string failed: {error_message(self.conn)}"
 */
    __pyx_t_6 = (__pyx_v_error != 0);
    if (unlikely(__pyx_t_6)) {

      /* "psycopg_c/pq/escaping.pyx":83
 *             )
 *             if error:
 *                 raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                     f"escape_string failed: {error_message(self.conn)}"
 *                 )
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "psycopg_c/pq/escaping.pyx":84
 *             if error:
 *                 raise e.OperationalError(
 *                     f"escape_string failed: {error_message(self.conn)}"             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_5 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, ((PyObject *)__pyx_v_self->conn)};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 84, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_escape_string_failed, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_5 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 83, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(6, 83, __pyx_L1_error)

      /* "psycopg_c/pq/escaping.pyx":82
 *                 ptr, length, &error
 *             )
 *             if error:             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError(
 *                     f"escape_string failed: {error_message(self.conn)}"
 */
    }

    /* "psycopg_c/pq/escaping.pyx":74
 *         PyByteArray_Resize(rv, length * 2 + 1)
 * 
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")
 */
    goto __pyx_L3;
  }

  /* "psycopg_c/pq/escaping.pyx":88
 * 
 *         else:
 *             len_out = libpq.PQescapeString(PyByteArray_AS_STRING(rv), ptr, length)             # <<<<<<<<<<<<<<
 * 
 *         # shrink back or the length will be reported different
 */
  /*else*/ {
    __pyx_v_len_out = PQescapeString(PyByteArray_AS_STRING(__pyx_v_rv), __pyx_v_ptr, __pyx_v_length);
  }
  __pyx_L3:;

  /* "psycopg_c/pq/escaping.pyx":91
 * 
 *         # shrink back or the length will be reported different
 *         PyByteArray_Resize(rv, len_out)             # <<<<<<<<<<<<<<
 *         return PyMemoryView_FromObject(rv)
 * 
 */
  (void)(PyByteArray_Resize(__pyx_v_rv, __pyx_v_len_out));

  /* "psycopg_c/pq/escaping.pyx":92
 *         # shrink back or the length will be reported different
 *         PyByteArray_Resize(rv, len_out)
 *         return PyMemoryView_FromObject(rv)             # <<<<<<<<<<<<<<
 * 
 *     cpdef escape_bytea(self, data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyMemoryView_FromObject(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/escaping.pyx":62
 *         )
 * 
 *     cpdef escape_string(self, data):             # <<<<<<<<<<<<<<
 *         cdef int error
 *         cdef size_t len_out
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.escape_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_7escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8Escaping_7escape_string = {"escape_string", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8Escaping_7escape_string, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_7escape_string(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_string (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8Escaping_6escape_string(((struct __pyx_obj_9psycopg_c_2pq_Escaping *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_6escape_string(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq_8Escaping_escape_string(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.escape_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/escaping.pyx":94
 *         return PyMemoryView_FromObject(rv)
 * 
 *     cpdef escape_bytea(self, data):             # <<<<<<<<<<<<<<
 *         cdef size_t len_out
 *         cdef unsigned char *out
 */

static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_9escape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_8Escaping_escape_bytea(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data, int __pyx_skip_dispatch) {
  size_t __pyx_v_len_out;
  unsigned char *__pyx_v_out;
  char *__pyx_v_ptr;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_bytea", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_escape_bytea); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9psycopg_c_2pq_8Escaping_9escape_bytea)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_data};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 94, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "psycopg_c/pq/escaping.pyx":100
 *         cdef Py_ssize_t length
 * 
 *         if self.conn is not None and self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
 */
  __pyx_t_7 = (((PyObject *)__pyx_v_self->conn) != Py_None);
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_self->conn->_pgconn_ptr == NULL);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_6)) {

    /* "psycopg_c/pq/escaping.pyx":101
 * 
 *         if self.conn is not None and self.conn._pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_the_connection_is_closed};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 101, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 101, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":100
 *         cdef Py_ssize_t length
 * 
 *         if self.conn is not None and self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
 */
  }

  /* "psycopg_c/pq/escaping.pyx":103
 *             raise e.OperationalError("the connection is closed")
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)             # <<<<<<<<<<<<<<
 * 
 *         if self.conn is not None:
 */
  __pyx_t_5 = __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 103, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":105
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             out = libpq.PQescapeByteaConn(
 *                 self.conn._pgconn_ptr, <unsigned char *>ptr, length, &len_out)
 */
  __pyx_t_6 = (((PyObject *)__pyx_v_self->conn) != Py_None);
  if (__pyx_t_6) {

    /* "psycopg_c/pq/escaping.pyx":106
 * 
 *         if self.conn is not None:
 *             out = libpq.PQescapeByteaConn(             # <<<<<<<<<<<<<<
 *                 self.conn._pgconn_ptr, <unsigned char *>ptr, length, &len_out)
 *         else:
 */
    __pyx_v_out = PQescapeByteaConn(__pyx_v_self->conn->_pgconn_ptr, ((unsigned char *)__pyx_v_ptr), __pyx_v_length, (&__pyx_v_len_out));

    /* "psycopg_c/pq/escaping.pyx":105
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             out = libpq.PQescapeByteaConn(
 *                 self.conn._pgconn_ptr, <unsigned char *>ptr, length, &len_out)
 */
    goto __pyx_L6;
  }

  /* "psycopg_c/pq/escaping.pyx":109
 *                 self.conn._pgconn_ptr, <unsigned char *>ptr, length, &len_out)
 *         else:
 *             out = libpq.PQescapeBytea(<unsigned char *>ptr, length, &len_out)             # <<<<<<<<<<<<<<
 * 
 *         if out is NULL:
 */
  /*else*/ {
    __pyx_v_out = PQescapeBytea(((unsigned char *)__pyx_v_ptr), __pyx_v_length, (&__pyx_v_len_out));
  }
  __pyx_L6:;

  /* "psycopg_c/pq/escaping.pyx":111
 *             out = libpq.PQescapeBytea(<unsigned char *>ptr, length, &len_out)
 * 
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError(
 *                 f"couldn't allocate for escape_bytea of {len(data)} bytes"
 */
  __pyx_t_6 = (__pyx_v_out == NULL);
  if (unlikely(__pyx_t_6)) {

    /* "psycopg_c/pq/escaping.pyx":113
 *         if out is NULL:
 *             raise MemoryError(
 *                 f"couldn't allocate for escape_bytea of {len(data)} bytes"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_couldn_t_allocate_for_escape_byt);
    __pyx_t_8 += 38;
    __Pyx_GIVEREF(__pyx_kp_u_couldn_t_allocate_for_escape_byt);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_couldn_t_allocate_for_escape_byt);
    __pyx_t_10 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(6, 113, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_10, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u_bytes);
    __pyx_t_8 += 6;
    __Pyx_GIVEREF(__pyx_kp_u_bytes);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_bytes);
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "psycopg_c/pq/escaping.pyx":112
 * 
 *         if out is NULL:
 *             raise MemoryError(             # <<<<<<<<<<<<<<
 *                 f"couldn't allocate for escape_bytea of {len(data)} bytes"
 *             )
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 112, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":111
 *             out = libpq.PQescapeBytea(<unsigned char *>ptr, length, &len_out)
 * 
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError(
 *                 f"couldn't allocate for escape_bytea of {len(data)} bytes"
 */
  }

  /* "psycopg_c/pq/escaping.pyx":116
 *             )
 * 
 *         return PyMemoryView_FromObject(             # <<<<<<<<<<<<<<
 *             PQBuffer._from_buffer(out, len_out - 1)  # out includes final 0
 *         )
 */
  __Pyx_XDECREF(__pyx_r);

  /* "psycopg_c/pq/escaping.pyx":117
 * 
 *         return PyMemoryView_FromObject(
 *             PQBuffer._from_buffer(out, len_out - 1)  # out includes final 0             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PQBuffer__from_buffer(__pyx_v_out, (__pyx_v_len_out - 1))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "psycopg_c/pq/escaping.pyx":116
 *             )
 * 
 *         return PyMemoryView_FromObject(             # <<<<<<<<<<<<<<
 *             PQBuffer._from_buffer(out, len_out - 1)  # out includes final 0
 *         )
 */
  __pyx_t_3 = PyMemoryView_FromObject(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/escaping.pyx":94
 *         return PyMemoryView_FromObject(rv)
 * 
 *     cpdef escape_bytea(self, data):             # <<<<<<<<<<<<<<
 *         cdef size_t len_out
 *         cdef unsigned char *out
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.escape_bytea", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_9escape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8Escaping_9escape_bytea = {"escape_bytea", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8Escaping_9escape_bytea, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_9escape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_bytea (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8Escaping_8escape_bytea(((struct __pyx_obj_9psycopg_c_2pq_Escaping *)__pyx_v_self), ((PyObject *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_8escape_bytea(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("escape_bytea", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq_8Escaping_escape_bytea(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.escape_bytea", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/escaping.pyx":120
 *         )
 * 
 *     cpdef unescape_bytea(self, const unsigned char *data):             # <<<<<<<<<<<<<<
 *         # not needed, but let's keep it symmetric with the escaping:
 *         # if a connection is passed in, it must be valid.
 */

static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_11unescape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_arg_data); /*proto*/
static PyObject *__pyx_f_9psycopg_c_2pq_8Escaping_unescape_bytea(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, unsigned char const *__pyx_v_data, int __pyx_skip_dispatch) {
  size_t __pyx_v_len_out;
  unsigned char *__pyx_v_out;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unescape_bytea", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unescape_bytea); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #ifdef __Pyx_CyFunction_USED
      if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
      #else
      if (!PyCFunction_Check(__pyx_t_1)
      #endif
              || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_9psycopg_c_2pq_8Escaping_11unescape_bytea)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_PyBytes_FromCString(__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 120, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 120, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "psycopg_c/pq/escaping.pyx":123
 *         # not needed, but let's keep it symmetric with the escaping:
 *         # if a connection is passed in, it must be valid.
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")
 */
  __pyx_t_7 = (((PyObject *)__pyx_v_self->conn) != Py_None);
  if (__pyx_t_7) {

    /* "psycopg_c/pq/escaping.pyx":124
 *         # if a connection is passed in, it must be valid.
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError("the connection is closed")
 * 
 */
    __pyx_t_7 = (__pyx_v_self->conn->_pgconn_ptr == NULL);
    if (unlikely(__pyx_t_7)) {

      /* "psycopg_c/pq/escaping.pyx":125
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *         cdef size_t len_out
 */
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_the_connection_is_closed};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 125, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(6, 125, __pyx_L1_error)

      /* "psycopg_c/pq/escaping.pyx":124
 *         # if a connection is passed in, it must be valid.
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError("the connection is closed")
 * 
 */
    }

    /* "psycopg_c/pq/escaping.pyx":123
 *         # not needed, but let's keep it symmetric with the escaping:
 *         # if a connection is passed in, it must be valid.
 *         if self.conn is not None:             # <<<<<<<<<<<<<<
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")
 */
  }

  /* "psycopg_c/pq/escaping.pyx":128
 * 
 *         cdef size_t len_out
 *         cdef unsigned char *out = libpq.PQunescapeBytea(data, &len_out)             # <<<<<<<<<<<<<<
 *         if out is NULL:
 *             raise MemoryError(
 */
  __pyx_v_out = PQunescapeBytea(__pyx_v_data, (&__pyx_v_len_out));

  /* "psycopg_c/pq/escaping.pyx":129
 *         cdef size_t len_out
 *         cdef unsigned char *out = libpq.PQunescapeBytea(data, &len_out)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError(
 *                 f"couldn't allocate for unescape_bytea of {len(data)} bytes"
 */
  __pyx_t_7 = (__pyx_v_out == NULL);
  if (unlikely(__pyx_t_7)) {

    /* "psycopg_c/pq/escaping.pyx":131
 *         if out is NULL:
 *             raise MemoryError(
 *                 f"couldn't allocate for unescape_bytea of {len(data)} bytes"             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_couldn_t_allocate_for_unescape_b);
    __pyx_t_8 += 40;
    __Pyx_GIVEREF(__pyx_kp_u_couldn_t_allocate_for_unescape_b);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_couldn_t_allocate_for_unescape_b);
    __pyx_t_10 = __Pyx_ssize_strlen(((char const *)__pyx_v_data)); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(6, 131, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_10, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u_bytes);
    __pyx_t_8 += 6;
    __Pyx_GIVEREF(__pyx_kp_u_bytes);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_bytes);
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "psycopg_c/pq/escaping.pyx":130
 *         cdef unsigned char *out = libpq.PQunescapeBytea(data, &len_out)
 *         if out is NULL:
 *             raise MemoryError(             # <<<<<<<<<<<<<<
 *                 f"couldn't allocate for unescape_bytea of {len(data)} bytes"
 *             )
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 130, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":129
 *         cdef size_t len_out
 *         cdef unsigned char *out = libpq.PQunescapeBytea(data, &len_out)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError(
 *                 f"couldn't allocate for unescape_bytea of {len(data)} bytes"
 */
  }

  /* "psycopg_c/pq/escaping.pyx":134
 *             )
 * 
 *         return PyMemoryView_FromObject(PQBuffer._from_buffer(out, len_out))             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PQBuffer__from_buffer(__pyx_v_out, __pyx_v_len_out)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyMemoryView_FromObject(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/escaping.pyx":120
 *         )
 * 
 *     cpdef unescape_bytea(self, const unsigned char *data):             # <<<<<<<<<<<<<<
 *         # not needed, but let's keep it symmetric with the escaping:
 *         # if a connection is passed in, it must be valid.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.unescape_bytea", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_11unescape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_arg_data); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8Escaping_11unescape_bytea = {"unescape_bytea", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8Escaping_11unescape_bytea, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_11unescape_bytea(PyObject *__pyx_v_self, PyObject *__pyx_arg_data) {
  unsigned char const *__pyx_v_data;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unescape_bytea (wrapper)", 0);
  assert(__pyx_arg_data); {
    __pyx_v_data = __Pyx_PyObject_AsUString(__pyx_arg_data); if (unlikely((!__pyx_v_data) && PyErr_Occurred())) __PYX_ERR(6, 120, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.unescape_bytea", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8Escaping_10unescape_bytea(((struct __pyx_obj_9psycopg_c_2pq_Escaping *)__pyx_v_self), ((unsigned char const *)__pyx_v_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_10unescape_bytea(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, unsigned char const *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unescape_bytea", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq_8Escaping_unescape_bytea(__pyx_v_self, __pyx_v_data, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.unescape_bytea", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8Escaping_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8Escaping_13__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8Escaping_12__reduce_cython__(((struct __pyx_obj_9psycopg_c_2pq_Escaping *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_12__reduce_cython__(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.conn,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_self->conn);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->conn);
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->conn));
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.conn,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.conn,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.conn is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.conn,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.conn is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state
 */
  /*else*/ {
    __pyx_t_2 = (((PyObject *)__pyx_v_self->conn) != Py_None);
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.conn is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.conn is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Escaping); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_8405287);
    __Pyx_GIVEREF(__pyx_int_8405287);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_8405287);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.conn is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Escaping__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Escaping); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_8405287);
    __Pyx_GIVEREF(__pyx_int_8405287);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_8405287);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Escaping__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8Escaping_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8Escaping_15__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8Escaping_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8Escaping_14__setstate_cython__(((struct __pyx_obj_9psycopg_c_2pq_Escaping *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8Escaping_14__setstate_cython__(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Escaping__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq___pyx_unpickle_Escaping__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Escaping__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pqbuffer.pyx":19
 *     """
 *     @staticmethod
 *     cdef PQBuffer _from_buffer(unsigned char *buf, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)
 *         rv.buf = buf
 */

static struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_f_9psycopg_c_2pq_8PQBuffer__from_buffer(unsigned char *__pyx_v_buf, Py_ssize_t __pyx_v_length) {
  struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_rv = 0;
  struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_buffer", 0);

  /* "psycopg_c/pq/pqbuffer.pyx":20
 *     @staticmethod
 *     cdef PQBuffer _from_buffer(unsigned char *buf, Py_ssize_t length):
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)             # <<<<<<<<<<<<<<
 *         rv.buf = buf
 *         rv.len = length
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9psycopg_c_2pq_PQBuffer(((PyTypeObject *)__pyx_ptype_9psycopg_c_2pq_PQBuffer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 20, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_rv = ((struct __pyx_obj_9psycopg_c_2pq_PQBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/pqbuffer.pyx":21
 *     cdef PQBuffer _from_buffer(unsigned char *buf, Py_ssize_t length):
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)
 *         rv.buf = buf             # <<<<<<<<<<<<<<
 *         rv.len = length
 *         return rv
 */
  __pyx_v_rv->buf = __pyx_v_buf;

  /* "psycopg_c/pq/pqbuffer.pyx":22
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)
 *         rv.buf = buf
 *         rv.len = length             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __pyx_v_rv->len = __pyx_v_length;

  /* "psycopg_c/pq/pqbuffer.pyx":23
 *         rv.buf = buf
 *         rv.len = length
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pqbuffer.pyx":19
 *     """
 *     @staticmethod
 *     cdef PQBuffer _from_buffer(unsigned char *buf, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)
 *         rv.buf = buf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PQBuffer._from_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pqbuffer.pyx":25
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 *         self.len = 0
 */

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_8PQBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_8PQBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PQBuffer___cinit__(((struct __pyx_obj_9psycopg_c_2pq_PQBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_8PQBuffer___cinit__(struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "psycopg_c/pq/pqbuffer.pyx":26
 * 
 *     def __cinit__(self):
 *         self.buf = NULL             # <<<<<<<<<<<<<<
 *         self.len = 0
 * 
 */
  __pyx_v_self->buf = NULL;

  /* "psycopg_c/pq/pqbuffer.pyx":27
 *     def __cinit__(self):
 *         self.buf = NULL
 *         self.len = 0             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->len = 0;

  /* "psycopg_c/pq/pqbuffer.pyx":25
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 *         self.len = 0
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pqbuffer.pyx":29
 *         self.len = 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.buf:
 *             libpq.PQfreemem(self.buf)
 */

/* Python wrapper */
static void __pyx_pw_9psycopg_c_2pq_8PQBuffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_9psycopg_c_2pq_8PQBuffer_3__dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_9psycopg_c_2pq_8PQBuffer_2__dealloc__(((struct __pyx_obj_9psycopg_c_2pq_PQBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_9psycopg_c_2pq_8PQBuffer_2__dealloc__(struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "psycopg_c/pq/pqbuffer.pyx":30
 * 
 *     def __dealloc__(self):
 *         if self.buf:             # <<<<<<<<<<<<<<
 *             libpq.PQfreemem(self.buf)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->buf != 0);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pqbuffer.pyx":31
 *     def __dealloc__(self):
 *         if self.buf:
 *             libpq.PQfreemem(self.buf)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
    PQfreemem(__pyx_v_self->buf);

    /* "psycopg_c/pq/pqbuffer.pyx":30
 * 
 *     def __dealloc__(self):
 *         if self.buf:             # <<<<<<<<<<<<<<
 *             libpq.PQfreemem(self.buf)
 * 
 */
  }

  /* "psycopg_c/pq/pqbuffer.pyx":29
 *         self.len = 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.buf:
 *             libpq.PQfreemem(self.buf)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "psycopg_c/pq/pqbuffer.pyx":33
 *             libpq.PQfreemem(self.buf)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PQBuffer_5__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_8PQBuffer_5__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PQBuffer_4__repr__(((struct __pyx_obj_9psycopg_c_2pq_PQBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PQBuffer_4__repr__(struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "psycopg_c/pq/pqbuffer.pyx":34
 * 
 *     def __repr__(self):
 *         return (             # <<<<<<<<<<<<<<
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *             f"({bytes(self)})"
 */
  __Pyx_XDECREF(__pyx_r);

  /* "psycopg_c/pq/pqbuffer.pyx":35
 *     def __repr__(self):
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *             f"({bytes(self)})"
 *         )
 */
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_module); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u_);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_qualname); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__19);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__19);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__19);

  /* "psycopg_c/pq/pqbuffer.pyx":36
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *             f"({bytes(self)})"             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__20);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__20);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u__20);

  /* "psycopg_c/pq/pqbuffer.pyx":35
 *     def __repr__(self):
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *             f"({bytes(self)})"
 *         )
 */
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 6, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pqbuffer.pyx":33
 *             libpq.PQfreemem(self.buf)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_c.pq.PQBuffer.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pqbuffer.pyx":39
 *         )
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = self.buf
 *         buffer.obj = self
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_9psycopg_c_2pq_8PQBuffer_7__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_9psycopg_c_2pq_8PQBuffer_7__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PQBuffer_6__getbuffer__(((struct __pyx_obj_9psycopg_c_2pq_PQBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_8PQBuffer_6__getbuffer__(struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned char *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  if (unlikely(__pyx_v_buffer == NULL)) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_buffer->obj);

  /* "psycopg_c/pq/pqbuffer.pyx":40
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):
 *         buffer.buf = self.buf             # <<<<<<<<<<<<<<
 *         buffer.obj = self
 *         buffer.len = self.len
 */
  __pyx_t_1 = __pyx_v_self->buf;
  __pyx_v_buffer->buf = __pyx_t_1;

  /* "psycopg_c/pq/pqbuffer.pyx":41
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):
 *         buffer.buf = self.buf
 *         buffer.obj = self             # <<<<<<<<<<<<<<
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)
 */
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  __Pyx_GOTREF(__pyx_v_buffer->obj);
  __Pyx_DECREF(__pyx_v_buffer->obj);
  __pyx_v_buffer->obj = ((PyObject *)__pyx_v_self);

  /* "psycopg_c/pq/pqbuffer.pyx":42
 *         buffer.buf = self.buf
 *         buffer.obj = self
 *         buffer.len = self.len             # <<<<<<<<<<<<<<
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1
 */
  __pyx_t_2 = __pyx_v_self->len;
  __pyx_v_buffer->len = __pyx_t_2;

  /* "psycopg_c/pq/pqbuffer.pyx":43
 *         buffer.obj = self
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)             # <<<<<<<<<<<<<<
 *         buffer.readonly = 1
 *         buffer.ndim = 1
 */
  __pyx_v_buffer->itemsize = (sizeof(unsigned char));

  /* "psycopg_c/pq/pqbuffer.pyx":44
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1             # <<<<<<<<<<<<<<
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char
 */
  __pyx_v_buffer->readonly = 1;

  /* "psycopg_c/pq/pqbuffer.pyx":45
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1
 *         buffer.ndim = 1             # <<<<<<<<<<<<<<
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len
 */
  __pyx_v_buffer->ndim = 1;

  /* "psycopg_c/pq/pqbuffer.pyx":46
 *         buffer.readonly = 1
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char             # <<<<<<<<<<<<<<
 *         buffer.shape = &self.len
 *         buffer.strides = NULL
 */
  __pyx_v_buffer->format = NULL;

  /* "psycopg_c/pq/pqbuffer.pyx":47
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len             # <<<<<<<<<<<<<<
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL
 */
  __pyx_v_buffer->shape = (&__pyx_v_self->len);

  /* "psycopg_c/pq/pqbuffer.pyx":48
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len
 *         buffer.strides = NULL             # <<<<<<<<<<<<<<
 *         buffer.suboffsets = NULL
 *         buffer.internal = NULL
 */
  __pyx_v_buffer->strides = NULL;

  /* "psycopg_c/pq/pqbuffer.pyx":49
 *         buffer.shape = &self.len
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         buffer.internal = NULL
 * 
 */
  __pyx_v_buffer->suboffsets = NULL;

  /* "psycopg_c/pq/pqbuffer.pyx":50
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL
 *         buffer.internal = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __releasebuffer__(self, Py_buffer *buffer):
 */
  __pyx_v_buffer->internal = NULL;

  /* "psycopg_c/pq/pqbuffer.pyx":39
 *         )
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = self.buf
 *         buffer.obj = self
 */

  /* function exit code */
  __pyx_r = 0;
  if (__pyx_v_buffer->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pqbuffer.pyx":52
 *         buffer.internal = NULL
 * 
 *     def __releasebuffer__(self, Py_buffer *buffer):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_9psycopg_c_2pq_8PQBuffer_9__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer); /*proto*/
static CYTHON_UNUSED void __pyx_pw_9psycopg_c_2pq_8PQBuffer_9__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_9psycopg_c_2pq_8PQBuffer_8__releasebuffer__(((struct __pyx_obj_9psycopg_c_2pq_PQBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_9psycopg_c_2pq_8PQBuffer_8__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PQBuffer_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PQBuffer_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PQBuffer_11__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PQBuffer_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PQBuffer_10__reduce_cython__(((struct __pyx_obj_9psycopg_c_2pq_PQBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PQBuffer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PQBuffer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PQBuffer_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PQBuffer_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PQBuffer_13__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PQBuffer_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PQBuffer_12__setstate_cython__(((struct __pyx_obj_9psycopg_c_2pq_PQBuffer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PQBuffer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PQBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pqbuffer.pyx":62
 *     """
 *     @staticmethod
 *     cdef ViewBuffer _from_buffer(             # <<<<<<<<<<<<<<
 *         object obj, unsigned char *buf, Py_ssize_t length
 *     ):
 */

static struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_f_9psycopg_c_2pq_10ViewBuffer__from_buffer(PyObject *__pyx_v_obj, unsigned char *__pyx_v_buf, Py_ssize_t __pyx_v_length) {
  struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_rv = 0;
  struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_buffer", 0);

  /* "psycopg_c/pq/pqbuffer.pyx":65
 *         object obj, unsigned char *buf, Py_ssize_t length
 *     ):
 *         cdef ViewBuffer rv = ViewBuffer.__new__(ViewBuffer)             # <<<<<<<<<<<<<<
 *         rv.obj = obj
 *         rv.buf = buf
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9psycopg_c_2pq_ViewBuffer(((PyTypeObject *)__pyx_ptype_9psycopg_c_2pq_ViewBuffer), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 65, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_rv = ((struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/pqbuffer.pyx":66
 *     ):
 *         cdef ViewBuffer rv = ViewBuffer.__new__(ViewBuffer)
 *         rv.obj = obj             # <<<<<<<<<<<<<<
 *         rv.buf = buf
 *         rv.len = length
 */
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  __Pyx_GOTREF(__pyx_v_rv->obj);
  __Pyx_DECREF(__pyx_v_rv->obj);
  __pyx_v_rv->obj = __pyx_v_obj;

  /* "psycopg_c/pq/pqbuffer.pyx":67
 *         cdef ViewBuffer rv = ViewBuffer.__new__(ViewBuffer)
 *         rv.obj = obj
 *         rv.buf = buf             # <<<<<<<<<<<<<<
 *         rv.len = length
 *         return rv
 */
  __pyx_v_rv->buf = __pyx_v_buf;

  /* "psycopg_c/pq/pqbuffer.pyx":68
 *         rv.obj = obj
 *         rv.buf = buf
 *         rv.len = length             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __pyx_v_rv->len = __pyx_v_length;

  /* "psycopg_c/pq/pqbuffer.pyx":69
 *         rv.buf = buf
 *         rv.len = length
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pqbuffer.pyx":62
 *     """
 *     @staticmethod
 *     cdef ViewBuffer _from_buffer(             # <<<<<<<<<<<<<<
 *         object obj, unsigned char *buf, Py_ssize_t length
 *     ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.ViewBuffer._from_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pqbuffer.pyx":71
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 *         self.len = 0
 */

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_10ViewBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_10ViewBuffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_10ViewBuffer___cinit__(((struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_10ViewBuffer___cinit__(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "psycopg_c/pq/pqbuffer.pyx":72
 * 
 *     def __cinit__(self):
 *         self.buf = NULL             # <<<<<<<<<<<<<<
 *         self.len = 0
 * 
 */
  __pyx_v_self->buf = NULL;

  /* "psycopg_c/pq/pqbuffer.pyx":73
 *     def __cinit__(self):
 *         self.buf = NULL
 *         self.len = 0             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_v_self->len = 0;

  /* "psycopg_c/pq/pqbuffer.pyx":71
 *         return rv
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.buf = NULL
 *         self.len = 0
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pqbuffer.pyx":75
 *         self.len = 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_10ViewBuffer_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_10ViewBuffer_3__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_10ViewBuffer_2__repr__(((struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_10ViewBuffer_2__repr__(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "psycopg_c/pq/pqbuffer.pyx":76
 * 
 *     def __repr__(self):
 *         return (             # <<<<<<<<<<<<<<
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *             f"({bytes(self)})"
 */
  __Pyx_XDECREF(__pyx_r);

  /* "psycopg_c/pq/pqbuffer.pyx":77
 *     def __repr__(self):
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *             f"({bytes(self)})"
 *         )
 */
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_module); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u_);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_qualname); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__19);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__19);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__19);

  /* "psycopg_c/pq/pqbuffer.pyx":78
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *             f"({bytes(self)})"             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__20);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__20);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u__20);

  /* "psycopg_c/pq/pqbuffer.pyx":77
 *     def __repr__(self):
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *             f"({bytes(self)})"
 *         )
 */
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 6, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pqbuffer.pyx":75
 *         self.len = 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_c.pq.ViewBuffer.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pqbuffer.pyx":81
 *         )
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = self.buf
 *         buffer.obj = self
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_9psycopg_c_2pq_10ViewBuffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_9psycopg_c_2pq_10ViewBuffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_10ViewBuffer_4__getbuffer__(((struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9psycopg_c_2pq_10ViewBuffer_4__getbuffer__(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self, Py_buffer *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned char *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  if (unlikely(__pyx_v_buffer == NULL)) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_buffer->obj);

  /* "psycopg_c/pq/pqbuffer.pyx":82
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):
 *         buffer.buf = self.buf             # <<<<<<<<<<<<<<
 *         buffer.obj = self
 *         buffer.len = self.len
 */
  __pyx_t_1 = __pyx_v_self->buf;
  __pyx_v_buffer->buf = __pyx_t_1;

  /* "psycopg_c/pq/pqbuffer.pyx":83
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):
 *         buffer.buf = self.buf
 *         buffer.obj = self             # <<<<<<<<<<<<<<
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)
 */
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  __Pyx_GOTREF(__pyx_v_buffer->obj);
  __Pyx_DECREF(__pyx_v_buffer->obj);
  __pyx_v_buffer->obj = ((PyObject *)__pyx_v_self);

  /* "psycopg_c/pq/pqbuffer.pyx":84
 *         buffer.buf = self.buf
 *         buffer.obj = self
 *         buffer.len = self.len             # <<<<<<<<<<<<<<
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1
 */
  __pyx_t_2 = __pyx_v_self->len;
  __pyx_v_buffer->len = __pyx_t_2;

  /* "psycopg_c/pq/pqbuffer.pyx":85
 *         buffer.obj = self
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)             # <<<<<<<<<<<<<<
 *         buffer.readonly = 1
 *         buffer.ndim = 1
 */
  __pyx_v_buffer->itemsize = (sizeof(unsigned char));

  /* "psycopg_c/pq/pqbuffer.pyx":86
 *         buffer.len = self.len
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1             # <<<<<<<<<<<<<<
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char
 */
  __pyx_v_buffer->readonly = 1;

  /* "psycopg_c/pq/pqbuffer.pyx":87
 *         buffer.itemsize = sizeof(unsigned char)
 *         buffer.readonly = 1
 *         buffer.ndim = 1             # <<<<<<<<<<<<<<
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len
 */
  __pyx_v_buffer->ndim = 1;

  /* "psycopg_c/pq/pqbuffer.pyx":88
 *         buffer.readonly = 1
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char             # <<<<<<<<<<<<<<
 *         buffer.shape = &self.len
 *         buffer.strides = NULL
 */
  __pyx_v_buffer->format = NULL;

  /* "psycopg_c/pq/pqbuffer.pyx":89
 *         buffer.ndim = 1
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len             # <<<<<<<<<<<<<<
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL
 */
  __pyx_v_buffer->shape = (&__pyx_v_self->len);

  /* "psycopg_c/pq/pqbuffer.pyx":90
 *         buffer.format = NULL  # unsigned char
 *         buffer.shape = &self.len
 *         buffer.strides = NULL             # <<<<<<<<<<<<<<
 *         buffer.suboffsets = NULL
 *         buffer.internal = NULL
 */
  __pyx_v_buffer->strides = NULL;

  /* "psycopg_c/pq/pqbuffer.pyx":91
 *         buffer.shape = &self.len
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         buffer.internal = NULL
 * 
 */
  __pyx_v_buffer->suboffsets = NULL;

  /* "psycopg_c/pq/pqbuffer.pyx":92
 *         buffer.strides = NULL
 *         buffer.suboffsets = NULL
 *         buffer.internal = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __releasebuffer__(self, Py_buffer *buffer):
 */
  __pyx_v_buffer->internal = NULL;

  /* "psycopg_c/pq/pqbuffer.pyx":81
 *         )
 * 
 *     def __getbuffer__(self, Py_buffer *buffer, int flags):             # <<<<<<<<<<<<<<
 *         buffer.buf = self.buf
 *         buffer.obj = self
 */

  /* function exit code */
  __pyx_r = 0;
  if (__pyx_v_buffer->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_buffer->obj);
    __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = 0;
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pqbuffer.pyx":94
 *         buffer.internal = NULL
 * 
 *     def __releasebuffer__(self, Py_buffer *buffer):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_9psycopg_c_2pq_10ViewBuffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer); /*proto*/
static CYTHON_UNUSED void __pyx_pw_9psycopg_c_2pq_10ViewBuffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_9psycopg_c_2pq_10ViewBuffer_6__releasebuffer__(((struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_buffer));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_9psycopg_c_2pq_10ViewBuffer_6__releasebuffer__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self, CYTHON_UNUSED Py_buffer *__pyx_v_buffer) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_10ViewBuffer_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_10ViewBuffer_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_10ViewBuffer_9__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_10ViewBuffer_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_10ViewBuffer_8__reduce_cython__(((struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_10ViewBuffer_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq.ViewBuffer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_10ViewBuffer_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_10ViewBuffer_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_10ViewBuffer_11__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_10ViewBuffer_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_10ViewBuffer_10__setstate_cython__(((struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_10ViewBuffer_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("psycopg_c.pq.ViewBuffer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pqbuffer.pyx":98
 * 
 * 
 * cdef int _buffer_as_string_and_size(             # <<<<<<<<<<<<<<
 *     data: "Buffer", char **ptr, Py_ssize_t *length
 * ) except -1:
 */

static int __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(PyObject *__pyx_v_data, char **__pyx_v_ptr, Py_ssize_t *__pyx_v_length) {
  Py_buffer __pyx_v_buf;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_buffer_as_string_and_size", 0);

  /* "psycopg_c/pq/pqbuffer.pyx":103
 *     cdef Py_buffer buf
 * 
 *     if isinstance(data, bytes):             # <<<<<<<<<<<<<<
 *         PyBytes_AsStringAndSize(data, ptr, length)
 *     elif PyObject_CheckBuffer(data):
 */
  __pyx_t_1 = PyBytes_Check(__pyx_v_data); 
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pqbuffer.pyx":104
 * 
 *     if isinstance(data, bytes):
 *         PyBytes_AsStringAndSize(data, ptr, length)             # <<<<<<<<<<<<<<
 *     elif PyObject_CheckBuffer(data):
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)
 */
    __pyx_t_2 = PyBytes_AsStringAndSize(__pyx_v_data, __pyx_v_ptr, __pyx_v_length); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 104, __pyx_L1_error)

    /* "psycopg_c/pq/pqbuffer.pyx":103
 *     cdef Py_buffer buf
 * 
 *     if isinstance(data, bytes):             # <<<<<<<<<<<<<<
 *         PyBytes_AsStringAndSize(data, ptr, length)
 *     elif PyObject_CheckBuffer(data):
 */
    goto __pyx_L3;
  }

  /* "psycopg_c/pq/pqbuffer.pyx":105
 *     if isinstance(data, bytes):
 *         PyBytes_AsStringAndSize(data, ptr, length)
 *     elif PyObject_CheckBuffer(data):             # <<<<<<<<<<<<<<
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)
 *         ptr[0] = <char *>buf.buf
 */
  __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data);
  if (likely(__pyx_t_1)) {

    /* "psycopg_c/pq/pqbuffer.pyx":106
 *         PyBytes_AsStringAndSize(data, ptr, length)
 *     elif PyObject_CheckBuffer(data):
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)             # <<<<<<<<<<<<<<
 *         ptr[0] = <char *>buf.buf
 *         length[0] = buf.len
 */
    __pyx_t_2 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 106, __pyx_L1_error)

    /* "psycopg_c/pq/pqbuffer.pyx":107
 *     elif PyObject_CheckBuffer(data):
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)
 *         ptr[0] = <char *>buf.buf             # <<<<<<<<<<<<<<
 *         length[0] = buf.len
 *         PyBuffer_Release(&buf)
 */
    (__pyx_v_ptr[0]) = ((char *)__pyx_v_buf.buf);

    /* "psycopg_c/pq/pqbuffer.pyx":108
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)
 *         ptr[0] = <char *>buf.buf
 *         length[0] = buf.len             # <<<<<<<<<<<<<<
 *         PyBuffer_Release(&buf)
 *     else:
 */
    __pyx_t_3 = __pyx_v_buf.len;
    (__pyx_v_length[0]) = __pyx_t_3;

    /* "psycopg_c/pq/pqbuffer.pyx":109
 *         ptr[0] = <char *>buf.buf
 *         length[0] = buf.len
 *         PyBuffer_Release(&buf)             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError(f"bytes or buffer expected, got {type(data)}")
 */
    PyBuffer_Release((&__pyx_v_buf));

    /* "psycopg_c/pq/pqbuffer.pyx":105
 *     if isinstance(data, bytes):
 *         PyBytes_AsStringAndSize(data, ptr, length)
 *     elif PyObject_CheckBuffer(data):             # <<<<<<<<<<<<<<
 *         PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE)
 *         ptr[0] = <char *>buf.buf
 */
    goto __pyx_L3;
  }

  /* "psycopg_c/pq/pqbuffer.pyx":111
 *         PyBuffer_Release(&buf)
 *     else:
 *         raise TypeError(f"bytes or buffer expected, got {type(data)}")             # <<<<<<<<<<<<<<
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_bytes_or_buffer_expected_got, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(7, 111, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "psycopg_c/pq/pqbuffer.pyx":98
 * 
 * 
 * cdef int _buffer_as_string_and_size(             # <<<<<<<<<<<<<<
 *     data: "Buffer", char **ptr, Py_ssize_t *length
 * ) except -1:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_c.pq._buffer_as_string_and_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Escaping(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_3__pyx_unpickle_Escaping(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_3__pyx_unpickle_Escaping = {"__pyx_unpickle_Escaping", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_3__pyx_unpickle_Escaping, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_3__pyx_unpickle_Escaping(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Escaping (wrapper)", 0);
  {
    #if CYTHON_USE_MODULE_STATE
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    #endif
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Escaping", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Escaping", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Escaping") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Escaping", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.__pyx_unpickle_Escaping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_2__pyx_unpickle_Escaping(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_2__pyx_unpickle_Escaping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Escaping", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x0804127, 0x3908a35, 0x0c1d0e2):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0804127, 0x3908a35, 0x0c1d0e2) = (conn))" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__21, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x0804127, 0x3908a35, 0x0c1d0e2):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0804127, 0x3908a35, 0x0c1d0e2) = (conn))" % __pyx_checksum
 *     __pyx_result = Escaping.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x0804127, 0x3908a35, 0x0c1d0e2):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0804127, 0x3908a35, 0x0c1d0e2) = (conn))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = Escaping.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x0804127, 0x3908a35, 0x0c1d0e2):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0804127, 0x3908a35, 0x0c1d0e2) = (conn))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0804127, 0x3908a35, 0x0c1d0e2) = (conn))" % __pyx_checksum
 *     __pyx_result = Escaping.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_9psycopg_c_2pq_Escaping), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0804127, 0x3908a35, 0x0c1d0e2) = (conn))" % __pyx_checksum
 *     __pyx_result = Escaping.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = Escaping.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_9psycopg_c_2pq___pyx_unpickle_Escaping__set_state(((struct __pyx_obj_9psycopg_c_2pq_Escaping *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0804127, 0x3908a35, 0x0c1d0e2) = (conn))" % __pyx_checksum
 *     __pyx_result = Escaping.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, tuple __pyx_state):
 *     __pyx_result.conn = __pyx_state[0]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Escaping(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("psycopg_c.pq.__pyx_unpickle_Escaping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.conn = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_9psycopg_c_2pq___pyx_unpickle_Escaping__set_state(struct __pyx_obj_9psycopg_c_2pq_Escaping *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Escaping__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, tuple __pyx_state):
 *     __pyx_result.conn = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9psycopg_c_2pq_PGconn))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->conn);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->conn);
  __pyx_v___pyx_result->conn = ((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, tuple __pyx_state):
 *     __pyx_result.conn = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 > 1);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.conn = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, tuple __pyx_state):
 *     __pyx_result.conn = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Escaping__set_state(<Escaping> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Escaping__set_state(Escaping __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.conn = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.__pyx_unpickle_Escaping__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_9psycopg_c_2pq_PGconn __pyx_vtable_9psycopg_c_2pq_PGconn;

static PyObject *__pyx_tp_new_9psycopg_c_2pq_PGconn(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9psycopg_c_2pq_PGconn *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9psycopg_c_2pq_PGconn *)o);
  p->__pyx_vtab = __pyx_vtabptr_9psycopg_c_2pq_PGconn;
  p->notice_handler = Py_None; Py_INCREF(Py_None);
  p->notify_handler = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_9psycopg_c_2pq_6PGconn_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_9psycopg_c_2pq_PGconn(PyObject *o) {
  struct __pyx_obj_9psycopg_c_2pq_PGconn *p = (struct __pyx_obj_9psycopg_c_2pq_PGconn *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !_PyGC_FINALIZED(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9psycopg_c_2pq_PGconn) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_9psycopg_c_2pq_6PGconn_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->notice_handler);
  Py_CLEAR(p->notify_handler);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_9psycopg_c_2pq_PGconn(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_9psycopg_c_2pq_PGconn *p = (struct __pyx_obj_9psycopg_c_2pq_PGconn *)o;
  if (p->notice_handler) {
    e = (*v)(p->notice_handler, a); if (e) return e;
  }
  if (p->notify_handler) {
    e = (*v)(p->notify_handler, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_9psycopg_c_2pq_PGconn(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_9psycopg_c_2pq_PGconn *p = (struct __pyx_obj_9psycopg_c_2pq_PGconn *)o;
  tmp = ((PyObject*)p->notice_handler);
  p->notice_handler = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->notify_handler);
  p->notify_handler = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_pgconn_ptr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_10pgconn_ptr_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_info(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_4info_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_db(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_2db_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_user(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_4user_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_password(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_8password_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_host(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_4host_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_hostaddr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_8hostaddr_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_port(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_4port_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_tty(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_3tty_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_7options_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_6status_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_transaction_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_18transaction_status_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_error_message(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_13error_message_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_protocol_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_16protocol_version_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_server_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_14server_version_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_socket(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_6socket_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_backend_pid(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_11backend_pid_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_needs_password(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_14needs_password_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_used_password(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_13used_password_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_ssl_in_use(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_10ssl_in_use_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_nonblocking(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_11nonblocking_1__get__(o);
}

static int __pyx_setprop_9psycopg_c_2pq_6PGconn_nonblocking(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9psycopg_c_2pq_6PGconn_11nonblocking_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_pipeline_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_15pipeline_status_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_notice_handler(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_14notice_handler_1__get__(o);
}

static int __pyx_setprop_9psycopg_c_2pq_6PGconn_notice_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9psycopg_c_2pq_6PGconn_14notice_handler_3__set__(o, v);
  }
  else {
    return __pyx_pw_9psycopg_c_2pq_6PGconn_14notice_handler_5__del__(o);
  }
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_6PGconn_notify_handler(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_14notify_handler_1__get__(o);
}

static int __pyx_setprop_9psycopg_c_2pq_6PGconn_notify_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9psycopg_c_2pq_6PGconn_14notify_handler_3__set__(o, v);
  }
  else {
    return __pyx_pw_9psycopg_c_2pq_6PGconn_14notify_handler_5__del__(o);
  }
}

static PyObject *__pyx_specialmethod___pyx_pw_9psycopg_c_2pq_6PGconn_5__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_5__repr__(self);
}

static PyMethodDef __pyx_methods_9psycopg_c_2pq_PGconn[] = {
  {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_9psycopg_c_2pq_6PGconn_5__repr__, METH_NOARGS|METH_COEXIST, 0},
  {"connect", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_7connect, METH_O, 0},
  {"connect_start", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_9connect_start, METH_O, 0},
  {"connect_poll", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_11connect_poll, METH_NOARGS, 0},
  {"finish", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_13finish, METH_NOARGS, 0},
  {"reset", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_15reset, METH_NOARGS, 0},
  {"reset_start", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_17reset_start, METH_NOARGS, 0},
  {"reset_poll", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_19reset_poll, METH_NOARGS, 0},
  {"ping", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_21ping, METH_O, 0},
  {"parameter_status", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_23parameter_status, METH_O, 0},
  {"exec_", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_25exec_, METH_O, 0},
  {"send_query", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_27send_query, METH_O, 0},
  {"exec_params", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_29exec_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"send_query_params", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_31send_query_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"send_prepare", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_33send_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"send_query_prepared", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_35send_query_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"prepare", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_37prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"exec_prepared", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_39exec_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"describe_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_41describe_prepared, METH_O, 0},
  {"send_describe_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_43send_describe_prepared, METH_O, 0},
  {"describe_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_45describe_portal, METH_O, 0},
  {"send_describe_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_47send_describe_portal, METH_O, 0},
  {"get_result", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_49get_result, METH_NOARGS, 0},
  {"consume_input", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_51consume_input, METH_NOARGS, 0},
  {"is_busy", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_53is_busy, METH_NOARGS, 0},
  {"flush", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_55flush, METH_NOARGS, 0},
  {"set_single_row_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_57set_single_row_mode, METH_NOARGS, 0},
  {"get_cancel", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_59get_cancel, METH_NOARGS, 0},
  {"put_copy_data", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_63put_copy_data, METH_O, 0},
  {"put_copy_end", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_65put_copy_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get_copy_data", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_67get_copy_data, METH_O, 0},
  {"encrypt_password", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_69encrypt_password, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"make_empty_result", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_71make_empty_result, METH_O, 0},
  {"enter_pipeline_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_73enter_pipeline_mode, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_72enter_pipeline_mode},
  {"exit_pipeline_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_75exit_pipeline_mode, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_74exit_pipeline_mode},
  {"pipeline_sync", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_77pipeline_sync, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_76pipeline_sync},
  {"send_flush_request", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_79send_flush_request, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_78send_flush_request},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_81__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_83__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9psycopg_c_2pq_PGconn[] = {
  {(char *)"pgconn_ptr", __pyx_getprop_9psycopg_c_2pq_6PGconn_pgconn_ptr, 0, (char *)0, 0},
  {(char *)"info", __pyx_getprop_9psycopg_c_2pq_6PGconn_info, 0, (char *)0, 0},
  {(char *)"db", __pyx_getprop_9psycopg_c_2pq_6PGconn_db, 0, (char *)0, 0},
  {(char *)"user", __pyx_getprop_9psycopg_c_2pq_6PGconn_user, 0, (char *)0, 0},
  {(char *)"password", __pyx_getprop_9psycopg_c_2pq_6PGconn_password, 0, (char *)0, 0},
  {(char *)"host", __pyx_getprop_9psycopg_c_2pq_6PGconn_host, 0, (char *)0, 0},
  {(char *)"hostaddr", __pyx_getprop_9psycopg_c_2pq_6PGconn_hostaddr, 0, (char *)0, 0},
  {(char *)"port", __pyx_getprop_9psycopg_c_2pq_6PGconn_port, 0, (char *)0, 0},
  {(char *)"tty", __pyx_getprop_9psycopg_c_2pq_6PGconn_tty, 0, (char *)0, 0},
  {(char *)"options", __pyx_getprop_9psycopg_c_2pq_6PGconn_options, 0, (char *)0, 0},
  {(char *)"status", __pyx_getprop_9psycopg_c_2pq_6PGconn_status, 0, (char *)0, 0},
  {(char *)"transaction_status", __pyx_getprop_9psycopg_c_2pq_6PGconn_transaction_status, 0, (char *)0, 0},
  {(char *)"error_message", __pyx_getprop_9psycopg_c_2pq_6PGconn_error_message, 0, (char *)0, 0},
  {(char *)"protocol_version", __pyx_getprop_9psycopg_c_2pq_6PGconn_protocol_version, 0, (char *)0, 0},
  {(char *)"server_version", __pyx_getprop_9psycopg_c_2pq_6PGconn_server_version, 0, (char *)0, 0},
  {(char *)"socket", __pyx_getprop_9psycopg_c_2pq_6PGconn_socket, 0, (char *)0, 0},
  {(char *)"backend_pid", __pyx_getprop_9psycopg_c_2pq_6PGconn_backend_pid, 0, (char *)0, 0},
  {(char *)"needs_password", __pyx_getprop_9psycopg_c_2pq_6PGconn_needs_password, 0, (char *)0, 0},
  {(char *)"used_password", __pyx_getprop_9psycopg_c_2pq_6PGconn_used_password, 0, (char *)0, 0},
  {(char *)"ssl_in_use", __pyx_getprop_9psycopg_c_2pq_6PGconn_ssl_in_use, 0, (char *)0, 0},
  {(char *)"nonblocking", __pyx_getprop_9psycopg_c_2pq_6PGconn_nonblocking, __pyx_setprop_9psycopg_c_2pq_6PGconn_nonblocking, (char *)0, 0},
  {(char *)"pipeline_status", __pyx_getprop_9psycopg_c_2pq_6PGconn_pipeline_status, 0, (char *)PyDoc_STR("The current pipeline mode status.\n\n        For libpq < 14.0, always return 0 (PQ_PIPELINE_OFF).\n        "), 0},
  {(char *)"notice_handler", __pyx_getprop_9psycopg_c_2pq_6PGconn_notice_handler, __pyx_setprop_9psycopg_c_2pq_6PGconn_notice_handler, (char *)0, 0},
  {(char *)"notify_handler", __pyx_getprop_9psycopg_c_2pq_6PGconn_notify_handler, __pyx_setprop_9psycopg_c_2pq_6PGconn_notify_handler, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9psycopg_c_2pq_PGconn_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9psycopg_c_2pq_PGconn},
  {Py_tp_repr, (void *)__pyx_pw_9psycopg_c_2pq_6PGconn_5__repr__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_9psycopg_c_2pq_PGconn},
  {Py_tp_clear, (void *)__pyx_tp_clear_9psycopg_c_2pq_PGconn},
  {Py_tp_methods, (void *)__pyx_methods_9psycopg_c_2pq_PGconn},
  {Py_tp_getset, (void *)__pyx_getsets_9psycopg_c_2pq_PGconn},
  {Py_tp_new, (void *)__pyx_tp_new_9psycopg_c_2pq_PGconn},
  {0, 0},
};
static PyType_Spec __pyx_type_9psycopg_c_2pq_PGconn_spec = {
  "psycopg_c.pq.PGconn",
  sizeof(struct __pyx_obj_9psycopg_c_2pq_PGconn),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_9psycopg_c_2pq_PGconn_slots,
};
#else

static PyTypeObject __pyx_type_9psycopg_c_2pq_PGconn = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_c.pq.""PGconn", /*tp_name*/
  sizeof(struct __pyx_obj_9psycopg_c_2pq_PGconn), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9psycopg_c_2pq_PGconn, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9psycopg_c_2pq_6PGconn_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9psycopg_c_2pq_PGconn, /*tp_traverse*/
  __pyx_tp_clear_9psycopg_c_2pq_PGconn, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9psycopg_c_2pq_PGconn, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9psycopg_c_2pq_PGconn, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9psycopg_c_2pq_PGconn, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9psycopg_c_2pq_PGresult __pyx_vtable_9psycopg_c_2pq_PGresult;

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_freelist_9psycopg_c_2pq_PGresult[8];
static int __pyx_freecount_9psycopg_c_2pq_PGresult = 0;

static PyObject *__pyx_tp_new_9psycopg_c_2pq_PGresult(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9psycopg_c_2pq_PGresult *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9psycopg_c_2pq_PGresult > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9psycopg_c_2pq_PGresult)) & (!__Pyx_PyType_HasFeature(t, (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE))))) {
    o = (PyObject*)__pyx_freelist_9psycopg_c_2pq_PGresult[--__pyx_freecount_9psycopg_c_2pq_PGresult];
    memset(o, 0, sizeof(struct __pyx_obj_9psycopg_c_2pq_PGresult));
    (void) PyObject_INIT(o, t);
  } else {
    if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
      o = (*t->tp_alloc)(t, 0);
    } else {
      o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
    }
    if (unlikely(!o)) return 0;
  }
  #endif
  p = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)o);
  p->__pyx_vtab = __pyx_vtabptr_9psycopg_c_2pq_PGresult;
  if (unlikely(__pyx_pw_9psycopg_c_2pq_8PGresult_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_9psycopg_c_2pq_PGresult(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9psycopg_c_2pq_PGresult) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_9psycopg_c_2pq_8PGresult_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9psycopg_c_2pq_PGresult < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9psycopg_c_2pq_PGresult)) & (!__Pyx_PyType_HasFeature(Py_TYPE(o), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE))))) {
    __pyx_freelist_9psycopg_c_2pq_PGresult[__pyx_freecount_9psycopg_c_2pq_PGresult++] = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_8PGresult_pgresult_ptr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_8PGresult_12pgresult_ptr_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_8PGresult_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_8PGresult_6status_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_8PGresult_error_message(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_8PGresult_13error_message_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_8PGresult_ntuples(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_8PGresult_7ntuples_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_8PGresult_nfields(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_8PGresult_7nfields_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_8PGresult_binary_tuples(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_8PGresult_13binary_tuples_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_8PGresult_nparams(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_8PGresult_7nparams_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_8PGresult_command_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_8PGresult_14command_status_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_8PGresult_command_tuples(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_8PGresult_14command_tuples_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_8PGresult_oid_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_8PGresult_9oid_value_1__get__(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_9psycopg_c_2pq_8PGresult_5__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  return __pyx_pw_9psycopg_c_2pq_8PGresult_5__repr__(self);
}

static PyMethodDef __pyx_methods_9psycopg_c_2pq_PGresult[] = {
  {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_9psycopg_c_2pq_8PGresult_5__repr__, METH_NOARGS|METH_COEXIST, 0},
  {"clear", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_7clear, METH_NOARGS, 0},
  {"error_field", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_9error_field, METH_O, 0},
  {"fname", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_11fname, METH_O, 0},
  {"ftable", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_13ftable, METH_O, 0},
  {"ftablecol", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_15ftablecol, METH_O, 0},
  {"fformat", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_17fformat, METH_O, 0},
  {"ftype", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_19ftype, METH_O, 0},
  {"fmod", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_21fmod, METH_O, 0},
  {"fsize", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_23fsize, METH_O, 0},
  {"get_value", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_8PGresult_25get_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"param_type", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_27param_type, METH_O, 0},
  {"set_attributes", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_29set_attributes, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_31__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_33__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9psycopg_c_2pq_PGresult[] = {
  {(char *)"pgresult_ptr", __pyx_getprop_9psycopg_c_2pq_8PGresult_pgresult_ptr, 0, (char *)0, 0},
  {(char *)"status", __pyx_getprop_9psycopg_c_2pq_8PGresult_status, 0, (char *)0, 0},
  {(char *)"error_message", __pyx_getprop_9psycopg_c_2pq_8PGresult_error_message, 0, (char *)0, 0},
  {(char *)"ntuples", __pyx_getprop_9psycopg_c_2pq_8PGresult_ntuples, 0, (char *)0, 0},
  {(char *)"nfields", __pyx_getprop_9psycopg_c_2pq_8PGresult_nfields, 0, (char *)0, 0},
  {(char *)"binary_tuples", __pyx_getprop_9psycopg_c_2pq_8PGresult_binary_tuples, 0, (char *)0, 0},
  {(char *)"nparams", __pyx_getprop_9psycopg_c_2pq_8PGresult_nparams, 0, (char *)0, 0},
  {(char *)"command_status", __pyx_getprop_9psycopg_c_2pq_8PGresult_command_status, 0, (char *)0, 0},
  {(char *)"command_tuples", __pyx_getprop_9psycopg_c_2pq_8PGresult_command_tuples, 0, (char *)0, 0},
  {(char *)"oid_value", __pyx_getprop_9psycopg_c_2pq_8PGresult_oid_value, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9psycopg_c_2pq_PGresult_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9psycopg_c_2pq_PGresult},
  {Py_tp_repr, (void *)__pyx_pw_9psycopg_c_2pq_8PGresult_5__repr__},
  {Py_tp_methods, (void *)__pyx_methods_9psycopg_c_2pq_PGresult},
  {Py_tp_getset, (void *)__pyx_getsets_9psycopg_c_2pq_PGresult},
  {Py_tp_new, (void *)__pyx_tp_new_9psycopg_c_2pq_PGresult},
  {0, 0},
};
static PyType_Spec __pyx_type_9psycopg_c_2pq_PGresult_spec = {
  "psycopg_c.pq.PGresult",
  sizeof(struct __pyx_obj_9psycopg_c_2pq_PGresult),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9psycopg_c_2pq_PGresult_slots,
};
#else

static PyTypeObject __pyx_type_9psycopg_c_2pq_PGresult = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_c.pq.""PGresult", /*tp_name*/
  sizeof(struct __pyx_obj_9psycopg_c_2pq_PGresult), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9psycopg_c_2pq_PGresult, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9psycopg_c_2pq_8PGresult_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9psycopg_c_2pq_PGresult, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9psycopg_c_2pq_PGresult, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9psycopg_c_2pq_PGresult, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9psycopg_c_2pq_PGcancel __pyx_vtable_9psycopg_c_2pq_PGcancel;

static PyObject *__pyx_tp_new_9psycopg_c_2pq_PGcancel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9psycopg_c_2pq_PGcancel *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9psycopg_c_2pq_PGcancel *)o);
  p->__pyx_vtab = __pyx_vtabptr_9psycopg_c_2pq_PGcancel;
  if (unlikely(__pyx_pw_9psycopg_c_2pq_8PGcancel_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_9psycopg_c_2pq_PGcancel(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9psycopg_c_2pq_PGcancel) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_9psycopg_c_2pq_8PGcancel_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_9psycopg_c_2pq_PGcancel[] = {
  {"free", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGcancel_5free, METH_NOARGS, 0},
  {"cancel", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGcancel_7cancel, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGcancel_9__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGcancel_11__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9psycopg_c_2pq_PGcancel_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9psycopg_c_2pq_PGcancel},
  {Py_tp_methods, (void *)__pyx_methods_9psycopg_c_2pq_PGcancel},
  {Py_tp_new, (void *)__pyx_tp_new_9psycopg_c_2pq_PGcancel},
  {0, 0},
};
static PyType_Spec __pyx_type_9psycopg_c_2pq_PGcancel_spec = {
  "psycopg_c.pq.PGcancel",
  sizeof(struct __pyx_obj_9psycopg_c_2pq_PGcancel),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9psycopg_c_2pq_PGcancel_slots,
};
#else

static PyTypeObject __pyx_type_9psycopg_c_2pq_PGcancel = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_c.pq.""PGcancel", /*tp_name*/
  sizeof(struct __pyx_obj_9psycopg_c_2pq_PGcancel), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9psycopg_c_2pq_PGcancel, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9psycopg_c_2pq_PGcancel, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9psycopg_c_2pq_PGcancel, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9psycopg_c_2pq_Escaping __pyx_vtable_9psycopg_c_2pq_Escaping;

static PyObject *__pyx_tp_new_9psycopg_c_2pq_Escaping(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9psycopg_c_2pq_Escaping *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9psycopg_c_2pq_Escaping *)o);
  p->__pyx_vtab = __pyx_vtabptr_9psycopg_c_2pq_Escaping;
  p->conn = ((struct __pyx_obj_9psycopg_c_2pq_PGconn *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_9psycopg_c_2pq_Escaping(PyObject *o) {
  struct __pyx_obj_9psycopg_c_2pq_Escaping *p = (struct __pyx_obj_9psycopg_c_2pq_Escaping *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !_PyGC_FINALIZED(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9psycopg_c_2pq_Escaping) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->conn);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_9psycopg_c_2pq_Escaping(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_9psycopg_c_2pq_Escaping *p = (struct __pyx_obj_9psycopg_c_2pq_Escaping *)o;
  if (p->conn) {
    e = (*v)(((PyObject *)p->conn), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_9psycopg_c_2pq_Escaping(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_9psycopg_c_2pq_Escaping *p = (struct __pyx_obj_9psycopg_c_2pq_Escaping *)o;
  tmp = ((PyObject*)p->conn);
  p->conn = ((struct __pyx_obj_9psycopg_c_2pq_PGconn *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_9psycopg_c_2pq_Escaping[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8Escaping_13__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8Escaping_15__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9psycopg_c_2pq_Escaping_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9psycopg_c_2pq_Escaping},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_9psycopg_c_2pq_Escaping},
  {Py_tp_clear, (void *)__pyx_tp_clear_9psycopg_c_2pq_Escaping},
  {Py_tp_methods, (void *)__pyx_methods_9psycopg_c_2pq_Escaping},
  {Py_tp_init, (void *)__pyx_pw_9psycopg_c_2pq_8Escaping_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9psycopg_c_2pq_Escaping},
  {0, 0},
};
static PyType_Spec __pyx_type_9psycopg_c_2pq_Escaping_spec = {
  "psycopg_c.pq.Escaping",
  sizeof(struct __pyx_obj_9psycopg_c_2pq_Escaping),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_9psycopg_c_2pq_Escaping_slots,
};
#else

static PyTypeObject __pyx_type_9psycopg_c_2pq_Escaping = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_c.pq.""Escaping", /*tp_name*/
  sizeof(struct __pyx_obj_9psycopg_c_2pq_Escaping), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9psycopg_c_2pq_Escaping, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9psycopg_c_2pq_Escaping, /*tp_traverse*/
  __pyx_tp_clear_9psycopg_c_2pq_Escaping, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9psycopg_c_2pq_Escaping, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_9psycopg_c_2pq_8Escaping_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9psycopg_c_2pq_Escaping, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9psycopg_c_2pq_PQBuffer __pyx_vtable_9psycopg_c_2pq_PQBuffer;

static struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_freelist_9psycopg_c_2pq_PQBuffer[32];
static int __pyx_freecount_9psycopg_c_2pq_PQBuffer = 0;

static PyObject *__pyx_tp_new_9psycopg_c_2pq_PQBuffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9psycopg_c_2pq_PQBuffer *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9psycopg_c_2pq_PQBuffer > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9psycopg_c_2pq_PQBuffer)) & (!__Pyx_PyType_HasFeature(t, (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE))))) {
    o = (PyObject*)__pyx_freelist_9psycopg_c_2pq_PQBuffer[--__pyx_freecount_9psycopg_c_2pq_PQBuffer];
    memset(o, 0, sizeof(struct __pyx_obj_9psycopg_c_2pq_PQBuffer));
    (void) PyObject_INIT(o, t);
  } else {
    if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
      o = (*t->tp_alloc)(t, 0);
    } else {
      o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
    }
    if (unlikely(!o)) return 0;
  }
  #endif
  p = ((struct __pyx_obj_9psycopg_c_2pq_PQBuffer *)o);
  p->__pyx_vtab = __pyx_vtabptr_9psycopg_c_2pq_PQBuffer;
  if (unlikely(__pyx_pw_9psycopg_c_2pq_8PQBuffer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_9psycopg_c_2pq_PQBuffer(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9psycopg_c_2pq_PQBuffer) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_pw_9psycopg_c_2pq_8PQBuffer_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9psycopg_c_2pq_PQBuffer < 32) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9psycopg_c_2pq_PQBuffer)) & (!__Pyx_PyType_HasFeature(Py_TYPE(o), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE))))) {
    __pyx_freelist_9psycopg_c_2pq_PQBuffer[__pyx_freecount_9psycopg_c_2pq_PQBuffer++] = ((struct __pyx_obj_9psycopg_c_2pq_PQBuffer *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyObject *__pyx_specialmethod___pyx_pw_9psycopg_c_2pq_8PQBuffer_5__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  return __pyx_pw_9psycopg_c_2pq_8PQBuffer_5__repr__(self);
}

static PyMethodDef __pyx_methods_9psycopg_c_2pq_PQBuffer[] = {
  {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_9psycopg_c_2pq_8PQBuffer_5__repr__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PQBuffer_11__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PQBuffer_13__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
#if !CYTHON_COMPILING_IN_LIMITED_API

static PyBufferProcs __pyx_tp_as_buffer_PQBuffer = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_pw_9psycopg_c_2pq_8PQBuffer_7__getbuffer__, /*bf_getbuffer*/
  __pyx_pw_9psycopg_c_2pq_8PQBuffer_9__releasebuffer__, /*bf_releasebuffer*/
};
#endif
static PyType_Slot __pyx_type_9psycopg_c_2pq_PQBuffer_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9psycopg_c_2pq_PQBuffer},
  {Py_tp_repr, (void *)__pyx_pw_9psycopg_c_2pq_8PQBuffer_5__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Wrap a chunk of memory allocated by the libpq and expose it as memoryview.\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_9psycopg_c_2pq_PQBuffer},
  {Py_tp_new, (void *)__pyx_tp_new_9psycopg_c_2pq_PQBuffer},
  {0, 0},
};
static PyType_Spec __pyx_type_9psycopg_c_2pq_PQBuffer_spec = {
  "psycopg_c.pq.PQBuffer",
  sizeof(struct __pyx_obj_9psycopg_c_2pq_PQBuffer),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9psycopg_c_2pq_PQBuffer_slots,
};
#else

static PyBufferProcs __pyx_tp_as_buffer_PQBuffer = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_pw_9psycopg_c_2pq_8PQBuffer_7__getbuffer__, /*bf_getbuffer*/
  __pyx_pw_9psycopg_c_2pq_8PQBuffer_9__releasebuffer__, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type_9psycopg_c_2pq_PQBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_c.pq.""PQBuffer", /*tp_name*/
  sizeof(struct __pyx_obj_9psycopg_c_2pq_PQBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9psycopg_c_2pq_PQBuffer, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9psycopg_c_2pq_8PQBuffer_5__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_PQBuffer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n    Wrap a chunk of memory allocated by the libpq and expose it as memoryview.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9psycopg_c_2pq_PQBuffer, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9psycopg_c_2pq_PQBuffer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9psycopg_c_2pq_ViewBuffer __pyx_vtable_9psycopg_c_2pq_ViewBuffer;

static struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_freelist_9psycopg_c_2pq_ViewBuffer[32];
static int __pyx_freecount_9psycopg_c_2pq_ViewBuffer = 0;

static PyObject *__pyx_tp_new_9psycopg_c_2pq_ViewBuffer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9psycopg_c_2pq_ViewBuffer > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer)) & (!__Pyx_PyType_HasFeature(t, (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE))))) {
    o = (PyObject*)__pyx_freelist_9psycopg_c_2pq_ViewBuffer[--__pyx_freecount_9psycopg_c_2pq_ViewBuffer];
    memset(o, 0, sizeof(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
      o = (*t->tp_alloc)(t, 0);
    } else {
      o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
    }
    if (unlikely(!o)) return 0;
  }
  #endif
  p = ((struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)o);
  p->__pyx_vtab = __pyx_vtabptr_9psycopg_c_2pq_ViewBuffer;
  p->obj = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_9psycopg_c_2pq_10ViewBuffer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_9psycopg_c_2pq_ViewBuffer(PyObject *o) {
  struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *p = (struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !_PyGC_FINALIZED(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9psycopg_c_2pq_ViewBuffer) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->obj);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9psycopg_c_2pq_ViewBuffer < 32) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer)) & (!__Pyx_PyType_HasFeature(Py_TYPE(o), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE))))) {
    __pyx_freelist_9psycopg_c_2pq_ViewBuffer[__pyx_freecount_9psycopg_c_2pq_ViewBuffer++] = ((struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_9psycopg_c_2pq_ViewBuffer(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *p = (struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)o;
  if (p->obj) {
    e = (*v)(p->obj, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_9psycopg_c_2pq_ViewBuffer(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *p = (struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)o;
  tmp = ((PyObject*)p->obj);
  p->obj = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_specialmethod___pyx_pw_9psycopg_c_2pq_10ViewBuffer_3__repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  return __pyx_pw_9psycopg_c_2pq_10ViewBuffer_3__repr__(self);
}

static PyMethodDef __pyx_methods_9psycopg_c_2pq_ViewBuffer[] = {
  {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_pw_9psycopg_c_2pq_10ViewBuffer_3__repr__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_10ViewBuffer_9__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_10ViewBuffer_11__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
#if !CYTHON_COMPILING_IN_LIMITED_API

static PyBufferProcs __pyx_tp_as_buffer_ViewBuffer = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_pw_9psycopg_c_2pq_10ViewBuffer_5__getbuffer__, /*bf_getbuffer*/
  __pyx_pw_9psycopg_c_2pq_10ViewBuffer_7__releasebuffer__, /*bf_releasebuffer*/
};
#endif
static PyType_Slot __pyx_type_9psycopg_c_2pq_ViewBuffer_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9psycopg_c_2pq_ViewBuffer},
  {Py_tp_repr, (void *)__pyx_pw_9psycopg_c_2pq_10ViewBuffer_3__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Wrap a chunk of memory owned by a different object.\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_9psycopg_c_2pq_ViewBuffer},
  {Py_tp_clear, (void *)__pyx_tp_clear_9psycopg_c_2pq_ViewBuffer},
  {Py_tp_methods, (void *)__pyx_methods_9psycopg_c_2pq_ViewBuffer},
  {Py_tp_new, (void *)__pyx_tp_new_9psycopg_c_2pq_ViewBuffer},
  {0, 0},
};
static PyType_Spec __pyx_type_9psycopg_c_2pq_ViewBuffer_spec = {
  "psycopg_c.pq.ViewBuffer",
  sizeof(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_9psycopg_c_2pq_ViewBuffer_slots,
};
#else

static PyBufferProcs __pyx_tp_as_buffer_ViewBuffer = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_pw_9psycopg_c_2pq_10ViewBuffer_5__getbuffer__, /*bf_getbuffer*/
  __pyx_pw_9psycopg_c_2pq_10ViewBuffer_7__releasebuffer__, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type_9psycopg_c_2pq_ViewBuffer = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_c.pq.""ViewBuffer", /*tp_name*/
  sizeof(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9psycopg_c_2pq_ViewBuffer, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_9psycopg_c_2pq_10ViewBuffer_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_ViewBuffer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n    Wrap a chunk of memory owned by a different object.\n    "), /*tp_doc*/
  __pyx_tp_traverse_9psycopg_c_2pq_ViewBuffer, /*tp_traverse*/
  __pyx_tp_clear_9psycopg_c_2pq_ViewBuffer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9psycopg_c_2pq_ViewBuffer, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9psycopg_c_2pq_ViewBuffer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif
/* #### Code section: pystring_table ### */

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  #if CYTHON_USE_MODULE_STATE
  {0, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  {0, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
  {0, __pyx_k_Conninfo, sizeof(__pyx_k_Conninfo), 0, 0, 1, 1},
  {0, __pyx_k_ConninfoOption, sizeof(__pyx_k_ConninfoOption), 0, 0, 1, 1},
  {0, __pyx_k_Conninfo___repr, sizeof(__pyx_k_Conninfo___repr), 0, 0, 1, 1},
  {0, __pyx_k_Conninfo_get_defaults, sizeof(__pyx_k_Conninfo_get_defaults), 0, 0, 1, 1},
  {0, __pyx_k_Conninfo_parse, sizeof(__pyx_k_Conninfo_parse), 0, 0, 1, 1},
  {0, __pyx_k_Escaping, sizeof(__pyx_k_Escaping), 0, 0, 1, 1},
  {0, __pyx_k_Escaping___reduce_cython, sizeof(__pyx_k_Escaping___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_Escaping___setstate_cython, sizeof(__pyx_k_Escaping___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_Escaping_escape_bytea, sizeof(__pyx_k_Escaping_escape_bytea), 0, 0, 1, 1},
  {0, __pyx_k_Escaping_escape_identifier, sizeof(__pyx_k_Escaping_escape_identifier), 0, 0, 1, 1},
  {0, __pyx_k_Escaping_escape_literal, sizeof(__pyx_k_Escaping_escape_literal), 0, 0, 1, 1},
  {0, __pyx_k_Escaping_escape_string, sizeof(__pyx_k_Escaping_escape_string), 0, 0, 1, 1},
  {0, __pyx_k_Escaping_unescape_bytea, sizeof(__pyx_k_Escaping_unescape_bytea), 0, 0, 1, 1},
  {0, __pyx_k_ExecStatus, sizeof(__pyx_k_ExecStatus), 0, 0, 1, 1},
  {0, __pyx_k_Format, sizeof(__pyx_k_Format), 0, 0, 1, 1},
  {0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
  {0, __pyx_k_Iterator, sizeof(__pyx_k_Iterator), 0, 0, 1, 1},
  {0, __pyx_k_List_ConninfoOption, sizeof(__pyx_k_List_ConninfoOption), 0, 0, 1, 0},
  {0, __pyx_k_List_PGresAttDesc, sizeof(__pyx_k_List_PGresAttDesc), 0, 0, 1, 0},
  {0, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {0, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
  {0, __pyx_k_NotSupportedError, sizeof(__pyx_k_NotSupportedError), 0, 0, 1, 1},
  {0, __pyx_k_OperationalError, sizeof(__pyx_k_OperationalError), 0, 0, 1, 1},
  {0, __pyx_k_Optional_PGresult, sizeof(__pyx_k_Optional_PGresult), 0, 0, 1, 0},
  {0, __pyx_k_Optional_Sequence_Optional_bytes, sizeof(__pyx_k_Optional_Sequence_Optional_bytes), 0, 0, 1, 0},
  {0, __pyx_k_Optional_Sequence_bytes, sizeof(__pyx_k_Optional_Sequence_bytes), 0, 0, 1, 0},
  {0, __pyx_k_Optional_Sequence_int, sizeof(__pyx_k_Optional_Sequence_int), 0, 0, 1, 0},
  {0, __pyx_k_Optional_bytes, sizeof(__pyx_k_Optional_bytes), 0, 0, 1, 0},
  {0, __pyx_k_PGcancel, sizeof(__pyx_k_PGcancel), 0, 0, 1, 1},
  {0, __pyx_k_PGcancel___reduce_cython, sizeof(__pyx_k_PGcancel___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_PGcancel___setstate_cython, sizeof(__pyx_k_PGcancel___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_PGcancel_cancel, sizeof(__pyx_k_PGcancel_cancel), 0, 0, 1, 1},
  {0, __pyx_k_PGcancel_free, sizeof(__pyx_k_PGcancel_free), 0, 0, 1, 1},
  {0, __pyx_k_PGconn, sizeof(__pyx_k_PGconn), 0, 0, 1, 1},
  {0, __pyx_k_PGconn___reduce_cython, sizeof(__pyx_k_PGconn___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_PGconn___setstate_cython, sizeof(__pyx_k_PGconn___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_connect, sizeof(__pyx_k_PGconn_connect), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_connect_poll, sizeof(__pyx_k_PGconn_connect_poll), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_connect_start, sizeof(__pyx_k_PGconn_connect_start), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_consume_input, sizeof(__pyx_k_PGconn_consume_input), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_describe_portal, sizeof(__pyx_k_PGconn_describe_portal), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_describe_prepared, sizeof(__pyx_k_PGconn_describe_prepared), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_encrypt_password, sizeof(__pyx_k_PGconn_encrypt_password), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_enter_pipeline_mode, sizeof(__pyx_k_PGconn_enter_pipeline_mode), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_exec, sizeof(__pyx_k_PGconn_exec), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_exec_params, sizeof(__pyx_k_PGconn_exec_params), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_exec_prepared, sizeof(__pyx_k_PGconn_exec_prepared), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_exit_pipeline_mode, sizeof(__pyx_k_PGconn_exit_pipeline_mode), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_finish, sizeof(__pyx_k_PGconn_finish), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_flush, sizeof(__pyx_k_PGconn_flush), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_get_cancel, sizeof(__pyx_k_PGconn_get_cancel), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_get_copy_data, sizeof(__pyx_k_PGconn_get_copy_data), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_get_result, sizeof(__pyx_k_PGconn_get_result), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_is_busy, sizeof(__pyx_k_PGconn_is_busy), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_make_empty_result, sizeof(__pyx_k_PGconn_make_empty_result), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_notifies, sizeof(__pyx_k_PGconn_notifies), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_parameter_status, sizeof(__pyx_k_PGconn_parameter_status), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_ping, sizeof(__pyx_k_PGconn_ping), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_pipeline_sync, sizeof(__pyx_k_PGconn_pipeline_sync), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_prepare, sizeof(__pyx_k_PGconn_prepare), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_put_copy_data, sizeof(__pyx_k_PGconn_put_copy_data), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_put_copy_end, sizeof(__pyx_k_PGconn_put_copy_end), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_reset, sizeof(__pyx_k_PGconn_reset), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_reset_poll, sizeof(__pyx_k_PGconn_reset_poll), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_reset_start, sizeof(__pyx_k_PGconn_reset_start), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_send_describe_portal, sizeof(__pyx_k_PGconn_send_describe_portal), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_send_describe_prepared, sizeof(__pyx_k_PGconn_send_describe_prepared), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_send_flush_request, sizeof(__pyx_k_PGconn_send_flush_request), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_send_prepare, sizeof(__pyx_k_PGconn_send_prepare), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_send_query, sizeof(__pyx_k_PGconn_send_query), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_send_query_params, sizeof(__pyx_k_PGconn_send_query_params), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_send_query_prepared, sizeof(__pyx_k_PGconn_send_query_prepared), 0, 0, 1, 1},
  {0, __pyx_k_PGconn_set_single_row_mode, sizeof(__pyx_k_PGconn_set_single_row_mode), 0, 0, 1, 1},
  {0, __pyx_k_PGnotify, sizeof(__pyx_k_PGnotify), 0, 0, 1, 1},
  {0, __pyx_k_PGresAttDesc, sizeof(__pyx_k_PGresAttDesc), 0, 0, 1, 1},
  {0, __pyx_k_PGresult, sizeof(__pyx_k_PGresult), 0, 0, 1, 1},
  {0, __pyx_k_PGresult___reduce_cython, sizeof(__pyx_k_PGresult___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_PGresult___setstate_cython, sizeof(__pyx_k_PGresult___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_clear, sizeof(__pyx_k_PGresult_clear), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_error_field, sizeof(__pyx_k_PGresult_error_field), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_fformat, sizeof(__pyx_k_PGresult_fformat), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_fmod, sizeof(__pyx_k_PGresult_fmod), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_fname, sizeof(__pyx_k_PGresult_fname), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_fsize, sizeof(__pyx_k_PGresult_fsize), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_ftable, sizeof(__pyx_k_PGresult_ftable), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_ftablecol, sizeof(__pyx_k_PGresult_ftablecol), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_ftype, sizeof(__pyx_k_PGresult_ftype), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_get_value, sizeof(__pyx_k_PGresult_get_value), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_param_type, sizeof(__pyx_k_PGresult_param_type), 0, 0, 1, 1},
  {0, __pyx_k_PGresult_set_attributes, sizeof(__pyx_k_PGresult_set_attributes), 0, 0, 1, 1},
  {0, __pyx_k_PQBuffer, sizeof(__pyx_k_PQBuffer), 0, 0, 1, 1},
  {0, __pyx_k_PQBuffer___reduce_cython, sizeof(__pyx_k_PQBuffer___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_PQBuffer___setstate_cython, sizeof(__pyx_k_PQBuffer___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_PQencryptPasswordConn_requires_l, sizeof(__pyx_k_PQencryptPasswordConn_requires_l), 0, 1, 0, 0},
  {0, __pyx_k_PQenterPipelineMode_requires_lib, sizeof(__pyx_k_PQenterPipelineMode_requires_lib), 0, 1, 0, 0},
  {0, __pyx_k_PQexitPipelineMode_requires_libp, sizeof(__pyx_k_PQexitPipelineMode_requires_libp), 0, 1, 0, 0},
  {0, __pyx_k_PQhostaddr_requires_libpq_from_P, sizeof(__pyx_k_PQhostaddr_requires_libpq_from_P), 0, 1, 0, 0},
  {0, __pyx_k_PQpipelineSync_requires_libpq_fr, sizeof(__pyx_k_PQpipelineSync_requires_libpq_fr), 0, 1, 0, 0},
  {0, __pyx_k_PQsendFlushRequest_requires_libp, sizeof(__pyx_k_PQsendFlushRequest_requires_libp), 0, 1, 0, 0},
  {0, __pyx_k_PQsetResultAttrs_failed, sizeof(__pyx_k_PQsetResultAttrs_failed), 0, 1, 0, 0},
  {0, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {0, __pyx_k_PipelineStatus, sizeof(__pyx_k_PipelineStatus), 0, 0, 1, 1},
  {0, __pyx_k_PqFormat, sizeof(__pyx_k_PqFormat), 0, 0, 1, 1},
  {0, __pyx_k_TEXT, sizeof(__pyx_k_TEXT), 0, 0, 1, 1},
  {0, __pyx_k_Tuple_int_memoryview, sizeof(__pyx_k_Tuple_int_memoryview), 0, 0, 1, 0},
  {0, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {0, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {0, __pyx_k_ViewBuffer, sizeof(__pyx_k_ViewBuffer), 0, 0, 1, 1},
  {0, __pyx_k_ViewBuffer___reduce_cython, sizeof(__pyx_k_ViewBuffer___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_ViewBuffer___setstate_cython, sizeof(__pyx_k_ViewBuffer___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 0, 0},
  {0, __pyx_k__130, sizeof(__pyx_k__130), 0, 0, 1, 1},
  {0, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0},
  {0, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
  {0, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0},
  {0, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
  {0, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
  {0, __pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0, 0},
  {0, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 1},
  {0, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
  {0, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
  {0, __pyx_k_algorithm, sizeof(__pyx_k_algorithm), 0, 0, 1, 1},
  {0, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1},
  {0, __pyx_k_async, sizeof(__pyx_k_async), 0, 0, 1, 1},
  {0, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
  {0, __pyx_k_at_0x, sizeof(__pyx_k_at_0x), 0, 1, 0, 0},
  {0, __pyx_k_at_0x_2, sizeof(__pyx_k_at_0x_2), 0, 1, 0, 0},
  {0, __pyx_k_attrs, sizeof(__pyx_k_attrs), 0, 0, 1, 1},
  {0, __pyx_k_atttypmod, sizeof(__pyx_k_atttypmod), 0, 0, 1, 1},
  {0, __pyx_k_atypes, sizeof(__pyx_k_atypes), 0, 0, 1, 1},
  {0, __pyx_k_available_instead, sizeof(__pyx_k_available_instead), 0, 1, 0, 0},
  {0, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1},
  {0, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
  {0, __pyx_k_buffer_ptr, sizeof(__pyx_k_buffer_ptr), 0, 0, 1, 1},
  {0, __pyx_k_build_version, sizeof(__pyx_k_build_version), 0, 0, 1, 1},
  {0, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 1, 0, 0},
  {0, __pyx_k_bytes_2, sizeof(__pyx_k_bytes_2), 0, 0, 1, 1},
  {0, __pyx_k_bytes_or_buffer_expected_got, sizeof(__pyx_k_bytes_or_buffer_expected_got), 0, 1, 0, 0},
  {0, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
  {0, __pyx_k_calgo, sizeof(__pyx_k_calgo), 0, 0, 1, 1},
  {0, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1},
  {0, __pyx_k_cancel_failed, sizeof(__pyx_k_cancel_failed), 0, 1, 0, 0},
  {0, __pyx_k_cbuffer, sizeof(__pyx_k_cbuffer), 0, 0, 1, 1},
  {0, __pyx_k_ccol, sizeof(__pyx_k_ccol), 0, 0, 1, 1},
  {0, __pyx_k_cerr, sizeof(__pyx_k_cerr), 0, 0, 1, 1},
  {0, __pyx_k_cformats, sizeof(__pyx_k_cformats), 0, 0, 1, 1},
  {0, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {0, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {0, __pyx_k_clengths, sizeof(__pyx_k_clengths), 0, 0, 1, 1},
  {0, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {0, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
  {0, __pyx_k_cnparams, sizeof(__pyx_k_cnparams), 0, 0, 1, 1},
  {0, __pyx_k_column_number, sizeof(__pyx_k_column_number), 0, 0, 1, 1},
  {0, __pyx_k_columnid, sizeof(__pyx_k_columnid), 0, 0, 1, 1},
  {0, __pyx_k_command, sizeof(__pyx_k_command), 0, 0, 1, 1},
  {0, __pyx_k_compiled, sizeof(__pyx_k_compiled), 0, 0, 1, 1},
  {0, __pyx_k_conn, sizeof(__pyx_k_conn), 0, 0, 1, 1},
  {0, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
  {0, __pyx_k_connect_poll, sizeof(__pyx_k_connect_poll), 0, 0, 1, 1},
  {0, __pyx_k_connect_start, sizeof(__pyx_k_connect_start), 0, 0, 1, 1},
  {0, __pyx_k_connection_not_in_pipeline_mode, sizeof(__pyx_k_connection_not_in_pipeline_mode), 0, 1, 0, 0},
  {0, __pyx_k_connection_summary, sizeof(__pyx_k_connection_summary), 0, 0, 1, 1},
  {0, __pyx_k_conninfo, sizeof(__pyx_k_conninfo), 0, 0, 1, 1},
  {0, __pyx_k_consume_input, sizeof(__pyx_k_consume_input), 0, 0, 1, 1},
  {0, __pyx_k_consuming_input_failed, sizeof(__pyx_k_consuming_input_failed), 0, 1, 0, 0},
  {0, __pyx_k_couldn_t_allocate_PGconn, sizeof(__pyx_k_couldn_t_allocate_PGconn), 0, 1, 0, 0},
  {0, __pyx_k_couldn_t_allocate_PGresult, sizeof(__pyx_k_couldn_t_allocate_PGresult), 0, 1, 0, 0},
  {0, __pyx_k_couldn_t_allocate_connection_def, sizeof(__pyx_k_couldn_t_allocate_connection_def), 0, 1, 0, 0},
  {0, __pyx_k_couldn_t_allocate_connection_inf, sizeof(__pyx_k_couldn_t_allocate_connection_inf), 0, 1, 0, 0},
  {0, __pyx_k_couldn_t_allocate_empty_PGresult, sizeof(__pyx_k_couldn_t_allocate_empty_PGresult), 0, 1, 0, 0},
  {0, __pyx_k_couldn_t_allocate_for_escape_byt, sizeof(__pyx_k_couldn_t_allocate_for_escape_byt), 0, 1, 0, 0},
  {0, __pyx_k_couldn_t_allocate_for_unescape_b, sizeof(__pyx_k_couldn_t_allocate_for_unescape_b), 0, 1, 0, 0},
  {0, __pyx_k_couldn_t_allocate_on_conninfo_pa, sizeof(__pyx_k_couldn_t_allocate_on_conninfo_pa), 0, 1, 0, 0},
  {0, __pyx_k_couldn_t_create_cancel_object, sizeof(__pyx_k_couldn_t_create_cancel_object), 0, 1, 0, 0},
  {0, __pyx_k_couldn_t_reset_connection, sizeof(__pyx_k_couldn_t_reset_connection), 0, 1, 0, 0},
  {0, __pyx_k_crow, sizeof(__pyx_k_crow), 0, 0, 1, 1},
  {0, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
  {0, __pyx_k_cvalues, sizeof(__pyx_k_cvalues), 0, 0, 1, 1},
  {0, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
  {0, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {0, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {0, __pyx_k_descr, sizeof(__pyx_k_descr), 0, 0, 1, 1},
  {0, __pyx_k_describe_portal, sizeof(__pyx_k_describe_portal), 0, 0, 1, 1},
  {0, __pyx_k_describe_prepared, sizeof(__pyx_k_describe_prepared), 0, 0, 1, 1},
  {0, __pyx_k_descriptions, sizeof(__pyx_k_descriptions), 0, 0, 1, 1},
  {0, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {0, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
  {0, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
  {0, __pyx_k_dispchar, sizeof(__pyx_k_dispchar), 0, 0, 1, 1},
  {0, __pyx_k_dispsize, sizeof(__pyx_k_dispsize), 0, 0, 1, 1},
  {0, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {0, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {0, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
  {0, __pyx_k_encrypt_password, sizeof(__pyx_k_encrypt_password), 0, 0, 1, 1},
  {0, __pyx_k_enter_pipeline_mode, sizeof(__pyx_k_enter_pipeline_mode), 0, 0, 1, 1},
  {0, __pyx_k_envvar, sizeof(__pyx_k_envvar), 0, 0, 1, 1},
  {0, __pyx_k_errmsg, sizeof(__pyx_k_errmsg), 0, 0, 1, 1},
  {0, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {0, __pyx_k_error_field, sizeof(__pyx_k_error_field), 0, 0, 1, 1},
  {0, __pyx_k_error_in_notice_receiver_s, sizeof(__pyx_k_error_in_notice_receiver_s), 0, 1, 0, 0},
  {0, __pyx_k_error_message, sizeof(__pyx_k_error_message), 0, 0, 1, 1},
  {0, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
  {0, __pyx_k_escape_bytea, sizeof(__pyx_k_escape_bytea), 0, 0, 1, 1},
  {0, __pyx_k_escape_identifier, sizeof(__pyx_k_escape_identifier), 0, 0, 1, 1},
  {0, __pyx_k_escape_identifier_failed, sizeof(__pyx_k_escape_identifier_failed), 0, 1, 0, 0},
  {0, __pyx_k_escape_identifier_failed_no_conn, sizeof(__pyx_k_escape_identifier_failed_no_conn), 0, 1, 0, 0},
  {0, __pyx_k_escape_literal, sizeof(__pyx_k_escape_literal), 0, 0, 1, 1},
  {0, __pyx_k_escape_literal_failed, sizeof(__pyx_k_escape_literal_failed), 0, 1, 0, 0},
  {0, __pyx_k_escape_literal_failed_no_connect, sizeof(__pyx_k_escape_literal_failed_no_connect), 0, 1, 0, 0},
  {0, __pyx_k_escape_string, sizeof(__pyx_k_escape_string), 0, 0, 1, 1},
  {0, __pyx_k_escape_string_failed, sizeof(__pyx_k_escape_string_failed), 0, 1, 0, 0},
  {0, __pyx_k_exc, sizeof(__pyx_k_exc), 0, 0, 1, 1},
  {0, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1},
  {0, __pyx_k_exec, sizeof(__pyx_k_exec), 0, 0, 1, 1},
  {0, __pyx_k_exec_params, sizeof(__pyx_k_exec_params), 0, 0, 1, 1},
  {0, __pyx_k_exec_prepared, sizeof(__pyx_k_exec_prepared), 0, 0, 1, 1},
  {0, __pyx_k_exec_status, sizeof(__pyx_k_exec_status), 0, 0, 1, 1},
  {0, __pyx_k_exit_pipeline_mode, sizeof(__pyx_k_exit_pipeline_mode), 0, 0, 1, 1},
  {0, __pyx_k_failed_to_enter_pipeline_mode, sizeof(__pyx_k_failed_to_enter_pipeline_mode), 0, 1, 0, 0},
  {0, __pyx_k_failed_to_sync_pipeline, sizeof(__pyx_k_failed_to_sync_pipeline), 0, 1, 0, 0},
  {0, __pyx_k_fformat, sizeof(__pyx_k_fformat), 0, 0, 1, 1},
  {0, __pyx_k_fieldcode, sizeof(__pyx_k_fieldcode), 0, 0, 1, 1},
  {0, __pyx_k_finish, sizeof(__pyx_k_finish), 0, 0, 1, 1},
  {0, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
  {0, __pyx_k_flush_request_failed, sizeof(__pyx_k_flush_request_failed), 0, 1, 0, 0},
  {0, __pyx_k_flushing_failed, sizeof(__pyx_k_flushing_failed), 0, 1, 0, 0},
  {0, __pyx_k_flushing_failed_the_connection_i, sizeof(__pyx_k_flushing_failed_the_connection_i), 0, 1, 0, 0},
  {0, __pyx_k_fmod, sizeof(__pyx_k_fmod), 0, 0, 1, 1},
  {0, __pyx_k_fname, sizeof(__pyx_k_fname), 0, 0, 1, 1},
  {0, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {0, __pyx_k_free, sizeof(__pyx_k_free), 0, 0, 1, 1},
  {0, __pyx_k_fsize, sizeof(__pyx_k_fsize), 0, 0, 1, 1},
  {0, __pyx_k_ftable, sizeof(__pyx_k_ftable), 0, 0, 1, 1},
  {0, __pyx_k_ftablecol, sizeof(__pyx_k_ftablecol), 0, 0, 1, 1},
  {0, __pyx_k_ftype, sizeof(__pyx_k_ftype), 0, 0, 1, 1},
  {0, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
  {0, __pyx_k_getLogger, sizeof(__pyx_k_getLogger), 0, 0, 1, 1},
  {0, __pyx_k_get_cancel, sizeof(__pyx_k_get_cancel), 0, 0, 1, 1},
  {0, __pyx_k_get_copy_data, sizeof(__pyx_k_get_copy_data), 0, 0, 1, 1},
  {0, __pyx_k_get_defaults, sizeof(__pyx_k_get_defaults), 0, 0, 1, 1},
  {0, __pyx_k_get_result, sizeof(__pyx_k_get_result), 0, 0, 1, 1},
  {0, __pyx_k_get_value, sizeof(__pyx_k_get_value), 0, 0, 1, 1},
  {0, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {0, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
  {0, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {0, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {0, __pyx_k_impl, sizeof(__pyx_k_impl), 0, 0, 1, 1},
  {0, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {0, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
  {0, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
  {0, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  {0, __pyx_k_is_busy, sizeof(__pyx_k_is_busy), 0, 0, 1, 1},
  {0, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
  {0, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
  {0, __pyx_k_keyword, sizeof(__pyx_k_keyword), 0, 0, 1, 1},
  {0, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1},
  {0, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {0, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1},
  {0, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
  {0, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {0, __pyx_k_make_empty_result, sizeof(__pyx_k_make_empty_result), 0, 0, 1, 1},
  {0, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {0, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {0, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {0, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {0, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1},
  {0, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {0, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  {0, __pyx_k_notifies, sizeof(__pyx_k_notifies), 0, 0, 1, 1},
  {0, __pyx_k_nparams, sizeof(__pyx_k_nparams), 0, 0, 1, 1},
  {0, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
  {0, __pyx_k_opts, sizeof(__pyx_k_opts), 0, 0, 1, 1},
  {0, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
  {0, __pyx_k_param_formats, sizeof(__pyx_k_param_formats), 0, 0, 1, 1},
  {0, __pyx_k_param_formats_2, sizeof(__pyx_k_param_formats_2), 0, 1, 0, 0},
  {0, __pyx_k_param_number, sizeof(__pyx_k_param_number), 0, 0, 1, 1},
  {0, __pyx_k_param_type, sizeof(__pyx_k_param_type), 0, 0, 1, 1},
  {0, __pyx_k_param_types, sizeof(__pyx_k_param_types), 0, 0, 1, 1},
  {0, __pyx_k_param_types_2, sizeof(__pyx_k_param_types_2), 0, 1, 0, 0},
  {0, __pyx_k_param_values, sizeof(__pyx_k_param_values), 0, 0, 1, 1},
  {0, __pyx_k_param_values_but, sizeof(__pyx_k_param_values_but), 0, 1, 0, 0},
  {0, __pyx_k_parameter_status, sizeof(__pyx_k_parameter_status), 0, 0, 1, 1},
  {0, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1},
  {0, __pyx_k_passwd, sizeof(__pyx_k_passwd), 0, 0, 1, 1},
  {0, __pyx_k_password_encryption_failed, sizeof(__pyx_k_password_encryption_failed), 0, 1, 0, 0},
  {0, __pyx_k_pgconn, sizeof(__pyx_k_pgconn), 0, 0, 1, 1},
  {0, __pyx_k_pgresult, sizeof(__pyx_k_pgresult), 0, 0, 1, 1},
  {0, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {0, __pyx_k_ping, sizeof(__pyx_k_ping), 0, 0, 1, 1},
  {0, __pyx_k_pipeline_sync, sizeof(__pyx_k_pipeline_sync), 0, 0, 1, 1},
  {0, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {0, __pyx_k_prepare_2, sizeof(__pyx_k_prepare_2), 0, 0, 1, 1},
  {0, __pyx_k_psycopg, sizeof(__pyx_k_psycopg), 0, 0, 1, 1},
  {0, __pyx_k_psycopg, sizeof(__pyx_k_psycopg), 0, 1, 0, 1},
  {0, __pyx_k_psycopg_c_pq, sizeof(__pyx_k_psycopg_c_pq), 0, 0, 1, 1},
  {0, __pyx_k_psycopg_c_pq_conninfo_pyx, sizeof(__pyx_k_psycopg_c_pq_conninfo_pyx), 0, 0, 1, 0},
  {0, __pyx_k_psycopg_c_pq_escaping_pyx, sizeof(__pyx_k_psycopg_c_pq_escaping_pyx), 0, 0, 1, 0},
  {0, __pyx_k_psycopg_c_pq_pgcancel_pyx, sizeof(__pyx_k_psycopg_c_pq_pgcancel_pyx), 0, 0, 1, 0},
  {0, __pyx_k_psycopg_c_pq_pgconn_pyx, sizeof(__pyx_k_psycopg_c_pq_pgconn_pyx), 0, 0, 1, 0},
  {0, __pyx_k_psycopg_c_pq_pgresult_pyx, sizeof(__pyx_k_psycopg_c_pq_pgresult_pyx), 0, 0, 1, 0},
  {0, __pyx_k_psycopg_c_pq_pyx, sizeof(__pyx_k_psycopg_c_pq_pyx), 0, 0, 1, 0},
  {0, __pyx_k_psycopg_pq, sizeof(__pyx_k_psycopg_pq), 0, 0, 1, 1},
  {0, __pyx_k_psycopg_pq__enums, sizeof(__pyx_k_psycopg_pq__enums), 0, 0, 1, 1},
  {0, __pyx_k_psycopg_pq_misc, sizeof(__pyx_k_psycopg_pq_misc), 0, 0, 1, 1},
  {0, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1},
  {0, __pyx_k_put_copy_data, sizeof(__pyx_k_put_copy_data), 0, 0, 1, 1},
  {0, __pyx_k_put_copy_end, sizeof(__pyx_k_put_copy_end), 0, 0, 1, 1},
  {0, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {0, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {0, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {0, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {0, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {0, __pyx_k_pyx_unpickle_Escaping, sizeof(__pyx_k_pyx_unpickle_Escaping), 0, 0, 1, 1},
  {0, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {0, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {0, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {0, __pyx_k_receiving_copy_data_failed, sizeof(__pyx_k_receiving_copy_data_failed), 0, 1, 0, 0},
  {0, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {0, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {0, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {0, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  {0, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
  {0, __pyx_k_reset_poll, sizeof(__pyx_k_reset_poll), 0, 0, 1, 1},
  {0, __pyx_k_reset_start, sizeof(__pyx_k_reset_start), 0, 0, 1, 1},
  {0, __pyx_k_result_format, sizeof(__pyx_k_result_format), 0, 0, 1, 1},
  {0, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1},
  {0, __pyx_k_row_number, sizeof(__pyx_k_row_number), 0, 0, 1, 1},
  {0, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1},
  {0, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {0, __pyx_k_send_describe_portal, sizeof(__pyx_k_send_describe_portal), 0, 0, 1, 1},
  {0, __pyx_k_send_describe_prepared, sizeof(__pyx_k_send_describe_prepared), 0, 0, 1, 1},
  {0, __pyx_k_send_flush_request, sizeof(__pyx_k_send_flush_request), 0, 0, 1, 1},
  {0, __pyx_k_send_prepare, sizeof(__pyx_k_send_prepare), 0, 0, 1, 1},
  {0, __pyx_k_send_query, sizeof(__pyx_k_send_query), 0, 0, 1, 1},
  {0, __pyx_k_send_query_params, sizeof(__pyx_k_send_query_params), 0, 0, 1, 1},
  {0, __pyx_k_send_query_prepared, sizeof(__pyx_k_send_query_prepared), 0, 0, 1, 1},
  {0, __pyx_k_sending_copy_data_failed, sizeof(__pyx_k_sending_copy_data_failed), 0, 1, 0, 0},
  {0, __pyx_k_sending_copy_end_failed, sizeof(__pyx_k_sending_copy_end_failed), 0, 1, 0, 0},
  {0, __pyx_k_sending_describe_prepared_failed, sizeof(__pyx_k_sending_describe_prepared_failed), 0, 1, 0, 0},
  {0, __pyx_k_sending_prepared_query_failed, sizeof(__pyx_k_sending_prepared_query_failed), 0, 1, 0, 0},
  {0, __pyx_k_sending_query_and_params_failed, sizeof(__pyx_k_sending_query_and_params_failed), 0, 1, 0, 0},
  {0, __pyx_k_sending_query_failed, sizeof(__pyx_k_sending_query_failed), 0, 1, 0, 0},
  {0, __pyx_k_set_attributes, sizeof(__pyx_k_set_attributes), 0, 0, 1, 1},
  {0, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
  {0, __pyx_k_set_single_row_mode, sizeof(__pyx_k_set_single_row_mode), 0, 0, 1, 1},
  {0, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {0, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_setting_nonblocking_failed, sizeof(__pyx_k_setting_nonblocking_failed), 0, 1, 0, 0},
  {0, __pyx_k_setting_single_row_mode_failed, sizeof(__pyx_k_setting_single_row_mode_failed), 0, 1, 0, 0},
  {0, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
  {0, __pyx_k_ssl, sizeof(__pyx_k_ssl), 0, 0, 1, 1},
  {0, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {0, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1},
  {0, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {0, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {0, __pyx_k_tableid, sizeof(__pyx_k_tableid), 0, 0, 1, 1},
  {0, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {0, __pyx_k_the_connection_is_closed, sizeof(__pyx_k_the_connection_is_closed), 0, 1, 0, 0},
  {0, __pyx_k_the_connection_is_lost, sizeof(__pyx_k_the_connection_is_lost), 0, 1, 0, 0},
  {0, __pyx_k_typid, sizeof(__pyx_k_typid), 0, 0, 1, 1},
  {0, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
  {0, __pyx_k_typlen, sizeof(__pyx_k_typlen), 0, 0, 1, 1},
  {0, __pyx_k_unescape_bytea, sizeof(__pyx_k_unescape_bytea), 0, 0, 1, 1},
  {0, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {0, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
  {0, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1},
  {0, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
  {0, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
  {0, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {0, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1},
  #else
  {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
  {&__pyx_n_s_Conninfo, __pyx_k_Conninfo, sizeof(__pyx_k_Conninfo), 0, 0, 1, 1},
  {&__pyx_n_s_ConninfoOption, __pyx_k_ConninfoOption, sizeof(__pyx_k_ConninfoOption), 0, 0, 1, 1},
  {&__pyx_n_s_Conninfo___repr, __pyx_k_Conninfo___repr, sizeof(__pyx_k_Conninfo___repr), 0, 0, 1, 1},
  {&__pyx_n_s_Conninfo_get_defaults, __pyx_k_Conninfo_get_defaults, sizeof(__pyx_k_Conninfo_get_defaults), 0, 0, 1, 1},
  {&__pyx_n_s_Conninfo_parse, __pyx_k_Conninfo_parse, sizeof(__pyx_k_Conninfo_parse), 0, 0, 1, 1},
  {&__pyx_n_s_Escaping, __pyx_k_Escaping, sizeof(__pyx_k_Escaping), 0, 0, 1, 1},
  {&__pyx_n_s_Escaping___reduce_cython, __pyx_k_Escaping___reduce_cython, sizeof(__pyx_k_Escaping___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_Escaping___setstate_cython, __pyx_k_Escaping___setstate_cython, sizeof(__pyx_k_Escaping___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_Escaping_escape_bytea, __pyx_k_Escaping_escape_bytea, sizeof(__pyx_k_Escaping_escape_bytea), 0, 0, 1, 1},
  {&__pyx_n_s_Escaping_escape_identifier, __pyx_k_Escaping_escape_identifier, sizeof(__pyx_k_Escaping_escape_identifier), 0, 0, 1, 1},
  {&__pyx_n_s_Escaping_escape_literal, __pyx_k_Escaping_escape_literal, sizeof(__pyx_k_Escaping_escape_literal), 0, 0, 1, 1},
  {&__pyx_n_s_Escaping_escape_string, __pyx_k_Escaping_escape_string, sizeof(__pyx_k_Escaping_escape_string), 0, 0, 1, 1},
  {&__pyx_n_s_Escaping_unescape_bytea, __pyx_k_Escaping_unescape_bytea, sizeof(__pyx_k_Escaping_unescape_bytea), 0, 0, 1, 1},
  {&__pyx_n_s_ExecStatus, __pyx_k_ExecStatus, sizeof(__pyx_k_ExecStatus), 0, 0, 1, 1},
  {&__pyx_n_s_Format, __pyx_k_Format, sizeof(__pyx_k_Format), 0, 0, 1, 1},
  {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
  {&__pyx_n_s_Iterator, __pyx_k_Iterator, sizeof(__pyx_k_Iterator), 0, 0, 1, 1},
  {&__pyx_kp_s_List_ConninfoOption, __pyx_k_List_ConninfoOption, sizeof(__pyx_k_List_ConninfoOption), 0, 0, 1, 0},
  {&__pyx_kp_s_List_PGresAttDesc, __pyx_k_List_PGresAttDesc, sizeof(__pyx_k_List_PGresAttDesc), 0, 0, 1, 0},
  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
  {&__pyx_n_s_NotSupportedError, __pyx_k_NotSupportedError, sizeof(__pyx_k_NotSupportedError), 0, 0, 1, 1},
  {&__pyx_n_s_OperationalError, __pyx_k_OperationalError, sizeof(__pyx_k_OperationalError), 0, 0, 1, 1},
  {&__pyx_kp_s_Optional_PGresult, __pyx_k_Optional_PGresult, sizeof(__pyx_k_Optional_PGresult), 0, 0, 1, 0},
  {&__pyx_kp_s_Optional_Sequence_Optional_bytes, __pyx_k_Optional_Sequence_Optional_bytes, sizeof(__pyx_k_Optional_Sequence_Optional_bytes), 0, 0, 1, 0},
  {&__pyx_kp_s_Optional_Sequence_bytes, __pyx_k_Optional_Sequence_bytes, sizeof(__pyx_k_Optional_Sequence_bytes), 0, 0, 1, 0},
  {&__pyx_kp_s_Optional_Sequence_int, __pyx_k_Optional_Sequence_int, sizeof(__pyx_k_Optional_Sequence_int), 0, 0, 1, 0},
  {&__pyx_kp_s_Optional_bytes, __pyx_k_Optional_bytes, sizeof(__pyx_k_Optional_bytes), 0, 0, 1, 0},
  {&__pyx_n_s_PGcancel, __pyx_k_PGcancel, sizeof(__pyx_k_PGcancel), 0, 0, 1, 1},
  {&__pyx_n_s_PGcancel___reduce_cython, __pyx_k_PGcancel___reduce_cython, sizeof(__pyx_k_PGcancel___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_PGcancel___setstate_cython, __pyx_k_PGcancel___setstate_cython, sizeof(__pyx_k_PGcancel___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_PGcancel_cancel, __pyx_k_PGcancel_cancel, sizeof(__pyx_k_PGcancel_cancel), 0, 0, 1, 1},
  {&__pyx_n_s_PGcancel_free, __pyx_k_PGcancel_free, sizeof(__pyx_k_PGcancel_free), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn, __pyx_k_PGconn, sizeof(__pyx_k_PGconn), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn___reduce_cython, __pyx_k_PGconn___reduce_cython, sizeof(__pyx_k_PGconn___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn___setstate_cython, __pyx_k_PGconn___setstate_cython, sizeof(__pyx_k_PGconn___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_connect, __pyx_k_PGconn_connect, sizeof(__pyx_k_PGconn_connect), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_connect_poll, __pyx_k_PGconn_connect_poll, sizeof(__pyx_k_PGconn_connect_poll), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_connect_start, __pyx_k_PGconn_connect_start, sizeof(__pyx_k_PGconn_connect_start), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_consume_input, __pyx_k_PGconn_consume_input, sizeof(__pyx_k_PGconn_consume_input), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_describe_portal, __pyx_k_PGconn_describe_portal, sizeof(__pyx_k_PGconn_describe_portal), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_describe_prepared, __pyx_k_PGconn_describe_prepared, sizeof(__pyx_k_PGconn_describe_prepared), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_encrypt_password, __pyx_k_PGconn_encrypt_password, sizeof(__pyx_k_PGconn_encrypt_password), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_enter_pipeline_mode, __pyx_k_PGconn_enter_pipeline_mode, sizeof(__pyx_k_PGconn_enter_pipeline_mode), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_exec, __pyx_k_PGconn_exec, sizeof(__pyx_k_PGconn_exec), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_exec_params, __pyx_k_PGconn_exec_params, sizeof(__pyx_k_PGconn_exec_params), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_exec_prepared, __pyx_k_PGconn_exec_prepared, sizeof(__pyx_k_PGconn_exec_prepared), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_exit_pipeline_mode, __pyx_k_PGconn_exit_pipeline_mode, sizeof(__pyx_k_PGconn_exit_pipeline_mode), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_finish, __pyx_k_PGconn_finish, sizeof(__pyx_k_PGconn_finish), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_flush, __pyx_k_PGconn_flush, sizeof(__pyx_k_PGconn_flush), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_get_cancel, __pyx_k_PGconn_get_cancel, sizeof(__pyx_k_PGconn_get_cancel), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_get_copy_data, __pyx_k_PGconn_get_copy_data, sizeof(__pyx_k_PGconn_get_copy_data), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_get_result, __pyx_k_PGconn_get_result, sizeof(__pyx_k_PGconn_get_result), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_is_busy, __pyx_k_PGconn_is_busy, sizeof(__pyx_k_PGconn_is_busy), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_make_empty_result, __pyx_k_PGconn_make_empty_result, sizeof(__pyx_k_PGconn_make_empty_result), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_notifies, __pyx_k_PGconn_notifies, sizeof(__pyx_k_PGconn_notifies), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_parameter_status, __pyx_k_PGconn_parameter_status, sizeof(__pyx_k_PGconn_parameter_status), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_ping, __pyx_k_PGconn_ping, sizeof(__pyx_k_PGconn_ping), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_pipeline_sync, __pyx_k_PGconn_pipeline_sync, sizeof(__pyx_k_PGconn_pipeline_sync), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_prepare, __pyx_k_PGconn_prepare, sizeof(__pyx_k_PGconn_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_put_copy_data, __pyx_k_PGconn_put_copy_data, sizeof(__pyx_k_PGconn_put_copy_data), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_put_copy_end, __pyx_k_PGconn_put_copy_end, sizeof(__pyx_k_PGconn_put_copy_end), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_reset, __pyx_k_PGconn_reset, sizeof(__pyx_k_PGconn_reset), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_reset_poll, __pyx_k_PGconn_reset_poll, sizeof(__pyx_k_PGconn_reset_poll), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_reset_start, __pyx_k_PGconn_reset_start, sizeof(__pyx_k_PGconn_reset_start), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_send_describe_portal, __pyx_k_PGconn_send_describe_portal, sizeof(__pyx_k_PGconn_send_describe_portal), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_send_describe_prepared, __pyx_k_PGconn_send_describe_prepared, sizeof(__pyx_k_PGconn_send_describe_prepared), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_send_flush_request, __pyx_k_PGconn_send_flush_request, sizeof(__pyx_k_PGconn_send_flush_request), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_send_prepare, __pyx_k_PGconn_send_prepare, sizeof(__pyx_k_PGconn_send_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_send_query, __pyx_k_PGconn_send_query, sizeof(__pyx_k_PGconn_send_query), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_send_query_params, __pyx_k_PGconn_send_query_params, sizeof(__pyx_k_PGconn_send_query_params), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_send_query_prepared, __pyx_k_PGconn_send_query_prepared, sizeof(__pyx_k_PGconn_send_query_prepared), 0, 0, 1, 1},
  {&__pyx_n_s_PGconn_set_single_row_mode, __pyx_k_PGconn_set_single_row_mode, sizeof(__pyx_k_PGconn_set_single_row_mode), 0, 0, 1, 1},
  {&__pyx_n_s_PGnotify, __pyx_k_PGnotify, sizeof(__pyx_k_PGnotify), 0, 0, 1, 1},
  {&__pyx_n_s_PGresAttDesc, __pyx_k_PGresAttDesc, sizeof(__pyx_k_PGresAttDesc), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult, __pyx_k_PGresult, sizeof(__pyx_k_PGresult), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult___reduce_cython, __pyx_k_PGresult___reduce_cython, sizeof(__pyx_k_PGresult___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult___setstate_cython, __pyx_k_PGresult___setstate_cython, sizeof(__pyx_k_PGresult___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_clear, __pyx_k_PGresult_clear, sizeof(__pyx_k_PGresult_clear), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_error_field, __pyx_k_PGresult_error_field, sizeof(__pyx_k_PGresult_error_field), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_fformat, __pyx_k_PGresult_fformat, sizeof(__pyx_k_PGresult_fformat), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_fmod, __pyx_k_PGresult_fmod, sizeof(__pyx_k_PGresult_fmod), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_fname, __pyx_k_PGresult_fname, sizeof(__pyx_k_PGresult_fname), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_fsize, __pyx_k_PGresult_fsize, sizeof(__pyx_k_PGresult_fsize), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_ftable, __pyx_k_PGresult_ftable, sizeof(__pyx_k_PGresult_ftable), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_ftablecol, __pyx_k_PGresult_ftablecol, sizeof(__pyx_k_PGresult_ftablecol), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_ftype, __pyx_k_PGresult_ftype, sizeof(__pyx_k_PGresult_ftype), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_get_value, __pyx_k_PGresult_get_value, sizeof(__pyx_k_PGresult_get_value), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_param_type, __pyx_k_PGresult_param_type, sizeof(__pyx_k_PGresult_param_type), 0, 0, 1, 1},
  {&__pyx_n_s_PGresult_set_attributes, __pyx_k_PGresult_set_attributes, sizeof(__pyx_k_PGresult_set_attributes), 0, 0, 1, 1},
  {&__pyx_n_s_PQBuffer, __pyx_k_PQBuffer, sizeof(__pyx_k_PQBuffer), 0, 0, 1, 1},
  {&__pyx_n_s_PQBuffer___reduce_cython, __pyx_k_PQBuffer___reduce_cython, sizeof(__pyx_k_PQBuffer___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_PQBuffer___setstate_cython, __pyx_k_PQBuffer___setstate_cython, sizeof(__pyx_k_PQBuffer___setstate_cython), 0, 0, 1, 1},
  {&__pyx_kp_u_PQencryptPasswordConn_requires_l, __pyx_k_PQencryptPasswordConn_requires_l, sizeof(__pyx_k_PQencryptPasswordConn_requires_l), 0, 1, 0, 0},
  {&__pyx_kp_u_PQenterPipelineMode_requires_lib, __pyx_k_PQenterPipelineMode_requires_lib, sizeof(__pyx_k_PQenterPipelineMode_requires_lib), 0, 1, 0, 0},
  {&__pyx_kp_u_PQexitPipelineMode_requires_libp, __pyx_k_PQexitPipelineMode_requires_libp, sizeof(__pyx_k_PQexitPipelineMode_requires_libp), 0, 1, 0, 0},
  {&__pyx_kp_u_PQhostaddr_requires_libpq_from_P, __pyx_k_PQhostaddr_requires_libpq_from_P, sizeof(__pyx_k_PQhostaddr_requires_libpq_from_P), 0, 1, 0, 0},
  {&__pyx_kp_u_PQpipelineSync_requires_libpq_fr, __pyx_k_PQpipelineSync_requires_libpq_fr, sizeof(__pyx_k_PQpipelineSync_requires_libpq_fr), 0, 1, 0, 0},
  {&__pyx_kp_u_PQsendFlushRequest_requires_libp, __pyx_k_PQsendFlushRequest_requires_libp, sizeof(__pyx_k_PQsendFlushRequest_requires_libp), 0, 1, 0, 0},
  {&__pyx_kp_u_PQsetResultAttrs_failed, __pyx_k_PQsetResultAttrs_failed, sizeof(__pyx_k_PQsetResultAttrs_failed), 0, 1, 0, 0},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_PipelineStatus, __pyx_k_PipelineStatus, sizeof(__pyx_k_PipelineStatus), 0, 0, 1, 1},
  {&__pyx_n_s_PqFormat, __pyx_k_PqFormat, sizeof(__pyx_k_PqFormat), 0, 0, 1, 1},
  {&__pyx_n_s_TEXT, __pyx_k_TEXT, sizeof(__pyx_k_TEXT), 0, 0, 1, 1},
  {&__pyx_kp_s_Tuple_int_memoryview, __pyx_k_Tuple_int_memoryview, sizeof(__pyx_k_Tuple_int_memoryview), 0, 0, 1, 0},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_ViewBuffer, __pyx_k_ViewBuffer, sizeof(__pyx_k_ViewBuffer), 0, 0, 1, 1},
  {&__pyx_n_s_ViewBuffer___reduce_cython, __pyx_k_ViewBuffer___reduce_cython, sizeof(__pyx_k_ViewBuffer___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_ViewBuffer___setstate_cython, __pyx_k_ViewBuffer___setstate_cython, sizeof(__pyx_k_ViewBuffer___setstate_cython), 0, 0, 1, 1},
  {&__pyx_kp_b__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 0, 0},
  {&__pyx_n_s__130, __pyx_k__130, sizeof(__pyx_k__130), 0, 0, 1, 1},
  {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0},
  {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
  {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0},
  {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
  {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
  {&__pyx_kp_u__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0, 0},
  {&__pyx_n_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 1},
  {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
  {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
  {&__pyx_n_s_algorithm, __pyx_k_algorithm, sizeof(__pyx_k_algorithm), 0, 0, 1, 1},
  {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1},
  {&__pyx_n_s_async, __pyx_k_async, sizeof(__pyx_k_async), 0, 0, 1, 1},
  {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
  {&__pyx_kp_u_at_0x, __pyx_k_at_0x, sizeof(__pyx_k_at_0x), 0, 1, 0, 0},
  {&__pyx_kp_u_at_0x_2, __pyx_k_at_0x_2, sizeof(__pyx_k_at_0x_2), 0, 1, 0, 0},
  {&__pyx_n_s_attrs, __pyx_k_attrs, sizeof(__pyx_k_attrs), 0, 0, 1, 1},
  {&__pyx_n_s_atttypmod, __pyx_k_atttypmod, sizeof(__pyx_k_atttypmod), 0, 0, 1, 1},
  {&__pyx_n_s_atypes, __pyx_k_atypes, sizeof(__pyx_k_atypes), 0, 0, 1, 1},
  {&__pyx_kp_u_available_instead, __pyx_k_available_instead, sizeof(__pyx_k_available_instead), 0, 1, 0, 0},
  {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1},
  {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_buffer_ptr, __pyx_k_buffer_ptr, sizeof(__pyx_k_buffer_ptr), 0, 0, 1, 1},
  {&__pyx_n_s_build_version, __pyx_k_build_version, sizeof(__pyx_k_build_version), 0, 0, 1, 1},
  {&__pyx_kp_u_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 1, 0, 0},
  {&__pyx_n_s_bytes_2, __pyx_k_bytes_2, sizeof(__pyx_k_bytes_2), 0, 0, 1, 1},
  {&__pyx_kp_u_bytes_or_buffer_expected_got, __pyx_k_bytes_or_buffer_expected_got, sizeof(__pyx_k_bytes_or_buffer_expected_got), 0, 1, 0, 0},
  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
  {&__pyx_n_s_calgo, __pyx_k_calgo, sizeof(__pyx_k_calgo), 0, 0, 1, 1},
  {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1},
  {&__pyx_kp_u_cancel_failed, __pyx_k_cancel_failed, sizeof(__pyx_k_cancel_failed), 0, 1, 0, 0},
  {&__pyx_n_s_cbuffer, __pyx_k_cbuffer, sizeof(__pyx_k_cbuffer), 0, 0, 1, 1},
  {&__pyx_n_s_ccol, __pyx_k_ccol, sizeof(__pyx_k_ccol), 0, 0, 1, 1},
  {&__pyx_n_s_cerr, __pyx_k_cerr, sizeof(__pyx_k_cerr), 0, 0, 1, 1},
  {&__pyx_n_s_cformats, __pyx_k_cformats, sizeof(__pyx_k_cformats), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_clengths, __pyx_k_clengths, sizeof(__pyx_k_clengths), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
  {&__pyx_n_s_cnparams, __pyx_k_cnparams, sizeof(__pyx_k_cnparams), 0, 0, 1, 1},
  {&__pyx_n_s_column_number, __pyx_k_column_number, sizeof(__pyx_k_column_number), 0, 0, 1, 1},
  {&__pyx_n_s_columnid, __pyx_k_columnid, sizeof(__pyx_k_columnid), 0, 0, 1, 1},
  {&__pyx_n_s_command, __pyx_k_command, sizeof(__pyx_k_command), 0, 0, 1, 1},
  {&__pyx_n_s_compiled, __pyx_k_compiled, sizeof(__pyx_k_compiled), 0, 0, 1, 1},
  {&__pyx_n_s_conn, __pyx_k_conn, sizeof(__pyx_k_conn), 0, 0, 1, 1},
  {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
  {&__pyx_n_s_connect_poll, __pyx_k_connect_poll, sizeof(__pyx_k_connect_poll), 0, 0, 1, 1},
  {&__pyx_n_s_connect_start, __pyx_k_connect_start, sizeof(__pyx_k_connect_start), 0, 0, 1, 1},
  {&__pyx_kp_u_connection_not_in_pipeline_mode, __pyx_k_connection_not_in_pipeline_mode, sizeof(__pyx_k_connection_not_in_pipeline_mode), 0, 1, 0, 0},
  {&__pyx_n_s_connection_summary, __pyx_k_connection_summary, sizeof(__pyx_k_connection_summary), 0, 0, 1, 1},
  {&__pyx_n_s_conninfo, __pyx_k_conninfo, sizeof(__pyx_k_conninfo), 0, 0, 1, 1},
  {&__pyx_n_s_consume_input, __pyx_k_consume_input, sizeof(__pyx_k_consume_input), 0, 0, 1, 1},
  {&__pyx_kp_u_consuming_input_failed, __pyx_k_consuming_input_failed, sizeof(__pyx_k_consuming_input_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_couldn_t_allocate_PGconn, __pyx_k_couldn_t_allocate_PGconn, sizeof(__pyx_k_couldn_t_allocate_PGconn), 0, 1, 0, 0},
  {&__pyx_kp_u_couldn_t_allocate_PGresult, __pyx_k_couldn_t_allocate_PGresult, sizeof(__pyx_k_couldn_t_allocate_PGresult), 0, 1, 0, 0},
  {&__pyx_kp_u_couldn_t_allocate_connection_def, __pyx_k_couldn_t_allocate_connection_def, sizeof(__pyx_k_couldn_t_allocate_connection_def), 0, 1, 0, 0},
  {&__pyx_kp_u_couldn_t_allocate_connection_inf, __pyx_k_couldn_t_allocate_connection_inf, sizeof(__pyx_k_couldn_t_allocate_connection_inf), 0, 1, 0, 0},
  {&__pyx_kp_u_couldn_t_allocate_empty_PGresult, __pyx_k_couldn_t_allocate_empty_PGresult, sizeof(__pyx_k_couldn_t_allocate_empty_PGresult), 0, 1, 0, 0},
  {&__pyx_kp_u_couldn_t_allocate_for_escape_byt, __pyx_k_couldn_t_allocate_for_escape_byt, sizeof(__pyx_k_couldn_t_allocate_for_escape_byt), 0, 1, 0, 0},
  {&__pyx_kp_u_couldn_t_allocate_for_unescape_b, __pyx_k_couldn_t_allocate_for_unescape_b, sizeof(__pyx_k_couldn_t_allocate_for_unescape_b), 0, 1, 0, 0},
  {&__pyx_kp_u_couldn_t_allocate_on_conninfo_pa, __pyx_k_couldn_t_allocate_on_conninfo_pa, sizeof(__pyx_k_couldn_t_allocate_on_conninfo_pa), 0, 1, 0, 0},
  {&__pyx_kp_u_couldn_t_create_cancel_object, __pyx_k_couldn_t_create_cancel_object, sizeof(__pyx_k_couldn_t_create_cancel_object), 0, 1, 0, 0},
  {&__pyx_kp_u_couldn_t_reset_connection, __pyx_k_couldn_t_reset_connection, sizeof(__pyx_k_couldn_t_reset_connection), 0, 1, 0, 0},
  {&__pyx_n_s_crow, __pyx_k_crow, sizeof(__pyx_k_crow), 0, 0, 1, 1},
  {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
  {&__pyx_n_s_cvalues, __pyx_k_cvalues, sizeof(__pyx_k_cvalues), 0, 0, 1, 1},
  {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_descr, __pyx_k_descr, sizeof(__pyx_k_descr), 0, 0, 1, 1},
  {&__pyx_n_s_describe_portal, __pyx_k_describe_portal, sizeof(__pyx_k_describe_portal), 0, 0, 1, 1},
  {&__pyx_n_s_describe_prepared, __pyx_k_describe_prepared, sizeof(__pyx_k_describe_prepared), 0, 0, 1, 1},
  {&__pyx_n_s_descriptions, __pyx_k_descriptions, sizeof(__pyx_k_descriptions), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
  {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
  {&__pyx_n_s_dispchar, __pyx_k_dispchar, sizeof(__pyx_k_dispchar), 0, 0, 1, 1},
  {&__pyx_n_s_dispsize, __pyx_k_dispsize, sizeof(__pyx_k_dispsize), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
  {&__pyx_n_s_encrypt_password, __pyx_k_encrypt_password, sizeof(__pyx_k_encrypt_password), 0, 0, 1, 1},
  {&__pyx_n_s_enter_pipeline_mode, __pyx_k_enter_pipeline_mode, sizeof(__pyx_k_enter_pipeline_mode), 0, 0, 1, 1},
  {&__pyx_n_s_envvar, __pyx_k_envvar, sizeof(__pyx_k_envvar), 0, 0, 1, 1},
  {&__pyx_n_s_errmsg, __pyx_k_errmsg, sizeof(__pyx_k_errmsg), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_n_s_error_field, __pyx_k_error_field, sizeof(__pyx_k_error_field), 0, 0, 1, 1},
  {&__pyx_kp_u_error_in_notice_receiver_s, __pyx_k_error_in_notice_receiver_s, sizeof(__pyx_k_error_in_notice_receiver_s), 0, 1, 0, 0},
  {&__pyx_n_s_error_message, __pyx_k_error_message, sizeof(__pyx_k_error_message), 0, 0, 1, 1},
  {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
  {&__pyx_n_s_escape_bytea, __pyx_k_escape_bytea, sizeof(__pyx_k_escape_bytea), 0, 0, 1, 1},
  {&__pyx_n_s_escape_identifier, __pyx_k_escape_identifier, sizeof(__pyx_k_escape_identifier), 0, 0, 1, 1},
  {&__pyx_kp_u_escape_identifier_failed, __pyx_k_escape_identifier_failed, sizeof(__pyx_k_escape_identifier_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_escape_identifier_failed_no_conn, __pyx_k_escape_identifier_failed_no_conn, sizeof(__pyx_k_escape_identifier_failed_no_conn), 0, 1, 0, 0},
  {&__pyx_n_s_escape_literal, __pyx_k_escape_literal, sizeof(__pyx_k_escape_literal), 0, 0, 1, 1},
  {&__pyx_kp_u_escape_literal_failed, __pyx_k_escape_literal_failed, sizeof(__pyx_k_escape_literal_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_escape_literal_failed_no_connect, __pyx_k_escape_literal_failed_no_connect, sizeof(__pyx_k_escape_literal_failed_no_connect), 0, 1, 0, 0},
  {&__pyx_n_s_escape_string, __pyx_k_escape_string, sizeof(__pyx_k_escape_string), 0, 0, 1, 1},
  {&__pyx_kp_u_escape_string_failed, __pyx_k_escape_string_failed, sizeof(__pyx_k_escape_string_failed), 0, 1, 0, 0},
  {&__pyx_n_s_exc, __pyx_k_exc, sizeof(__pyx_k_exc), 0, 0, 1, 1},
  {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1},
  {&__pyx_n_s_exec, __pyx_k_exec, sizeof(__pyx_k_exec), 0, 0, 1, 1},
  {&__pyx_n_s_exec_params, __pyx_k_exec_params, sizeof(__pyx_k_exec_params), 0, 0, 1, 1},
  {&__pyx_n_s_exec_prepared, __pyx_k_exec_prepared, sizeof(__pyx_k_exec_prepared), 0, 0, 1, 1},
  {&__pyx_n_s_exec_status, __pyx_k_exec_status, sizeof(__pyx_k_exec_status), 0, 0, 1, 1},
  {&__pyx_n_s_exit_pipeline_mode, __pyx_k_exit_pipeline_mode, sizeof(__pyx_k_exit_pipeline_mode), 0, 0, 1, 1},
  {&__pyx_kp_u_failed_to_enter_pipeline_mode, __pyx_k_failed_to_enter_pipeline_mode, sizeof(__pyx_k_failed_to_enter_pipeline_mode), 0, 1, 0, 0},
  {&__pyx_kp_u_failed_to_sync_pipeline, __pyx_k_failed_to_sync_pipeline, sizeof(__pyx_k_failed_to_sync_pipeline), 0, 1, 0, 0},
  {&__pyx_n_s_fformat, __pyx_k_fformat, sizeof(__pyx_k_fformat), 0, 0, 1, 1},
  {&__pyx_n_s_fieldcode, __pyx_k_fieldcode, sizeof(__pyx_k_fieldcode), 0, 0, 1, 1},
  {&__pyx_n_s_finish, __pyx_k_finish, sizeof(__pyx_k_finish), 0, 0, 1, 1},
  {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
  {&__pyx_kp_u_flush_request_failed, __pyx_k_flush_request_failed, sizeof(__pyx_k_flush_request_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_flushing_failed, __pyx_k_flushing_failed, sizeof(__pyx_k_flushing_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_flushing_failed_the_connection_i, __pyx_k_flushing_failed_the_connection_i, sizeof(__pyx_k_flushing_failed_the_connection_i), 0, 1, 0, 0},
  {&__pyx_n_s_fmod, __pyx_k_fmod, sizeof(__pyx_k_fmod), 0, 0, 1, 1},
  {&__pyx_n_s_fname, __pyx_k_fname, sizeof(__pyx_k_fname), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_free, __pyx_k_free, sizeof(__pyx_k_free), 0, 0, 1, 1},
  {&__pyx_n_s_fsize, __pyx_k_fsize, sizeof(__pyx_k_fsize), 0, 0, 1, 1},
  {&__pyx_n_s_ftable, __pyx_k_ftable, sizeof(__pyx_k_ftable), 0, 0, 1, 1},
  {&__pyx_n_s_ftablecol, __pyx_k_ftablecol, sizeof(__pyx_k_ftablecol), 0, 0, 1, 1},
  {&__pyx_n_s_ftype, __pyx_k_ftype, sizeof(__pyx_k_ftype), 0, 0, 1, 1},
  {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
  {&__pyx_n_s_getLogger, __pyx_k_getLogger, sizeof(__pyx_k_getLogger), 0, 0, 1, 1},
  {&__pyx_n_s_get_cancel, __pyx_k_get_cancel, sizeof(__pyx_k_get_cancel), 0, 0, 1, 1},
  {&__pyx_n_s_get_copy_data, __pyx_k_get_copy_data, sizeof(__pyx_k_get_copy_data), 0, 0, 1, 1},
  {&__pyx_n_s_get_defaults, __pyx_k_get_defaults, sizeof(__pyx_k_get_defaults), 0, 0, 1, 1},
  {&__pyx_n_s_get_result, __pyx_k_get_result, sizeof(__pyx_k_get_result), 0, 0, 1, 1},
  {&__pyx_n_s_get_value, __pyx_k_get_value, sizeof(__pyx_k_get_value), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_impl, __pyx_k_impl, sizeof(__pyx_k_impl), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
  {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
  {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  {&__pyx_n_s_is_busy, __pyx_k_is_busy, sizeof(__pyx_k_is_busy), 0, 0, 1, 1},
  {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
  {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
  {&__pyx_n_s_keyword, __pyx_k_keyword, sizeof(__pyx_k_keyword), 0, 0, 1, 1},
  {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_logger, __pyx_k_logger, sizeof(__pyx_k_logger), 0, 0, 1, 1},
  {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_make_empty_result, __pyx_k_make_empty_result, sizeof(__pyx_k_make_empty_result), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  {&__pyx_n_s_notifies, __pyx_k_notifies, sizeof(__pyx_k_notifies), 0, 0, 1, 1},
  {&__pyx_n_s_nparams, __pyx_k_nparams, sizeof(__pyx_k_nparams), 0, 0, 1, 1},
  {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
  {&__pyx_n_s_opts, __pyx_k_opts, sizeof(__pyx_k_opts), 0, 0, 1, 1},
  {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
  {&__pyx_n_s_param_formats, __pyx_k_param_formats, sizeof(__pyx_k_param_formats), 0, 0, 1, 1},
  {&__pyx_kp_u_param_formats_2, __pyx_k_param_formats_2, sizeof(__pyx_k_param_formats_2), 0, 1, 0, 0},
  {&__pyx_n_s_param_number, __pyx_k_param_number, sizeof(__pyx_k_param_number), 0, 0, 1, 1},
  {&__pyx_n_s_param_type, __pyx_k_param_type, sizeof(__pyx_k_param_type), 0, 0, 1, 1},
  {&__pyx_n_s_param_types, __pyx_k_param_types, sizeof(__pyx_k_param_types), 0, 0, 1, 1},
  {&__pyx_kp_u_param_types_2, __pyx_k_param_types_2, sizeof(__pyx_k_param_types_2), 0, 1, 0, 0},
  {&__pyx_n_s_param_values, __pyx_k_param_values, sizeof(__pyx_k_param_values), 0, 0, 1, 1},
  {&__pyx_kp_u_param_values_but, __pyx_k_param_values_but, sizeof(__pyx_k_param_values_but), 0, 1, 0, 0},
  {&__pyx_n_s_parameter_status, __pyx_k_parameter_status, sizeof(__pyx_k_parameter_status), 0, 0, 1, 1},
  {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1},
  {&__pyx_n_s_passwd, __pyx_k_passwd, sizeof(__pyx_k_passwd), 0, 0, 1, 1},
  {&__pyx_kp_u_password_encryption_failed, __pyx_k_password_encryption_failed, sizeof(__pyx_k_password_encryption_failed), 0, 1, 0, 0},
  {&__pyx_n_s_pgconn, __pyx_k_pgconn, sizeof(__pyx_k_pgconn), 0, 0, 1, 1},
  {&__pyx_n_s_pgresult, __pyx_k_pgresult, sizeof(__pyx_k_pgresult), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_ping, __pyx_k_ping, sizeof(__pyx_k_ping), 0, 0, 1, 1},
  {&__pyx_n_s_pipeline_sync, __pyx_k_pipeline_sync, sizeof(__pyx_k_pipeline_sync), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_prepare_2, __pyx_k_prepare_2, sizeof(__pyx_k_prepare_2), 0, 0, 1, 1},
  {&__pyx_n_s_psycopg, __pyx_k_psycopg, sizeof(__pyx_k_psycopg), 0, 0, 1, 1},
  {&__pyx_n_u_psycopg, __pyx_k_psycopg, sizeof(__pyx_k_psycopg), 0, 1, 0, 1},
  {&__pyx_n_s_psycopg_c_pq, __pyx_k_psycopg_c_pq, sizeof(__pyx_k_psycopg_c_pq), 0, 0, 1, 1},
  {&__pyx_kp_s_psycopg_c_pq_conninfo_pyx, __pyx_k_psycopg_c_pq_conninfo_pyx, sizeof(__pyx_k_psycopg_c_pq_conninfo_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_psycopg_c_pq_escaping_pyx, __pyx_k_psycopg_c_pq_escaping_pyx, sizeof(__pyx_k_psycopg_c_pq_escaping_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_psycopg_c_pq_pgcancel_pyx, __pyx_k_psycopg_c_pq_pgcancel_pyx, sizeof(__pyx_k_psycopg_c_pq_pgcancel_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_k_psycopg_c_pq_pgconn_pyx, sizeof(__pyx_k_psycopg_c_pq_pgconn_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_k_psycopg_c_pq_pgresult_pyx, sizeof(__pyx_k_psycopg_c_pq_pgresult_pyx), 0, 0, 1, 0},
  {&__pyx_kp_s_psycopg_c_pq_pyx, __pyx_k_psycopg_c_pq_pyx, sizeof(__pyx_k_psycopg_c_pq_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_psycopg_pq, __pyx_k_psycopg_pq, sizeof(__pyx_k_psycopg_pq), 0, 0, 1, 1},
  {&__pyx_n_s_psycopg_pq__enums, __pyx_k_psycopg_pq__enums, sizeof(__pyx_k_psycopg_pq__enums), 0, 0, 1, 1},
  {&__pyx_n_s_psycopg_pq_misc, __pyx_k_psycopg_pq_misc, sizeof(__pyx_k_psycopg_pq_misc), 0, 0, 1, 1},
  {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1},
  {&__pyx_n_s_put_copy_data, __pyx_k_put_copy_data, sizeof(__pyx_k_put_copy_data), 0, 0, 1, 1},
  {&__pyx_n_s_put_copy_end, __pyx_k_put_copy_end, sizeof(__pyx_k_put_copy_end), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_Escaping, __pyx_k_pyx_unpickle_Escaping, sizeof(__pyx_k_pyx_unpickle_Escaping), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_kp_u_receiving_copy_data_failed, __pyx_k_receiving_copy_data_failed, sizeof(__pyx_k_receiving_copy_data_failed), 0, 1, 0, 0},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
  {&__pyx_n_s_reset_poll, __pyx_k_reset_poll, sizeof(__pyx_k_reset_poll), 0, 0, 1, 1},
  {&__pyx_n_s_reset_start, __pyx_k_reset_start, sizeof(__pyx_k_reset_start), 0, 0, 1, 1},
  {&__pyx_n_s_result_format, __pyx_k_result_format, sizeof(__pyx_k_result_format), 0, 0, 1, 1},
  {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1},
  {&__pyx_n_s_row_number, __pyx_k_row_number, sizeof(__pyx_k_row_number), 0, 0, 1, 1},
  {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send_describe_portal, __pyx_k_send_describe_portal, sizeof(__pyx_k_send_describe_portal), 0, 0, 1, 1},
  {&__pyx_n_s_send_describe_prepared, __pyx_k_send_describe_prepared, sizeof(__pyx_k_send_describe_prepared), 0, 0, 1, 1},
  {&__pyx_n_s_send_flush_request, __pyx_k_send_flush_request, sizeof(__pyx_k_send_flush_request), 0, 0, 1, 1},
  {&__pyx_n_s_send_prepare, __pyx_k_send_prepare, sizeof(__pyx_k_send_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_send_query, __pyx_k_send_query, sizeof(__pyx_k_send_query), 0, 0, 1, 1},
  {&__pyx_n_s_send_query_params, __pyx_k_send_query_params, sizeof(__pyx_k_send_query_params), 0, 0, 1, 1},
  {&__pyx_n_s_send_query_prepared, __pyx_k_send_query_prepared, sizeof(__pyx_k_send_query_prepared), 0, 0, 1, 1},
  {&__pyx_kp_u_sending_copy_data_failed, __pyx_k_sending_copy_data_failed, sizeof(__pyx_k_sending_copy_data_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_sending_copy_end_failed, __pyx_k_sending_copy_end_failed, sizeof(__pyx_k_sending_copy_end_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_sending_describe_prepared_failed, __pyx_k_sending_describe_prepared_failed, sizeof(__pyx_k_sending_describe_prepared_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_sending_prepared_query_failed, __pyx_k_sending_prepared_query_failed, sizeof(__pyx_k_sending_prepared_query_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_sending_query_and_params_failed, __pyx_k_sending_query_and_params_failed, sizeof(__pyx_k_sending_query_and_params_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_sending_query_failed, __pyx_k_sending_query_failed, sizeof(__pyx_k_sending_query_failed), 0, 1, 0, 0},
  {&__pyx_n_s_set_attributes, __pyx_k_set_attributes, sizeof(__pyx_k_set_attributes), 0, 0, 1, 1},
  {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
  {&__pyx_n_s_set_single_row_mode, __pyx_k_set_single_row_mode, sizeof(__pyx_k_set_single_row_mode), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_kp_u_setting_nonblocking_failed, __pyx_k_setting_nonblocking_failed, sizeof(__pyx_k_setting_nonblocking_failed), 0, 1, 0, 0},
  {&__pyx_kp_u_setting_single_row_mode_failed, __pyx_k_setting_single_row_mode_failed, sizeof(__pyx_k_setting_single_row_mode_failed), 0, 1, 0, 0},
  {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
  {&__pyx_n_s_ssl, __pyx_k_ssl, sizeof(__pyx_k_ssl), 0, 0, 1, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_tableid, __pyx_k_tableid, sizeof(__pyx_k_tableid), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_kp_u_the_connection_is_closed, __pyx_k_the_connection_is_closed, sizeof(__pyx_k_the_connection_is_closed), 0, 1, 0, 0},
  {&__pyx_kp_u_the_connection_is_lost, __pyx_k_the_connection_is_lost, sizeof(__pyx_k_the_connection_is_lost), 0, 1, 0, 0},
  {&__pyx_n_s_typid, __pyx_k_typid, sizeof(__pyx_k_typid), 0, 0, 1, 1},
  {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
  {&__pyx_n_s_typlen, __pyx_k_typlen, sizeof(__pyx_k_typlen), 0, 0, 1, 1},
  {&__pyx_n_s_unescape_bytea, __pyx_k_unescape_bytea, sizeof(__pyx_k_unescape_bytea), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1},
  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
  {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_u_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 1, 0, 1},
  #endif
  {0, 0, 0, 0, 0, 0, 0}
};
/* #### Code section: cached_builtins ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 57, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 63, __pyx_L1_error)
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 141, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 295, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 668, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "psycopg_c/pq/pgconn.pyx":63
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 *         if not pgconn:
 *             raise MemoryError("couldn't allocate PGconn")             # <<<<<<<<<<<<<<
 * 
 *         return PGconn._from_ptr(pgconn)
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_couldn_t_allocate_PGconn); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "psycopg_c/pq/pgconn.pyx":95
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconninfo(self._pgconn_ptr)
 *         if opts is NULL:
 *             raise MemoryError("couldn't allocate connection info")             # <<<<<<<<<<<<<<
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_couldn_t_allocate_connection_inf); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "psycopg_c/pq/pgconn.pyx":213
 *             pgresult = libpq.PQexec(self._pgconn_ptr, command)
 *         if pgresult is NULL:
 *             raise MemoryError("couldn't allocate PGresult")             # <<<<<<<<<<<<<<
 * 
 *         return PGresult._from_ptr(pgresult)
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_couldn_t_allocate_PGresult); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "psycopg_c/pq/pgconn.pyx":536
 *             self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 *         if not rv:
 *             raise MemoryError("couldn't allocate empty PGresult")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(rv)
 * 
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_couldn_t_allocate_empty_PGresult); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "psycopg_c/pq/conninfo.pyx":15
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
 *         if opts is NULL :
 *             raise MemoryError("couldn't allocate connection defaults")             # <<<<<<<<<<<<<<
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_couldn_t_allocate_connection_def); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(5, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "psycopg_c/pq/conninfo.pyx":26
 *         if opts is NULL:
 *             if errmsg is NULL:
 *                 raise MemoryError("couldn't allocate on conninfo parse")             # <<<<<<<<<<<<<<
 *             else:
 *                 exc = e.OperationalError(errmsg.decode("utf8", "replace"))
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_couldn_t_allocate_on_conninfo_pa); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(5, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x0804127, 0x3908a35, 0x0c1d0e2):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0804127, 0x3908a35, 0x0c1d0e2) = (conn))" % __pyx_checksum
 */
  __pyx_tuple__21 = PyTuple_Pack(3, __pyx_int_8405287, __pyx_int_59804213, __pyx_int_12701922); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "psycopg_c/pq.pyx":17
 * 
 * 
 * def version():             # <<<<<<<<<<<<<<
 *     return libpq.PQlibVersion()
 * 
 */
  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pyx, __pyx_n_s_version, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(2, 17, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":32
 * from psycopg_c.pq cimport PQBuffer
 * 
 * logger = logging.getLogger('psycopg')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_u_psycopg); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "psycopg_c/pq/pgconn.pyx":59
 *         return f"<{cls} {info} at 0x{id(self):x}>"
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 */
  __pyx_tuple__25 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_conninfo, __pyx_n_s_conninfo, __pyx_n_s_pgconn); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);
  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_connect, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 59, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":67
 *         return PGconn._from_ptr(pgconn)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
 */
  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_connect_start, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 67, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":75
 *         return PGconn._from_ptr(pgconn)
 * 
 *     def connect_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);
  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_connect_poll, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 75, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":78
 *         return _call_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         if self._pgconn_ptr is not NULL:
 *             libpq.PQfinish(self._pgconn_ptr)
 */
  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_finish, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 78, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":100
 *         return rv
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         libpq.PQreset(self._pgconn_ptr)
 */
  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_reset, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 100, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":104
 *         libpq.PQreset(self._pgconn_ptr)
 * 
 *     def reset_start(self) -> None:             # <<<<<<<<<<<<<<
 *         if not libpq.PQresetStart(self._pgconn_ptr):
 *             raise e.OperationalError("couldn't reset connection")
 */
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_reset_start, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 104, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":108
 *             raise e.OperationalError("couldn't reset connection")
 * 
 *     def reset_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 */
  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_reset_poll, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 108, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":111
 *         return _call_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def ping(self, const char *conninfo) -> int:
 *         return libpq.PQping(conninfo)
 */
  __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_conninfo, __pyx_n_s_conninfo); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);
  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_ping, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 111, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":164
 *         return libpq.PQtransactionStatus(self._pgconn_ptr)
 * 
 *     def parameter_status(self, const char *name) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef const char *rv = libpq.PQparameterStatus(self._pgconn_ptr, name)
 */
  __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_name, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);
  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_parameter_status, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 164, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":207
 *         return bool(_call_int(self, <conn_int_f>libpq.PQsslInUse))
 * 
 *     def exec_(self, const char *command) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *pgresult
 */
  __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_command, __pyx_n_s_command, __pyx_n_s_pgresult); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);
  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_exec, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 207, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":217
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query(self, const char *command) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv
 */
  __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_command, __pyx_n_s_command, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_send_query, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 217, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":225
 *             raise e.OperationalError(f"sending query failed: {error_message(self)}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
 */
  __pyx_tuple__42 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_command, __pyx_n_s_param_values, __pyx_n_s_param_types, __pyx_n_s_param_formats, __pyx_n_s_result_format, __pyx_n_s_cnparams, __pyx_n_s_ctypes, __pyx_n_s_cvalues, __pyx_n_s_clengths, __pyx_n_s_cformats, __pyx_n_s_pgresult); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_exec_params, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 225, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":253
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
 */
  __pyx_tuple__44 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_command, __pyx_n_s_param_values, __pyx_n_s_param_types, __pyx_n_s_param_formats, __pyx_n_s_result_format, __pyx_n_s_cnparams, __pyx_n_s_ctypes, __pyx_n_s_cvalues, __pyx_n_s_clengths, __pyx_n_s_cformats, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);
  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_send_query_params, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 253, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":282
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */
  __pyx_tuple__46 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_command, __pyx_n_s_param_types, __pyx_n_s_i, __pyx_n_s_nparams, __pyx_n_s_atypes, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_send_prepare, 282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 282, __pyx_L1_error)
  __pyx_tuple__48 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "psycopg_c/pq/pgconn.pyx":309
 *             )
 * 
 *     def send_query_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */
  __pyx_tuple__49 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_param_values, __pyx_n_s_param_formats, __pyx_n_s_result_format, __pyx_n_s_cnparams, __pyx_n_s_ctypes, __pyx_n_s_cvalues, __pyx_n_s_clengths, __pyx_n_s_cformats, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_send_query_prepared, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 309, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":337
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_prepare, 337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 337, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":362
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */
  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_exec_prepared, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 362, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":391
 *         return PGresult._from_ptr(rv)
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)
 */
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_describe_prepared, 391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 391, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":398
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePrepared(self._pgconn_ptr, name)
 */
  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_send_describe_prepared, 398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 398, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":406
 *             )
 * 
 *     def describe_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
 */
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_describe_portal, 406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 406, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":413
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePortal(self._pgconn_ptr, name)
 */
  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_send_describe_portal, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 413, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":421
 *             )
 * 
 *     def get_result(self) -> Optional["PGresult"]:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
 */
  __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pgresult); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);
  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_get_result, 421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 421, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":427
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):
 *             raise e.OperationalError(f"consuming input failed: {error_message(self)}")
 */
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_consume_input, 427, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 427, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":431
 *             raise e.OperationalError(f"consuming input failed: {error_message(self)}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with nogil:
 */
  __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_is_busy, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 431, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":446
 *             raise e.OperationalError(f"setting nonblocking failed: {error_message(self)}")
 * 
 *     def flush(self) -> int:             # <<<<<<<<<<<<<<
 *         if self._pgconn_ptr == NULL:
 *             raise e.OperationalError(f"flushing failed: the connection is closed")
 */
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_flush, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 446, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":454
 *         return rv
 * 
 *     def set_single_row_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         if not libpq.PQsetSingleRowMode(self._pgconn_ptr):
 *             raise e.OperationalError("setting single row mode failed")
 */
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_set_single_row_mode, 454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 454, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":458
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def get_cancel(self) -> PGcancel:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancel *ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:
 */
  __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ptr); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_get_cancel, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 458, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":464
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with nogil:
 */
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_notifies, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 464, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":475
 *             return None
 * 
 *     def put_copy_data(self, buffer) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef char *cbuffer
 */
  __pyx_tuple__67 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_buffer, __pyx_n_s_rv, __pyx_n_s_cbuffer, __pyx_n_s_length); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_put_copy_data, 475, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 475, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":486
 *         return rv
 * 
 *     def put_copy_end(self, error: Optional[bytes] = None) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef const char *cerr = NULL
 */
  __pyx_tuple__69 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_error, __pyx_n_s_rv, __pyx_n_s_cerr); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_put_copy_end, 486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 486, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":496
 *         return rv
 * 
 *     def get_copy_data(self, int async_) -> Tuple[int, memoryview]:             # <<<<<<<<<<<<<<
 *         cdef char *buffer_ptr = NULL
 *         cdef int nbytes
 */
  __pyx_tuple__71 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_async, __pyx_n_s_async, __pyx_n_s_buffer_ptr, __pyx_n_s_nbytes, __pyx_n_s_data); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_get_copy_data, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 496, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":509
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
 */
  __pyx_tuple__73 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_passwd, __pyx_n_s_user, __pyx_n_s_algorithm, __pyx_n_s_out, __pyx_n_s_calgo, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_encrypt_password, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 509, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":532
 *         return rv
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = libpq.PQmakeEmptyPGresult(
 *             self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 */
  __pyx_tuple__75 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exec_status, __pyx_n_s_exec_status, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);
  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_make_empty_result, 532, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 532, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":550
 *         return status
 * 
 *     def enter_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enter pipeline mode.
 * 
 */
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_enter_pipeline_mode, 550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 550, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":564
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
 *     def exit_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Exit pipeline mode.
 * 
 */
  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_exit_pipeline_mode, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 564, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":578
 *             raise e.OperationalError(error_message(self))
 * 
 *     def pipeline_sync(self) -> None:             # <<<<<<<<<<<<<<
 *         """Mark a synchronization point in a pipeline.
 * 
 */
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_pipeline_sync, 578, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 578, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":595
 *             raise e.OperationalError("failed to sync pipeline")
 * 
 *     def send_flush_request(self) -> None:             # <<<<<<<<<<<<<<
 *         """Sends a request for the server to flush its output buffer.
 * 
 */
  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgconn_pyx, __pyx_n_s_send_flush_request, 595, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 595, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_tuple__82 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":33
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"
 * 
 *     def clear(self) -> None:             # <<<<<<<<<<<<<<
 *         if self._pgresult_ptr is not NULL:
 *             libpq.PQclear(self._pgresult_ptr)
 */
  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_clear, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(3, 33, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":53
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 * 
 *     def error_field(self, int fieldcode) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:
 */
  __pyx_tuple__85 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_fieldcode, __pyx_n_s_fieldcode, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);
  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_error_field, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(3, 53, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":68
 *         return libpq.PQnfields(self._pgresult_ptr)
 * 
 *     def fname(self, int column_number) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:
 */
  __pyx_tuple__87 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_column_number, __pyx_n_s_column_number, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(3, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);
  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_fname, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(3, 68, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":75
 *             return None
 * 
 *     def ftable(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_tuple__89 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_column_number, __pyx_n_s_column_number); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);
  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_ftable, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(3, 75, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":78
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
 *     def ftablecol(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_ftablecol, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(3, 78, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":81
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
 *     def fformat(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_fformat, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(3, 81, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":84
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
 *     def ftype(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_ftype, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(3, 84, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":87
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
 *     def fmod(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_fmod, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(3, 87, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":90
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
 *     def fsize(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_fsize, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(3, 90, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":97
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 * 
 *     def get_value(self, int row_number, int column_number) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef int crow = row_number
 *         cdef int ccol = column_number
 */
  __pyx_tuple__96 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_row_number, __pyx_n_s_column_number, __pyx_n_s_crow, __pyx_n_s_ccol, __pyx_n_s_length, __pyx_n_s_v); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(3, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_get_value, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(3, 97, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":116
 *         return libpq.PQnparams(self._pgresult_ptr)
 * 
 *     def param_type(self, int param_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
 */
  __pyx_tuple__98 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_param_number, __pyx_n_s_param_number); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(3, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_param_type, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(3, 116, __pyx_L1_error)

  /* "psycopg_c/pq/pgresult.pyx":139
 *         return libpq.PQoidValue(self._pgresult_ptr)
 * 
 *     def set_attributes(self, descriptions: List[PGresAttDesc]):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t num = len(descriptions)
 *         cdef libpq.PGresAttDesc *attrs = <libpq.PGresAttDesc *>PyMem_Malloc(
 */
  __pyx_tuple__100 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_descriptions, __pyx_n_s_num, __pyx_n_s_attrs, __pyx_n_s_i, __pyx_n_s_descr, __pyx_n_s_res); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(3, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgresult_pyx, __pyx_n_s_set_attributes, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(3, 139, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "psycopg_c/pq/pgcancel.pyx":21
 *         self.free()
 * 
 *     def free(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
 */
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgcancel_pyx, __pyx_n_s_free, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(4, 21, __pyx_L1_error)

  /* "psycopg_c/pq/pgcancel.pyx":26
 *             self.pgcancel_ptr = NULL
 * 
 *     def cancel(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
 */
  __pyx_tuple__105 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_buf, __pyx_n_s_res); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_pgcancel_pyx, __pyx_n_s_cancel, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(4, 26, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "psycopg_c/pq/conninfo.pyx":11
 * 
 * class Conninfo:
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_defaults(cls) -> List[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
 */
  __pyx_tuple__109 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_opts, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_conninfo_pyx, __pyx_n_s_get_defaults, 11, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(5, 11, __pyx_L1_error)

  /* "psycopg_c/pq/conninfo.pyx":20
 *         return rv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(cls, const char *conninfo) -> List[ConninfoOption]:
 *         cdef char *errmsg = NULL
 */
  __pyx_tuple__111 = PyTuple_Pack(6, __pyx_n_s_cls, __pyx_n_s_conninfo, __pyx_n_s_errmsg, __pyx_n_s_opts, __pyx_n_s_exc, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_conninfo_pyx, __pyx_n_s_parse, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(5, 20, __pyx_L1_error)

  /* "psycopg_c/pq/conninfo.pyx":36
 *         return rv
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"
 * 
 */
  __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_conninfo_pyx, __pyx_n_s_repr, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(5, 36, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":17
 *         self.conn = conn
 * 
 *     cpdef escape_literal(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef bytes rv
 */
  __pyx_tuple__114 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(6, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_escaping_pyx, __pyx_n_s_escape_literal, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(6, 17, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":40
 *         )
 * 
 *     cpdef escape_identifier(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
 */
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_escaping_pyx, __pyx_n_s_escape_identifier, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(6, 40, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":62
 *         )
 * 
 *     cpdef escape_string(self, data):             # <<<<<<<<<<<<<<
 *         cdef int error
 *         cdef size_t len_out
 */
  __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_escaping_pyx, __pyx_n_s_escape_string, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(6, 62, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":94
 *         return PyMemoryView_FromObject(rv)
 * 
 *     cpdef escape_bytea(self, data):             # <<<<<<<<<<<<<<
 *         cdef size_t len_out
 *         cdef unsigned char *out
 */
  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_escaping_pyx, __pyx_n_s_escape_bytea, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(6, 94, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":120
 *         )
 * 
 *     cpdef unescape_bytea(self, const unsigned char *data):             # <<<<<<<<<<<<<<
 *         # not needed, but let's keep it symmetric with the escaping:
 *         # if a connection is passed in, it must be valid.
 */
  __pyx_tuple__119 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_data); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(6, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_psycopg_c_pq_escaping_pyx, __pyx_n_s_unescape_bytea, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(6, 120, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_tuple__121 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Escaping__set_state(self, __pyx_state)
 */
  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(1, 16, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle_Escaping(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__128 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);
  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Escaping, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
  #if CYTHON_USE_MODULE_STATE
  if (__Pyx_InitString(__pyx_string_tab[0], &__pyx_kp_u_) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[1], &__pyx_n_s_AssertionError) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[2], &__pyx_n_s_Conninfo) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[3], &__pyx_n_s_ConninfoOption) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[4], &__pyx_n_s_Conninfo___repr) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[5], &__pyx_n_s_Conninfo_get_defaults) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[6], &__pyx_n_s_Conninfo_parse) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[7], &__pyx_n_s_Escaping) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[8], &__pyx_n_s_Escaping___reduce_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[9], &__pyx_n_s_Escaping___setstate_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[10], &__pyx_n_s_Escaping_escape_bytea) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[11], &__pyx_n_s_Escaping_escape_identifier) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[12], &__pyx_n_s_Escaping_escape_literal) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[13], &__pyx_n_s_Escaping_escape_string) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[14], &__pyx_n_s_Escaping_unescape_bytea) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[15], &__pyx_n_s_ExecStatus) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[16], &__pyx_n_s_Format) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[17], &__pyx_kp_s_Incompatible_checksums_0x_x_vs_0) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[18], &__pyx_n_s_Iterator) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[19], &__pyx_kp_s_List_ConninfoOption) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[20], &__pyx_kp_s_List_PGresAttDesc) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[21], &__pyx_n_s_MemoryError) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[22], &__pyx_n_s_None) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[23], &__pyx_n_s_NotSupportedError) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[24], &__pyx_n_s_OperationalError) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[25], &__pyx_kp_s_Optional_PGresult) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[26], &__pyx_kp_s_Optional_Sequence_Optional_bytes) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[27], &__pyx_kp_s_Optional_Sequence_bytes) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[28], &__pyx_kp_s_Optional_Sequence_int) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[29], &__pyx_kp_s_Optional_bytes) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[30], &__pyx_n_s_PGcancel) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[31], &__pyx_n_s_PGcancel___reduce_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[32], &__pyx_n_s_PGcancel___setstate_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[33], &__pyx_n_s_PGcancel_cancel) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[34], &__pyx_n_s_PGcancel_free) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[35], &__pyx_n_s_PGconn) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[36], &__pyx_n_s_PGconn___reduce_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[37], &__pyx_n_s_PGconn___setstate_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[38], &__pyx_n_s_PGconn_connect) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[39], &__pyx_n_s_PGconn_connect_poll) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[40], &__pyx_n_s_PGconn_connect_start) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[41], &__pyx_n_s_PGconn_consume_input) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[42], &__pyx_n_s_PGconn_describe_portal) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[43], &__pyx_n_s_PGconn_describe_prepared) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[44], &__pyx_n_s_PGconn_encrypt_password) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[45], &__pyx_n_s_PGconn_enter_pipeline_mode) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[46], &__pyx_n_s_PGconn_exec) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[47], &__pyx_n_s_PGconn_exec_params) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[48], &__pyx_n_s_PGconn_exec_prepared) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[49], &__pyx_n_s_PGconn_exit_pipeline_mode) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[50], &__pyx_n_s_PGconn_finish) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[51], &__pyx_n_s_PGconn_flush) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[52], &__pyx_n_s_PGconn_get_cancel) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[53], &__pyx_n_s_PGconn_get_copy_data) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[54], &__pyx_n_s_PGconn_get_result) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[55], &__pyx_n_s_PGconn_is_busy) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[56], &__pyx_n_s_PGconn_make_empty_result) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[57], &__pyx_n_s_PGconn_notifies) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[58], &__pyx_n_s_PGconn_parameter_status) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[59], &__pyx_n_s_PGconn_ping) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[60], &__pyx_n_s_PGconn_pipeline_sync) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[61], &__pyx_n_s_PGconn_prepare) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[62], &__pyx_n_s_PGconn_put_copy_data) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[63], &__pyx_n_s_PGconn_put_copy_end) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[64], &__pyx_n_s_PGconn_reset) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[65], &__pyx_n_s_PGconn_reset_poll) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[66], &__pyx_n_s_PGconn_reset_start) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[67], &__pyx_n_s_PGconn_send_describe_portal) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[68], &__pyx_n_s_PGconn_send_describe_prepared) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[69], &__pyx_n_s_PGconn_send_flush_request) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[70], &__pyx_n_s_PGconn_send_prepare) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[71], &__pyx_n_s_PGconn_send_query) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[72], &__pyx_n_s_PGconn_send_query_params) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[73], &__pyx_n_s_PGconn_send_query_prepared) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[74], &__pyx_n_s_PGconn_set_single_row_mode) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[75], &__pyx_n_s_PGnotify) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[76], &__pyx_n_s_PGresAttDesc) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[77], &__pyx_n_s_PGresult) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[78], &__pyx_n_s_PGresult___reduce_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[79], &__pyx_n_s_PGresult___setstate_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[80], &__pyx_n_s_PGresult_clear) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[81], &__pyx_n_s_PGresult_error_field) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[82], &__pyx_n_s_PGresult_fformat) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[83], &__pyx_n_s_PGresult_fmod) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[84], &__pyx_n_s_PGresult_fname) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[85], &__pyx_n_s_PGresult_fsize) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[86], &__pyx_n_s_PGresult_ftable) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[87], &__pyx_n_s_PGresult_ftablecol) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[88], &__pyx_n_s_PGresult_ftype) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[89], &__pyx_n_s_PGresult_get_value) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[90], &__pyx_n_s_PGresult_param_type) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[91], &__pyx_n_s_PGresult_set_attributes) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[92], &__pyx_n_s_PQBuffer) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[93], &__pyx_n_s_PQBuffer___reduce_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[94], &__pyx_n_s_PQBuffer___setstate_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[95], &__pyx_kp_u_PQencryptPasswordConn_requires_l) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[96], &__pyx_kp_u_PQenterPipelineMode_requires_lib) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[97], &__pyx_kp_u_PQexitPipelineMode_requires_libp) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[98], &__pyx_kp_u_PQhostaddr_requires_libpq_from_P) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[99], &__pyx_kp_u_PQpipelineSync_requires_libpq_fr) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[100], &__pyx_kp_u_PQsendFlushRequest_requires_libp) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[101], &__pyx_kp_u_PQsetResultAttrs_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[102], &__pyx_n_s_PickleError) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[103], &__pyx_n_s_PipelineStatus) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[104], &__pyx_n_s_PqFormat) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[105], &__pyx_n_s_TEXT) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[106], &__pyx_kp_s_Tuple_int_memoryview) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[107], &__pyx_n_s_TypeError) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[108], &__pyx_n_s_ValueError) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[109], &__pyx_n_s_ViewBuffer) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[110], &__pyx_n_s_ViewBuffer___reduce_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[111], &__pyx_n_s_ViewBuffer___setstate_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[112], &__pyx_kp_b__12) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[113], &__pyx_n_s__130) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[114], &__pyx_kp_u__14) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[115], &__pyx_kp_u__17) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[116], &__pyx_kp_u__18) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[117], &__pyx_kp_u__19) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[118], &__pyx_kp_u__2) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[119], &__pyx_kp_u__20) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[120], &__pyx_n_s__23) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[121], &__pyx_kp_u__3) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[122], &__pyx_kp_u__4) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[123], &__pyx_n_s_algorithm) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[124], &__pyx_n_u_ascii) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[125], &__pyx_n_s_async) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[126], &__pyx_n_s_asyncio_coroutines) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[127], &__pyx_kp_u_at_0x) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[128], &__pyx_kp_u_at_0x_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[129], &__pyx_n_s_attrs) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[130], &__pyx_n_s_atttypmod) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[131], &__pyx_n_s_atypes) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[132], &__pyx_kp_u_available_instead) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[133], &__pyx_n_s_buf) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[134], &__pyx_n_s_buffer) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[135], &__pyx_n_s_buffer_ptr) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[136], &__pyx_n_s_build_version) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[137], &__pyx_kp_u_bytes) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[138], &__pyx_n_s_bytes_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[139], &__pyx_kp_u_bytes_or_buffer_expected_got) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[140], &__pyx_n_u_c) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[141], &__pyx_n_s_calgo) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[142], &__pyx_n_s_cancel) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[143], &__pyx_kp_u_cancel_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[144], &__pyx_n_s_cbuffer) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[145], &__pyx_n_s_ccol) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[146], &__pyx_n_s_cerr) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[147], &__pyx_n_s_cformats) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[148], &__pyx_n_s_class) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[149], &__pyx_n_s_clear) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[150], &__pyx_n_s_clengths) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[151], &__pyx_n_s_cline_in_traceback) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[152], &__pyx_n_s_cls) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[153], &__pyx_n_s_cnparams) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[154], &__pyx_n_s_column_number) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[155], &__pyx_n_s_columnid) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[156], &__pyx_n_s_command) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[157], &__pyx_n_s_compiled) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[158], &__pyx_n_s_conn) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[159], &__pyx_n_s_connect) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[160], &__pyx_n_s_connect_poll) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[161], &__pyx_n_s_connect_start) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[162], &__pyx_kp_u_connection_not_in_pipeline_mode) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[163], &__pyx_n_s_connection_summary) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[164], &__pyx_n_s_conninfo) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[165], &__pyx_n_s_consume_input) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[166], &__pyx_kp_u_consuming_input_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[167], &__pyx_kp_u_couldn_t_allocate_PGconn) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[168], &__pyx_kp_u_couldn_t_allocate_PGresult) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[169], &__pyx_kp_u_couldn_t_allocate_connection_def) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[170], &__pyx_kp_u_couldn_t_allocate_connection_inf) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[171], &__pyx_kp_u_couldn_t_allocate_empty_PGresult) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[172], &__pyx_kp_u_couldn_t_allocate_for_escape_byt) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[173], &__pyx_kp_u_couldn_t_allocate_for_unescape_b) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[174], &__pyx_kp_u_couldn_t_allocate_on_conninfo_pa) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[175], &__pyx_kp_u_couldn_t_create_cancel_object) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[176], &__pyx_kp_u_couldn_t_reset_connection) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[177], &__pyx_n_s_crow) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[178], &__pyx_n_s_ctypes) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[179], &__pyx_n_s_cvalues) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[180], &__pyx_n_u_d) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[181], &__pyx_n_s_data) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[182], &__pyx_n_s_decode) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[183], &__pyx_n_s_descr) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[184], &__pyx_n_s_describe_portal) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[185], &__pyx_n_s_describe_prepared) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[186], &__pyx_n_s_descriptions) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[187], &__pyx_n_s_dict) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[188], &__pyx_n_s_dict_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[189], &__pyx_kp_u_disable) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[190], &__pyx_n_s_dispchar) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[191], &__pyx_n_s_dispsize) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[192], &__pyx_n_s_doc) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[193], &__pyx_n_s_e) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[194], &__pyx_kp_u_enable) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[195], &__pyx_n_s_encrypt_password) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[196], &__pyx_n_s_enter_pipeline_mode) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[197], &__pyx_n_s_envvar) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[198], &__pyx_n_s_errmsg) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[199], &__pyx_n_s_error) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[200], &__pyx_n_s_error_field) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[201], &__pyx_kp_u_error_in_notice_receiver_s) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[202], &__pyx_n_s_error_message) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[203], &__pyx_n_s_errors) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[204], &__pyx_n_s_escape_bytea) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[205], &__pyx_n_s_escape_identifier) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[206], &__pyx_kp_u_escape_identifier_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[207], &__pyx_kp_u_escape_identifier_failed_no_conn) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[208], &__pyx_n_s_escape_literal) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[209], &__pyx_kp_u_escape_literal_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[210], &__pyx_kp_u_escape_literal_failed_no_connect) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[211], &__pyx_n_s_escape_string) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[212], &__pyx_kp_u_escape_string_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[213], &__pyx_n_s_exc) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[214], &__pyx_n_s_exception) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[215], &__pyx_n_s_exec) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[216], &__pyx_n_s_exec_params) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[217], &__pyx_n_s_exec_prepared) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[218], &__pyx_n_s_exec_status) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[219], &__pyx_n_s_exit_pipeline_mode) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[220], &__pyx_kp_u_failed_to_enter_pipeline_mode) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[221], &__pyx_kp_u_failed_to_sync_pipeline) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[222], &__pyx_n_s_fformat) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[223], &__pyx_n_s_fieldcode) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[224], &__pyx_n_s_finish) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[225], &__pyx_n_s_flush) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[226], &__pyx_kp_u_flush_request_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[227], &__pyx_kp_u_flushing_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[228], &__pyx_kp_u_flushing_failed_the_connection_i) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[229], &__pyx_n_s_fmod) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[230], &__pyx_n_s_fname) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[231], &__pyx_n_s_format) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[232], &__pyx_n_s_free) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[233], &__pyx_n_s_fsize) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[234], &__pyx_n_s_ftable) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[235], &__pyx_n_s_ftablecol) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[236], &__pyx_n_s_ftype) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[237], &__pyx_kp_u_gc) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[238], &__pyx_n_s_getLogger) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[239], &__pyx_n_s_get_cancel) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[240], &__pyx_n_s_get_copy_data) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[241], &__pyx_n_s_get_defaults) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[242], &__pyx_n_s_get_result) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[243], &__pyx_n_s_get_value) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[244], &__pyx_n_s_getstate) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[245], &__pyx_kp_u_got) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[246], &__pyx_n_s_i) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[247], &__pyx_n_s_id) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[248], &__pyx_n_s_impl) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[249], &__pyx_n_s_import) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[250], &__pyx_n_s_init_subclass) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[251], &__pyx_n_s_initializing) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[252], &__pyx_n_s_int) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[253], &__pyx_n_s_is_busy) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[254], &__pyx_n_s_is_coroutine) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[255], &__pyx_kp_u_isenabled) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[256], &__pyx_n_s_keyword) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[257], &__pyx_n_s_label) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[258], &__pyx_n_s_length) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[259], &__pyx_n_s_logger) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[260], &__pyx_n_s_logging) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[261], &__pyx_n_s_main) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[262], &__pyx_n_s_make_empty_result) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[263], &__pyx_n_s_metaclass) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[264], &__pyx_n_s_module) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[265], &__pyx_n_s_name) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[266], &__pyx_n_s_name_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[267], &__pyx_n_s_nbytes) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[268], &__pyx_n_s_new) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[269], &__pyx_kp_s_no_default___reduce___due_to_non) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[270], &__pyx_n_s_notifies) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[271], &__pyx_n_s_nparams) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[272], &__pyx_n_s_num) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[273], &__pyx_n_s_opts) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[274], &__pyx_n_s_out) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[275], &__pyx_n_s_param_formats) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[276], &__pyx_kp_u_param_formats_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[277], &__pyx_n_s_param_number) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[278], &__pyx_n_s_param_type) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[279], &__pyx_n_s_param_types) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[280], &__pyx_kp_u_param_types_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[281], &__pyx_n_s_param_values) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[282], &__pyx_kp_u_param_values_but) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[283], &__pyx_n_s_parameter_status) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[284], &__pyx_n_s_parse) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[285], &__pyx_n_s_passwd) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[286], &__pyx_kp_u_password_encryption_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[287], &__pyx_n_s_pgconn) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[288], &__pyx_n_s_pgresult) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[289], &__pyx_n_s_pickle) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[290], &__pyx_n_s_ping) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[291], &__pyx_n_s_pipeline_sync) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[292], &__pyx_n_s_prepare) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[293], &__pyx_n_s_prepare_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[294], &__pyx_n_s_psycopg) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[295], &__pyx_n_u_psycopg) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[296], &__pyx_n_s_psycopg_c_pq) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[297], &__pyx_kp_s_psycopg_c_pq_conninfo_pyx) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[298], &__pyx_kp_s_psycopg_c_pq_escaping_pyx) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[299], &__pyx_kp_s_psycopg_c_pq_pgcancel_pyx) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[300], &__pyx_kp_s_psycopg_c_pq_pgconn_pyx) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[301], &__pyx_kp_s_psycopg_c_pq_pgresult_pyx) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[302], &__pyx_kp_s_psycopg_c_pq_pyx) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[303], &__pyx_n_s_psycopg_pq) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[304], &__pyx_n_s_psycopg_pq__enums) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[305], &__pyx_n_s_psycopg_pq_misc) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[306], &__pyx_n_s_ptr) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[307], &__pyx_n_s_put_copy_data) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[308], &__pyx_n_s_put_copy_end) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[309], &__pyx_n_s_pyx_PickleError) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[310], &__pyx_n_s_pyx_checksum) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[311], &__pyx_n_s_pyx_result) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[312], &__pyx_n_s_pyx_state) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[313], &__pyx_n_s_pyx_type) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[314], &__pyx_n_s_pyx_unpickle_Escaping) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[315], &__pyx_n_s_pyx_vtable) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[316], &__pyx_n_s_qualname) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[317], &__pyx_n_s_range) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[318], &__pyx_kp_u_receiving_copy_data_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[319], &__pyx_n_s_reduce) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[320], &__pyx_n_s_reduce_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[321], &__pyx_n_s_reduce_ex) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[322], &__pyx_n_s_repr) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[323], &__pyx_n_s_res) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[324], &__pyx_n_s_reset) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[325], &__pyx_n_s_reset_poll) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[326], &__pyx_n_s_reset_start) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[327], &__pyx_n_s_result_format) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[328], &__pyx_n_s_return) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[329], &__pyx_n_s_row_number) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[330], &__pyx_n_s_rv) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[331], &__pyx_n_s_self) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[332], &__pyx_n_s_send_describe_portal) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[333], &__pyx_n_s_send_describe_prepared) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[334], &__pyx_n_s_send_flush_request) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[335], &__pyx_n_s_send_prepare) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[336], &__pyx_n_s_send_query) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[337], &__pyx_n_s_send_query_params) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[338], &__pyx_n_s_send_query_prepared) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[339], &__pyx_kp_u_sending_copy_data_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[340], &__pyx_kp_u_sending_copy_end_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[341], &__pyx_kp_u_sending_describe_prepared_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[342], &__pyx_kp_u_sending_prepared_query_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[343], &__pyx_kp_u_sending_query_and_params_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[344], &__pyx_kp_u_sending_query_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[345], &__pyx_n_s_set_attributes) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[346], &__pyx_n_s_set_name) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[347], &__pyx_n_s_set_single_row_mode) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[348], &__pyx_n_s_setstate) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[349], &__pyx_n_s_setstate_cython) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[350], &__pyx_kp_u_setting_nonblocking_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[351], &__pyx_kp_u_setting_single_row_mode_failed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[352], &__pyx_n_s_spec) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[353], &__pyx_n_s_ssl) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[354], &__pyx_n_s_state) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[355], &__pyx_n_s_status) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[356], &__pyx_kp_s_stringsource) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[357], &__pyx_n_s_super) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[358], &__pyx_n_s_tableid) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[359], &__pyx_n_s_test) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[360], &__pyx_kp_u_the_connection_is_closed) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[361], &__pyx_kp_u_the_connection_is_lost) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[362], &__pyx_n_s_typid) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[363], &__pyx_n_s_typing) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[364], &__pyx_n_s_typlen) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[365], &__pyx_n_s_unescape_bytea) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[366], &__pyx_n_s_update) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[367], &__pyx_n_s_use_setstate) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[368], &__pyx_n_s_user) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[369], &__pyx_n_s_v) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[370], &__pyx_n_s_val) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[371], &__pyx_n_s_version) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[372], &__pyx_n_u_x) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  #endif
  __pyx_int_8405287 = PyInt_FromLong(8405287L); if (unlikely(!__pyx_int_8405287)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_int_12701922 = PyInt_FromLong(12701922L); if (unlikely(!__pyx_int_12701922)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_int_59804213 = PyInt_FromLong(59804213L); if (unlikely(!__pyx_int_59804213)) __PYX_ERR(2, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_globals ### */

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  return 0;
}
/* #### Code section: init_module ### */

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("_buffer_as_string_and_size", (void (*)(void))__pyx_f_9psycopg_c_2pq__buffer_as_string_and_size, "int (PyObject *, char **, Py_ssize_t *)") < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_9psycopg_c_2pq_PGconn = &__pyx_vtable_9psycopg_c_2pq_PGconn;
  __pyx_vtable_9psycopg_c_2pq_PGconn._from_ptr = (struct __pyx_obj_9psycopg_c_2pq_PGconn *(*)(PGconn *))__pyx_f_9psycopg_c_2pq_6PGconn__from_ptr;
  __pyx_vtable_9psycopg_c_2pq_PGconn.notifies = (PyObject *(*)(struct __pyx_obj_9psycopg_c_2pq_PGconn *, int __pyx_skip_dispatch))__pyx_f_9psycopg_c_2pq_6PGconn_notifies;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_9psycopg_c_2pq_PGconn = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_PGconn_spec, NULL); if (unlikely(!__pyx_ptype_9psycopg_c_2pq_PGconn)) __PYX_ERR(0, 35, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_PGconn_spec, __pyx_ptype_9psycopg_c_2pq_PGconn) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  #else
  __pyx_ptype_9psycopg_c_2pq_PGconn = &__pyx_type_9psycopg_c_2pq_PGconn;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_9psycopg_c_2pq_PGconn) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_9psycopg_c_2pq_PGconn->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dictoffset && __pyx_ptype_9psycopg_c_2pq_PGconn->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_9psycopg_c_2pq_PGconn->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_vtabptr_9psycopg_c_2pq_PGconn) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_9psycopg_c_2pq_PGconn) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PGconn, (PyObject *) __pyx_ptype_9psycopg_c_2pq_PGconn) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  if (__pyx_ptype_9psycopg_c_2pq_PGconn->tp_weaklistoffset == 0) __pyx_ptype_9psycopg_c_2pq_PGconn->tp_weaklistoffset = offsetof(struct __pyx_obj_9psycopg_c_2pq_PGconn, __weakref__);
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_9psycopg_c_2pq_PGconn) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  #endif
  __pyx_vtabptr_9psycopg_c_2pq_PGresult = &__pyx_vtable_9psycopg_c_2pq_PGresult;
  __pyx_vtable_9psycopg_c_2pq_PGresult._from_ptr = (struct __pyx_obj_9psycopg_c_2pq_PGresult *(*)(PGresult *))__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_9psycopg_c_2pq_PGresult = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_PGresult_spec, NULL); if (unlikely(!__pyx_ptype_9psycopg_c_2pq_PGresult)) __PYX_ERR(3, 15, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_PGresult_spec, __pyx_ptype_9psycopg_c_2pq_PGresult) < 0) __PYX_ERR(3, 15, __pyx_L1_error)
  #else
  __pyx_ptype_9psycopg_c_2pq_PGresult = &__pyx_type_9psycopg_c_2pq_PGresult;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_9psycopg_c_2pq_PGresult) < 0) __PYX_ERR(3, 15, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_9psycopg_c_2pq_PGresult->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dictoffset && __pyx_ptype_9psycopg_c_2pq_PGresult->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_9psycopg_c_2pq_PGresult->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_vtabptr_9psycopg_c_2pq_PGresult) < 0) __PYX_ERR(3, 15, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_9psycopg_c_2pq_PGresult) < 0) __PYX_ERR(3, 15, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PGresult, (PyObject *) __pyx_ptype_9psycopg_c_2pq_PGresult) < 0) __PYX_ERR(3, 15, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_9psycopg_c_2pq_PGresult) < 0) __PYX_ERR(3, 15, __pyx_L1_error)
  #endif
  __pyx_vtabptr_9psycopg_c_2pq_PGcancel = &__pyx_vtable_9psycopg_c_2pq_PGcancel;
  __pyx_vtable_9psycopg_c_2pq_PGcancel._from_ptr = (struct __pyx_obj_9psycopg_c_2pq_PGcancel *(*)(PGcancel *))__pyx_f_9psycopg_c_2pq_8PGcancel__from_ptr;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_9psycopg_c_2pq_PGcancel = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_PGcancel_spec, NULL); if (unlikely(!__pyx_ptype_9psycopg_c_2pq_PGcancel)) __PYX_ERR(4, 8, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_PGcancel_spec, __pyx_ptype_9psycopg_c_2pq_PGcancel) < 0) __PYX_ERR(4, 8, __pyx_L1_error)
  #else
  __pyx_ptype_9psycopg_c_2pq_PGcancel = &__pyx_type_9psycopg_c_2pq_PGcancel;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_9psycopg_c_2pq_PGcancel) < 0) __PYX_ERR(4, 8, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_9psycopg_c_2pq_PGcancel->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_9psycopg_c_2pq_PGcancel->tp_dictoffset && __pyx_ptype_9psycopg_c_2pq_PGcancel->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_9psycopg_c_2pq_PGcancel->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_9psycopg_c_2pq_PGcancel, __pyx_vtabptr_9psycopg_c_2pq_PGcancel) < 0) __PYX_ERR(4, 8, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_9psycopg_c_2pq_PGcancel) < 0) __PYX_ERR(4, 8, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PGcancel, (PyObject *) __pyx_ptype_9psycopg_c_2pq_PGcancel) < 0) __PYX_ERR(4, 8, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_9psycopg_c_2pq_PGcancel) < 0) __PYX_ERR(4, 8, __pyx_L1_error)
  #endif
  __pyx_vtabptr_9psycopg_c_2pq_Escaping = &__pyx_vtable_9psycopg_c_2pq_Escaping;
  __pyx_vtable_9psycopg_c_2pq_Escaping.escape_literal = (PyObject *(*)(struct __pyx_obj_9psycopg_c_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9psycopg_c_2pq_8Escaping_escape_literal;
  __pyx_vtable_9psycopg_c_2pq_Escaping.escape_identifier = (PyObject *(*)(struct __pyx_obj_9psycopg_c_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9psycopg_c_2pq_8Escaping_escape_identifier;
  __pyx_vtable_9psycopg_c_2pq_Escaping.escape_string = (PyObject *(*)(struct __pyx_obj_9psycopg_c_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9psycopg_c_2pq_8Escaping_escape_string;
  __pyx_vtable_9psycopg_c_2pq_Escaping.escape_bytea = (PyObject *(*)(struct __pyx_obj_9psycopg_c_2pq_Escaping *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9psycopg_c_2pq_8Escaping_escape_bytea;
  __pyx_vtable_9psycopg_c_2pq_Escaping.unescape_bytea = (PyObject *(*)(struct __pyx_obj_9psycopg_c_2pq_Escaping *, unsigned char const *, int __pyx_skip_dispatch))__pyx_f_9psycopg_c_2pq_8Escaping_unescape_bytea;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_9psycopg_c_2pq_Escaping = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_Escaping_spec, NULL); if (unlikely(!__pyx_ptype_9psycopg_c_2pq_Escaping)) __PYX_ERR(6, 13, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_Escaping_spec, __pyx_ptype_9psycopg_c_2pq_Escaping) < 0) __PYX_ERR(6, 13, __pyx_L1_error)
  #else
  __pyx_ptype_9psycopg_c_2pq_Escaping = &__pyx_type_9psycopg_c_2pq_Escaping;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_9psycopg_c_2pq_Escaping) < 0) __PYX_ERR(6, 13, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_9psycopg_c_2pq_Escaping->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_9psycopg_c_2pq_Escaping->tp_dictoffset && __pyx_ptype_9psycopg_c_2pq_Escaping->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_9psycopg_c_2pq_Escaping->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_9psycopg_c_2pq_Escaping, __pyx_vtabptr_9psycopg_c_2pq_Escaping) < 0) __PYX_ERR(6, 13, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_9psycopg_c_2pq_Escaping) < 0) __PYX_ERR(6, 13, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Escaping, (PyObject *) __pyx_ptype_9psycopg_c_2pq_Escaping) < 0) __PYX_ERR(6, 13, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_9psycopg_c_2pq_Escaping) < 0) __PYX_ERR(6, 13, __pyx_L1_error)
  #endif
  __pyx_vtabptr_9psycopg_c_2pq_PQBuffer = &__pyx_vtable_9psycopg_c_2pq_PQBuffer;
  __pyx_vtable_9psycopg_c_2pq_PQBuffer._from_buffer = (struct __pyx_obj_9psycopg_c_2pq_PQBuffer *(*)(unsigned char *, Py_ssize_t))__pyx_f_9psycopg_c_2pq_8PQBuffer__from_buffer;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_9psycopg_c_2pq_PQBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_PQBuffer_spec, NULL); if (unlikely(!__pyx_ptype_9psycopg_c_2pq_PQBuffer)) __PYX_ERR(7, 14, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_9psycopg_c_2pq_PQBuffer->tp_as_buffer = &__pyx_tp_as_buffer_PQBuffer;
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API."
  #endif
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_PQBuffer_spec, __pyx_ptype_9psycopg_c_2pq_PQBuffer) < 0) __PYX_ERR(7, 14, __pyx_L1_error)
  #else
  __pyx_ptype_9psycopg_c_2pq_PQBuffer = &__pyx_type_9psycopg_c_2pq_PQBuffer;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_9psycopg_c_2pq_PQBuffer) < 0) __PYX_ERR(7, 14, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_9psycopg_c_2pq_PQBuffer->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_9psycopg_c_2pq_PQBuffer->tp_dictoffset && __pyx_ptype_9psycopg_c_2pq_PQBuffer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_9psycopg_c_2pq_PQBuffer->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_9psycopg_c_2pq_PQBuffer, __pyx_vtabptr_9psycopg_c_2pq_PQBuffer) < 0) __PYX_ERR(7, 14, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_9psycopg_c_2pq_PQBuffer) < 0) __PYX_ERR(7, 14, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PQBuffer, (PyObject *) __pyx_ptype_9psycopg_c_2pq_PQBuffer) < 0) __PYX_ERR(7, 14, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_9psycopg_c_2pq_PQBuffer) < 0) __PYX_ERR(7, 14, __pyx_L1_error)
  #endif
  __pyx_vtabptr_9psycopg_c_2pq_ViewBuffer = &__pyx_vtable_9psycopg_c_2pq_ViewBuffer;
  __pyx_vtable_9psycopg_c_2pq_ViewBuffer._from_buffer = (struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *(*)(PyObject *, unsigned char *, Py_ssize_t))__pyx_f_9psycopg_c_2pq_10ViewBuffer__from_buffer;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_9psycopg_c_2pq_ViewBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_ViewBuffer_spec, NULL); if (unlikely(!__pyx_ptype_9psycopg_c_2pq_ViewBuffer)) __PYX_ERR(7, 57, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_9psycopg_c_2pq_ViewBuffer->tp_as_buffer = &__pyx_tp_as_buffer_ViewBuffer;
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API."
  #endif
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_ViewBuffer_spec, __pyx_ptype_9psycopg_c_2pq_ViewBuffer) < 0) __PYX_ERR(7, 57, __pyx_L1_error)
  #else
  __pyx_ptype_9psycopg_c_2pq_ViewBuffer = &__pyx_type_9psycopg_c_2pq_ViewBuffer;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_9psycopg_c_2pq_ViewBuffer) < 0) __PYX_ERR(7, 57, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_9psycopg_c_2pq_ViewBuffer->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_9psycopg_c_2pq_ViewBuffer->tp_dictoffset && __pyx_ptype_9psycopg_c_2pq_ViewBuffer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_9psycopg_c_2pq_ViewBuffer->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_9psycopg_c_2pq_ViewBuffer, __pyx_vtabptr_9psycopg_c_2pq_ViewBuffer) < 0) __PYX_ERR(7, 57, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_9psycopg_c_2pq_ViewBuffer) < 0) __PYX_ERR(7, 57, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ViewBuffer, (PyObject *) __pyx_ptype_9psycopg_c_2pq_ViewBuffer) < 0) __PYX_ERR(7, 57, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_9psycopg_c_2pq_ViewBuffer) < 0) __PYX_ERR(7, 57, __pyx_L1_error)
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(8, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_pq(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_pq},
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "pq",
      __pyx_k_libpq_Python_wrapper_using_cyth, /* m_doc */
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      0, /* m_size */
    #elif CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstate), /* m_size */
    #else
      -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif
#endif

#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initpq(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initpq(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_pq(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_pq(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
#else
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
#endif
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
#if CYTHON_COMPILING_IN_LIMITED_API
            result = PyModule_AddObject(module, to_name, value);
#else
            result = PyDict_SetItemString(moddict, to_name, value);
#endif
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    moddict = module;
#else
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
#endif
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_pq(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  int stringtab_initialized = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'pq' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("pq", __pyx_methods, __pyx_k_libpq_Python_wrapper_using_cyth, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  if (unlikely(!__pyx_m)) __PYX_ERR(2, 1, __pyx_L1_error)
  #elif CYTHON_COMPILING_IN_LIMITED_API
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
  {
    int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
    Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((add_module_result < 0))) __PYX_ERR(2, 1, __pyx_L1_error)
  }
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  if (unlikely(!__pyx_m)) __PYX_ERR(2, 1, __pyx_L1_error)
  #endif
  #endif
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(2, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(2, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(2, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_pq(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(2, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_psycopg_c__pq) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(2, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "psycopg_c.pq")) {
      if (unlikely((PyDict_SetItemString(modules, "psycopg_c.pq", __pyx_m) < 0))) __PYX_ERR(2, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(2, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(2, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(2, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  #endif

  /* "psycopg_c/pq.pyx":9
 * from psycopg_c.pq cimport libpq
 * 
 * from psycopg import errors as e             # <<<<<<<<<<<<<<
 * from psycopg.pq import Format
 * from psycopg.pq.misc import error_message
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_errors);
  __Pyx_GIVEREF(__pyx_n_s_errors);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_errors);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_psycopg, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_e, __pyx_t_2) < 0) __PYX_ERR(2, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq.pyx":10
 * 
 * from psycopg import errors as e
 * from psycopg.pq import Format             # <<<<<<<<<<<<<<
 * from psycopg.pq.misc import error_message
 * 
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_Format);
  __Pyx_GIVEREF(__pyx_n_s_Format);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Format);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_psycopg_pq, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Format, __pyx_t_3) < 0) __PYX_ERR(2, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq.pyx":11
 * from psycopg import errors as e
 * from psycopg.pq import Format
 * from psycopg.pq.misc import error_message             # <<<<<<<<<<<<<<
 * 
 * __impl__ = 'c'
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_error_message);
  __Pyx_GIVEREF(__pyx_n_s_error_message);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error_message);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_psycopg_pq_misc, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_error_message, __pyx_t_2) < 0) __PYX_ERR(2, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq.pyx":13
 * from psycopg.pq.misc import error_message
 * 
 * __impl__ = 'c'             # <<<<<<<<<<<<<<
 * __build_version__ = libpq.PG_VERSION_NUM
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_impl, __pyx_n_u_c) < 0) __PYX_ERR(2, 13, __pyx_L1_error)

  /* "psycopg_c/pq.pyx":14
 * 
 * __impl__ = 'c'
 * __build_version__ = libpq.PG_VERSION_NUM             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(PG_VERSION_NUM); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_build_version, __pyx_t_3) < 0) __PYX_ERR(2, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq.pyx":17
 * 
 * 
 * def version():             # <<<<<<<<<<<<<<
 *     return libpq.PQlibVersion()
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_1version, 0, __pyx_n_s_version, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_t_3) < 0) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq/pgconn.pyx":24
 * from cpython.memoryview cimport PyMemoryView_FromObject
 * 
 * import ctypes             # <<<<<<<<<<<<<<
 * import logging
 * from typing import Iterator
 */
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_ctypes, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctypes, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq/pgconn.pyx":25
 * 
 * import ctypes
 * import logging             # <<<<<<<<<<<<<<
 * from typing import Iterator
 * 
 */
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_logging, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq/pgconn.pyx":26
 * import ctypes
 * import logging
 * from typing import Iterator             # <<<<<<<<<<<<<<
 * 
 * from psycopg.pq import Format as PqFormat, PipelineStatus
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_Iterator);
  __Pyx_GIVEREF(__pyx_n_s_Iterator);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Iterator);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Iterator); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Iterator, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":28
 * from typing import Iterator
 * 
 * from psycopg.pq import Format as PqFormat, PipelineStatus             # <<<<<<<<<<<<<<
 * from psycopg.pq.misc import PGnotify, connection_summary
 * from psycopg_c.pq cimport PQBuffer
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Format);
  __Pyx_GIVEREF(__pyx_n_s_Format);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Format);
  __Pyx_INCREF(__pyx_n_s_PipelineStatus);
  __Pyx_GIVEREF(__pyx_n_s_PipelineStatus);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_PipelineStatus);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_psycopg_pq, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PqFormat, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PipelineStatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PipelineStatus, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq/pgconn.pyx":29
 * 
 * from psycopg.pq import Format as PqFormat, PipelineStatus
 * from psycopg.pq.misc import PGnotify, connection_summary             # <<<<<<<<<<<<<<
 * from psycopg_c.pq cimport PQBuffer
 * 
 */
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_PGnotify);
  __Pyx_GIVEREF(__pyx_n_s_PGnotify);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_PGnotify);
  __Pyx_INCREF(__pyx_n_s_connection_summary);
  __Pyx_GIVEREF(__pyx_n_s_connection_summary);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_connection_summary);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_psycopg_pq_misc, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PGnotify); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PGnotify, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_connection_summary); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_connection_summary, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":32
 * from psycopg_c.pq cimport PQBuffer
 * 
 * logger = logging.getLogger('psycopg')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":59
 *         return f"<{cls} {info} at 0x{id(self):x}>"
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_PGconn) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_7connect, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_connect, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_connect, __pyx_t_3) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_n_s_connect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_connect, __pyx_t_2) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":67
 *         return PGconn._from_ptr(pgconn)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect_start(cls, const char *conninfo) -> PGconn:
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_PGconn) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_9connect_start, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_connect_start, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_connect_start, __pyx_t_3) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);
  __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_n_s_connect_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_connect_start, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":75
 *         return PGconn._from_ptr(pgconn)
 * 
 *     def connect_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_11connect_poll, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_connect_poll, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_connect_poll, __pyx_t_3) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":78
 *         return _call_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         if self._pgconn_ptr is not NULL:
 *             libpq.PQfinish(self._pgconn_ptr)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_13finish, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_finish, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_finish, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":100
 *         return rv
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         libpq.PQreset(self._pgconn_ptr)
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_15reset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_reset, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_reset, __pyx_t_3) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":104
 *         libpq.PQreset(self._pgconn_ptr)
 * 
 *     def reset_start(self) -> None:             # <<<<<<<<<<<<<<
 *         if not libpq.PQresetStart(self._pgconn_ptr):
 *             raise e.OperationalError("couldn't reset connection")
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_17reset_start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_reset_start, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_reset_start, __pyx_t_2) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":108
 *             raise e.OperationalError("couldn't reset connection")
 * 
 *     def reset_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_19reset_poll, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_reset_poll, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_reset_poll, __pyx_t_3) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":111
 *         return _call_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def ping(self, const char *conninfo) -> int:
 *         return libpq.PQping(conninfo)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_21ping, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_ping, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_ping, __pyx_t_2) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_n_s_ping); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_ping, __pyx_t_3) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":164
 *         return libpq.PQtransactionStatus(self._pgconn_ptr)
 * 
 *     def parameter_status(self, const char *name) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef const char *rv = libpq.PQparameterStatus(self._pgconn_ptr, name)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Optional_bytes) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_23parameter_status, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_parameter_status, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_parameter_status, __pyx_t_2) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":207
 *         return bool(_call_int(self, <conn_int_f>libpq.PQsslInUse))
 * 
 *     def exec_(self, const char *command) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *pgresult
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_PGresult) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_25exec_, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_exec, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_exec, __pyx_t_3) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":217
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query(self, const char *command) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_27send_query, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_send_query, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_send_query, __pyx_t_2) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":231
 *         param_types: Optional[Sequence[int]] = None,
 *         param_formats: Optional[Sequence[int]] = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         _ensure_pgconn(self)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PqFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_TEXT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_k__8 = __pyx_t_4;

  /* "psycopg_c/pq/pgconn.pyx":230
 *         param_values: Optional[Sequence[Optional[bytes]]],
 *         param_types: Optional[Sequence[int]] = None,
 *         param_formats: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PqFormat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "psycopg_c/pq/pgconn.pyx":231
 *         param_types: Optional[Sequence[int]] = None,
 *         param_formats: Optional[Sequence[int]] = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         _ensure_pgconn(self)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "psycopg_c/pq/pgconn.pyx":225
 *             raise e.OperationalError(f"sending query failed: {error_message(self)}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
 */
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_param_values, __pyx_kp_s_Optional_Sequence_Optional_bytes) < 0) __PYX_ERR(0, 225, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_param_types, __pyx_kp_s_Optional_Sequence_int) < 0) __PYX_ERR(0, 225, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_param_formats, __pyx_kp_s_Optional_Sequence_int) < 0) __PYX_ERR(0, 225, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_PGresult) < 0) __PYX_ERR(0, 225, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_29exec_params, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_exec_params, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_exec_params, __pyx_t_5) < 0) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":259
 *         param_types: Optional[Sequence[int]] = None,
 *         param_formats: Optional[Sequence[int]] = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         _ensure_pgconn(self)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PqFormat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_k__9 = __pyx_t_4;

  /* "psycopg_c/pq/pgconn.pyx":258
 *         param_values: Optional[Sequence[Optional[bytes]]],
 *         param_types: Optional[Sequence[int]] = None,
 *         param_formats: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PqFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "psycopg_c/pq/pgconn.pyx":259
 *         param_types: Optional[Sequence[int]] = None,
 *         param_formats: Optional[Sequence[int]] = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         _ensure_pgconn(self)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_TEXT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "psycopg_c/pq/pgconn.pyx":253
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_param_values, __pyx_kp_s_Optional_Sequence_Optional_bytes) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_param_types, __pyx_kp_s_Optional_Sequence_int) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_param_formats, __pyx_kp_s_Optional_Sequence_int) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_31send_query_params, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_send_query_params, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_send_query_params, __pyx_t_3) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":282
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_param_types, __pyx_kp_s_Optional_Sequence_int) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_33send_prepare, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_send_prepare, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__48);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_send_prepare, __pyx_t_5) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":314
 *         param_values: Optional[Sequence[Optional[bytes]]],
 *         param_formats: Optional[Sequence[int]] = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         _ensure_pgconn(self)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PqFormat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_TEXT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_k__10 = __pyx_t_4;

  /* "psycopg_c/pq/pgconn.pyx":313
 *         const char *name,
 *         param_values: Optional[Sequence[Optional[bytes]]],
 *         param_formats: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PqFormat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "psycopg_c/pq/pgconn.pyx":314
 *         param_values: Optional[Sequence[Optional[bytes]]],
 *         param_formats: Optional[Sequence[int]] = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         _ensure_pgconn(self)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TEXT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "psycopg_c/pq/pgconn.pyx":309
 *             )
 * 
 *     def send_query_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_param_values, __pyx_kp_s_Optional_Sequence_Optional_bytes) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_param_formats, __pyx_kp_s_Optional_Sequence_int) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_35send_query_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_send_query_prepared, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_send_query_prepared, __pyx_t_2) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":337
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_param_types, __pyx_kp_s_Optional_Sequence_int) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_PGresult) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_37prepare, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_prepare, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__48);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_prepare, __pyx_t_5) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":367
 *         param_values: Optional[Sequence[bytes]],
 *         param_formats: Optional[Sequence[int]] = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         _ensure_pgconn(self)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PqFormat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_k__11 = __pyx_t_4;

  /* "psycopg_c/pq/pgconn.pyx":366
 *         const char *name,
 *         param_values: Optional[Sequence[bytes]],
 *         param_formats: Optional[Sequence[int]] = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PqFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "psycopg_c/pq/pgconn.pyx":367
 *         param_values: Optional[Sequence[bytes]],
 *         param_formats: Optional[Sequence[int]] = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         _ensure_pgconn(self)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_TEXT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "psycopg_c/pq/pgconn.pyx":362
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_param_values, __pyx_kp_s_Optional_Sequence_bytes) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_param_formats, __pyx_kp_s_Optional_Sequence_int) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_PGresult) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_39exec_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_exec_prepared, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_exec_prepared, __pyx_t_3) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":391
 *         return PGresult._from_ptr(rv)
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_PGresult) < 0) __PYX_ERR(0, 391, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_41describe_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_describe_prepared, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_describe_prepared, __pyx_t_5) < 0) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":398
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePrepared(self._pgconn_ptr, name)
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 398, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_43send_describe_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_send_describe_prepared, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_send_describe_prepared, __pyx_t_3) < 0) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":406
 *             )
 * 
 *     def describe_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_PGresult) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_45describe_portal, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_describe_portal, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_describe_portal, __pyx_t_5) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":413
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePortal(self._pgconn_ptr, name)
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 413, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_47send_describe_portal, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_send_describe_portal, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_send_describe_portal, __pyx_t_3) < 0) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":421
 *             )
 * 
 *     def get_result(self) -> Optional["PGresult"]:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Optional_PGresult) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_49get_result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_get_result, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_get_result, __pyx_t_5) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":427
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):
 *             raise e.OperationalError(f"consuming input failed: {error_message(self)}")
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 427, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_51consume_input, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_consume_input, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_consume_input, __pyx_t_3) < 0) __PYX_ERR(0, 427, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":431
 *             raise e.OperationalError(f"consuming input failed: {error_message(self)}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with nogil:
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 431, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_53is_busy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_is_busy, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_is_busy, __pyx_t_5) < 0) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":446
 *             raise e.OperationalError(f"setting nonblocking failed: {error_message(self)}")
 * 
 *     def flush(self) -> int:             # <<<<<<<<<<<<<<
 *         if self._pgconn_ptr == NULL:
 *             raise e.OperationalError(f"flushing failed: the connection is closed")
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 446, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_55flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_flush, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_flush, __pyx_t_3) < 0) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":454
 *         return rv
 * 
 *     def set_single_row_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         if not libpq.PQsetSingleRowMode(self._pgconn_ptr):
 *             raise e.OperationalError("setting single row mode failed")
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 454, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_57set_single_row_mode, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_set_single_row_mode, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_set_single_row_mode, __pyx_t_5) < 0) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":458
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def get_cancel(self) -> PGcancel:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancel *ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_PGcancel) < 0) __PYX_ERR(0, 458, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_59get_cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_get_cancel, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_get_cancel, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":464
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with nogil:
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_61notifies, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_notifies, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_notifies, __pyx_t_3) < 0) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":475
 *             return None
 * 
 *     def put_copy_data(self, buffer) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef char *cbuffer
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 475, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_63put_copy_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_put_copy_data, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_put_copy_data, __pyx_t_5) < 0) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":486
 *         return rv
 * 
 *     def put_copy_end(self, error: Optional[bytes] = None) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef const char *cerr = NULL
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_error, __pyx_kp_s_Optional_bytes) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_65put_copy_end, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_put_copy_end, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__48);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_put_copy_end, __pyx_t_3) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":496
 *         return rv
 * 
 *     def get_copy_data(self, int async_) -> Tuple[int, memoryview]:             # <<<<<<<<<<<<<<
 *         cdef char *buffer_ptr = NULL
 *         cdef int nbytes
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Tuple_int_memoryview) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_67get_copy_data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_get_copy_data, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_get_copy_data, __pyx_t_5) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":509
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_bytes_2) < 0) __PYX_ERR(0, 509, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_69encrypt_password, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_encrypt_password, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__48);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_encrypt_password, __pyx_t_3) < 0) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":532
 *         return rv
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = libpq.PQmakeEmptyPGresult(
 *             self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_PGresult) < 0) __PYX_ERR(0, 532, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_71make_empty_result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_make_empty_result, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_make_empty_result, __pyx_t_5) < 0) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":550
 *         return status
 * 
 *     def enter_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enter pipeline mode.
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_73enter_pipeline_mode, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_enter_pipeline_mode, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_enter_pipeline_mode, __pyx_t_3) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":564
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
 *     def exit_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Exit pipeline mode.
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 564, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_75exit_pipeline_mode, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_exit_pipeline_mode, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_exit_pipeline_mode, __pyx_t_5) < 0) __PYX_ERR(0, 564, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":578
 *             raise e.OperationalError(error_message(self))
 * 
 *     def pipeline_sync(self) -> None:             # <<<<<<<<<<<<<<
 *         """Mark a synchronization point in a pipeline.
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_77pipeline_sync, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_pipeline_sync, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_pipeline_sync, __pyx_t_3) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "psycopg_c/pq/pgconn.pyx":595
 *             raise e.OperationalError("failed to sync pipeline")
 * 
 *     def send_flush_request(self) -> None:             # <<<<<<<<<<<<<<
 *         """Sends a request for the server to flush its output buffer.
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_79send_flush_request, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn_send_flush_request, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dict, __pyx_n_s_send_flush_request, __pyx_t_5) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGconn);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_81__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn___reduce_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_83__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGconn___setstate_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_5) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "psycopg_c/pq/pgresult.pyx":10
 * from cpython.mem cimport PyMem_Malloc, PyMem_Free
 * 
 * from psycopg.pq.misc import PGresAttDesc             # <<<<<<<<<<<<<<
 * from psycopg.pq._enums import ExecStatus
 * 
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_n_s_PGresAttDesc);
  __Pyx_GIVEREF(__pyx_n_s_PGresAttDesc);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_PGresAttDesc);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_psycopg_pq_misc, __pyx_t_5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PGresAttDesc); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PGresAttDesc, __pyx_t_5) < 0) __PYX_ERR(3, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq/pgresult.pyx":11
 * 
 * from psycopg.pq.misc import PGresAttDesc
 * from psycopg.pq._enums import ExecStatus             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_ExecStatus);
  __Pyx_GIVEREF(__pyx_n_s_ExecStatus);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_ExecStatus);
  __pyx_t_5 = __Pyx_Import(__pyx_n_s_psycopg_pq__enums, __pyx_t_3, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_ExecStatus); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ExecStatus, __pyx_t_3) < 0) __PYX_ERR(3, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "psycopg_c/pq/pgresult.pyx":33
 *         return f"<{cls} [{status.name}] at 0x{id(self):x}>"
 * 
 *     def clear(self) -> None:             # <<<<<<<<<<<<<<
 *         if self._pgresult_ptr is not NULL:
 *             libpq.PQclear(self._pgresult_ptr)
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(3, 33, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_7clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_clear, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_clear, __pyx_t_3) < 0) __PYX_ERR(3, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "psycopg_c/pq/pgresult.pyx":53
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 * 
 *     def error_field(self, int fieldcode) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Optional_bytes) < 0) __PYX_ERR(3, 53, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_9error_field, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_error_field, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_error_field, __pyx_t_5) < 0) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "psycopg_c/pq/pgresult.pyx":68
 *         return libpq.PQnfields(self._pgresult_ptr)
 * 
 *     def fname(self, int column_number) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_Optional_bytes) < 0) __PYX_ERR(3, 68, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_11fname, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_fname, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_fname, __pyx_t_3) < 0) __PYX_ERR(3, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "psycopg_c/pq/pgresult.pyx":75
 *             return None
 * 
 *     def ftable(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(3, 75, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_13ftable, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_ftable, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_ftable, __pyx_t_5) < 0) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "psycopg_c/pq/pgresult.pyx":78
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
 *     def ftablecol(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(3, 78, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_15ftablecol, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_ftablecol, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_ftablecol, __pyx_t_3) < 0) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "psycopg_c/pq/pgresult.pyx":81
 *         return libpq.PQftablecol(self._pgresult_ptr, column_number)
 * 
 *     def fformat(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(3, 81, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_17fformat, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_fformat, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_fformat, __pyx_t_5) < 0) __PYX_ERR(3, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "psycopg_c/pq/pgresult.pyx":84
 *         return libpq.PQfformat(self._pgresult_ptr, column_number)
 * 
 *     def ftype(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(3, 84, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_19ftype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_ftype, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_ftype, __pyx_t_3) < 0) __PYX_ERR(3, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "psycopg_c/pq/pgresult.pyx":87
 *         return libpq.PQftype(self._pgresult_ptr, column_number)
 * 
 *     def fmod(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(3, 87, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_21fmod, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_fmod, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_fmod, __pyx_t_5) < 0) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "psycopg_c/pq/pgresult.pyx":90
 *         return libpq.PQfmod(self._pgresult_ptr, column_number)
 * 
 *     def fsize(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(3, 90, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_23fsize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_fsize, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_fsize, __pyx_t_3) < 0) __PYX_ERR(3, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "psycopg_c/pq/pgresult.pyx":97
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 * 
 *     def get_value(self, int row_number, int column_number) -> Optional[bytes]:             # <<<<<<<<<<<<<<
 *         cdef int crow = row_number
 *         cdef int ccol = column_number
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Optional_bytes) < 0) __PYX_ERR(3, 97, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_25get_value, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_get_value, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_get_value, __pyx_t_5) < 0) __PYX_ERR(3, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "psycopg_c/pq/pgresult.pyx":116
 *         return libpq.PQnparams(self._pgresult_ptr)
 * 
 *     def param_type(self, int param_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(3, 116, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_27param_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_param_type, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_param_type, __pyx_t_3) < 0) __PYX_ERR(3, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "psycopg_c/pq/pgresult.pyx":139
 *         return libpq.PQoidValue(self._pgresult_ptr)
 * 
 *     def set_attributes(self, descriptions: List[PGresAttDesc]):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t num = len(descriptions)
 *         cdef libpq.PGresAttDesc *attrs = <libpq.PGresAttDesc *>PyMem_Malloc(
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_descriptions, __pyx_kp_s_List_PGresAttDesc) < 0) __PYX_ERR(3, 139, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_29set_attributes, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult_set_attributes, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dict, __pyx_n_s_set_attributes, __pyx_t_5) < 0) __PYX_ERR(3, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGresult);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_31__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult___reduce_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_33__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGresult___setstate_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_5) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":21
 *         self.free()
 * 
 *     def free(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(4, 21, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGcancel_5free, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGcancel_free, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGcancel->tp_dict, __pyx_n_s_free, __pyx_t_3) < 0) __PYX_ERR(4, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGcancel);

  /* "psycopg_c/pq/pgcancel.pyx":26
 *             self.pgcancel_ptr = NULL
 * 
 *     def cancel(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef char buf[256]
 *         cdef int res = libpq.PQcancel(self.pgcancel_ptr, buf, sizeof(buf))
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(4, 26, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGcancel_7cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGcancel_cancel, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_PGcancel->tp_dict, __pyx_n_s_cancel, __pyx_t_5) < 0) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_PGcancel);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGcancel_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGcancel___reduce_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGcancel_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PGcancel___setstate_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_5) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "psycopg_c/pq/conninfo.pyx":7
 * # Copyright (C) 2020 The Psycopg Team
 * 
 * from psycopg.pq.misc import ConninfoOption             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_n_s_ConninfoOption);
  __Pyx_GIVEREF(__pyx_n_s_ConninfoOption);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_ConninfoOption);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_psycopg_pq_misc, __pyx_t_5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ConninfoOption); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConninfoOption, __pyx_t_5) < 0) __PYX_ERR(5, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq/conninfo.pyx":10
 * 
 * 
 * class Conninfo:             # <<<<<<<<<<<<<<
 *     @classmethod
 *     def get_defaults(cls) -> List[ConninfoOption]:
 */
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Conninfo, __pyx_n_s_Conninfo, (PyObject *) NULL, __pyx_n_s_psycopg_c_pq, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "psycopg_c/pq/conninfo.pyx":11
 * 
 * class Conninfo:
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_defaults(cls) -> List[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_List_ConninfoOption) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Conninfo_1get_defaults, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Conninfo_get_defaults, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_get_defaults, __pyx_t_5) < 0) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "psycopg_c/pq/conninfo.pyx":20
 *         return rv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(cls, const char *conninfo) -> List[ConninfoOption]:
 *         cdef char *errmsg = NULL
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_List_ConninfoOption) < 0) __PYX_ERR(5, 20, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Conninfo_3parse, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_Conninfo_parse, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_parse, __pyx_t_5) < 0) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "psycopg_c/pq/conninfo.pyx":36
 *         return rv
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Conninfo_5__repr__, 0, __pyx_n_s_Conninfo___repr, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "psycopg_c/pq/conninfo.pyx":10
 * 
 * 
 * class Conninfo:             # <<<<<<<<<<<<<<
 *     @classmethod
 *     def get_defaults(cls) -> List[ConninfoOption]:
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Conninfo, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Conninfo, __pyx_t_5) < 0) __PYX_ERR(5, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq/escaping.pyx":17
 *         self.conn = conn
 * 
 *     cpdef escape_literal(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef bytes rv
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_3escape_literal, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Escaping_escape_literal, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_Escaping->tp_dict, __pyx_n_s_escape_literal, __pyx_t_3) < 0) __PYX_ERR(6, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_Escaping);

  /* "psycopg_c/pq/escaping.pyx":40
 *         )
 * 
 *     cpdef escape_identifier(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_5escape_identifier, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Escaping_escape_identifier, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_Escaping->tp_dict, __pyx_n_s_escape_identifier, __pyx_t_3) < 0) __PYX_ERR(6, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_Escaping);

  /* "psycopg_c/pq/escaping.pyx":62
 *         )
 * 
 *     cpdef escape_string(self, data):             # <<<<<<<<<<<<<<
 *         cdef int error
 *         cdef size_t len_out
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_7escape_string, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Escaping_escape_string, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_Escaping->tp_dict, __pyx_n_s_escape_string, __pyx_t_3) < 0) __PYX_ERR(6, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_Escaping);

  /* "psycopg_c/pq/escaping.pyx":94
 *         return PyMemoryView_FromObject(rv)
 * 
 *     cpdef escape_bytea(self, data):             # <<<<<<<<<<<<<<
 *         cdef size_t len_out
 *         cdef unsigned char *out
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_9escape_bytea, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Escaping_escape_bytea, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_Escaping->tp_dict, __pyx_n_s_escape_bytea, __pyx_t_3) < 0) __PYX_ERR(6, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_Escaping);

  /* "psycopg_c/pq/escaping.pyx":120
 *         )
 * 
 *     cpdef unescape_bytea(self, const unsigned char *data):             # <<<<<<<<<<<<<<
 *         # not needed, but let's keep it symmetric with the escaping:
 *         # if a connection is passed in, it must be valid.
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_11unescape_bytea, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Escaping_unescape_bytea, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_Escaping->tp_dict, __pyx_n_s_unescape_bytea, __pyx_t_3) < 0) __PYX_ERR(6, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_Escaping);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Escaping___reduce_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_Escaping->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_Escaping);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Escaping__set_state(self, __pyx_state)
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Escaping___setstate_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9psycopg_c_2pq_Escaping->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_9psycopg_c_2pq_Escaping);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PQBuffer_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PQBuffer___reduce_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PQBuffer_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PQBuffer___setstate_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_10ViewBuffer_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ViewBuffer___reduce_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_10ViewBuffer_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ViewBuffer___setstate_cython, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq.pyx":30
 * 
 * # importing the ssl module sets up Python's libcrypto callbacks
 * import ssl  # noqa             # <<<<<<<<<<<<<<
 * 
 * # disable libcrypto setup in libpq, so it won't stomp on the callbacks
 */
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_ssl, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ssl, __pyx_t_3) < 0) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq.pyx":34
 * # disable libcrypto setup in libpq, so it won't stomp on the callbacks
 * # that have already been set up
 * libpq.PQinitOpenSSL(1, 0)             # <<<<<<<<<<<<<<
 */
  PQinitOpenSSL(1, 0);

  /* "(tree fragment)":1
 * def __pyx_unpickle_Escaping(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_3__pyx_unpickle_Escaping, 0, __pyx_n_s_pyx_unpickle_Escaping, NULL, __pyx_n_s_psycopg_c_pq, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Escaping, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq.pyx":1
 * """             # <<<<<<<<<<<<<<
 * libpq Python wrapper using cython bindings.
 * """
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  if (__pyx_m) {
    if (__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init psycopg_c.pq", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init psycopg_c.pq");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#if _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError */
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* TupleAndListFromArray */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        Py_INCREF(__pyx_empty_tuple);
        return __pyx_empty_tuple;
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
    for (i = 0; i < n; i++)
    {
        if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;  // error
            return kwvalues[i];
        }
    }
    return NULL;  // not found (no exception set)
}
#endif

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kw,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
        if (unlikely(PyTuple_GET_SIZE(kw) == 0))
            return 1;
        if (!kw_allowed) {
            key = PyTuple_GET_ITEM(kw, 0);
            goto invalid_keyword;
        }
#if PY_VERSION_HEX < 0x03090000
        for (pos = 0; pos < PyTuple_GET_SIZE(kw); pos++) {
            key = PyTuple_GET_ITEM(kw, pos);
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
        }
#endif
        return 1;
    }
    while (PyDict_Next(kw, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if (!kw_allowed && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall */
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]);
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
    Py_DECREF(argstuple);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
#ifdef __Pyx_CyFunction_USED
        if (__Pyx_IsCyOrPyCFunction(func))
#else
        if (PyCFunction_Check(func))
#endif
        {
            if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
                return __Pyx_PyObject_CallMethO(func, NULL);
            }
        }
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (PyCFunction_Check(func))
        {
            if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
                return __Pyx_PyObject_CallMethO(func, args[0]);
            }
        }
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    #if PY_VERSION_HEX >= 0x030700A1
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    #if CYTHON_VECTORCALL
    vectorcallfunc f = _PyVectorcall_Function(func);
    if (f) {
        return f(func, args, (size_t)nargs, kwargs);
    }
    #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
    if (__Pyx_CyFunction_CheckExact(func)) {
        __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
        if (f) return f(func, args, (size_t)nargs, kwargs);
    }
    #endif
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
    }
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
}

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
    else state = (PyGILState_STATE)-1;
#endif
    CYTHON_UNUSED_VAR(clineno);
    CYTHON_UNUSED_VAR(lineno);
    CYTHON_UNUSED_VAR(filename);
    CYTHON_MAYBE_UNUSED_VAR(nogil);
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    CYTHON_MAYBE_UNUSED_VAR(max_char);
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    CYTHON_UNUSED_VAR(value_count);
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#elif CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyObjectCallOneArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectFormat */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
    int ret;
    _PyUnicodeWriter writer;
    if (likely(PyFloat_CheckExact(obj))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
        _PyUnicodeWriter_Init(&writer, 0);
#else
        _PyUnicodeWriter_Init(&writer);
#endif
        ret = _PyFloat_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else if (likely(PyLong_CheckExact(obj))) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
        _PyUnicodeWriter_Init(&writer, 0);
#else
        _PyUnicodeWriter_Init(&writer);
#endif
        ret = _PyLong_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else {
        return PyObject_Format(obj, format_spec);
    }
    if (unlikely(ret == -1)) {
        _PyUnicodeWriter_Dealloc(&writer);
        return NULL;
    }
    return _PyUnicodeWriter_Finish(&writer);
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    __Pyx_PyThreadState_declare
    CYTHON_UNUSED_VAR(cause);
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY ||  CYTHON_COMPILING_IN_LIMITED_API
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* CIntToDigits */
static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
#if CYTHON_PEP393_ENABLED
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
#else
    Py_UNICODE *udata;
    uval = PyUnicode_FromUnicode(NULL, ulength);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_AS_UNICODE(uval);
#endif
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp;
                    PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
                    if (unlikely(!repeat)) goto done_or_error;
                    tmp = PyNumber_Multiply(padding, repeat);
                    Py_DECREF(repeat);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyNumber_Add(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyNumber_Add(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(int)*3+2];
    char *dpos, *end = digits + sizeof(int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    int remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (int) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (int) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (int) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
    while (1) {
        if (kwds_is_tuple) {
            if (pos >= PyTuple_GET_SIZE(kwds)) break;
            key = PyTuple_GET_ITEM(kwds, pos);
            value = kwvalues[pos];
            pos++;
        }
        else
        {
            if (!PyDict_Next(kwds, &pos, &key, &value)) break;
        }
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key)
                );
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!j)) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_subscript) {
            PyObject *r, *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        tmp_tb = PyException_GetTraceback(tmp_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
  #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(Py_ssize_t)*3+2];
    char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    Py_ssize_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (Py_ssize_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (Py_ssize_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (Py_ssize_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* decode_c_string */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        size_t slen = strlen(cstring);
        if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
            PyErr_SetString(PyExc_OverflowError,
                            "c-string too long to convert to Python");
            return NULL;
        }
        length = (Py_ssize_t) slen;
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    type_name = __Pyx_PyType_GetName(type);
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* ssize_strlen */
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}

/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if CYTHON_USE_TYPE_SLOTS
    if (likely(PyString_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
#endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (unlikely(!py_import))
        goto bad;
    if (!from_list) {
        empty_list = PyList_New(0);
        if (unlikely(!empty_list))
            goto bad;
        from_list = empty_list;
    }
    #endif
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                #if CYTHON_COMPILING_IN_LIMITED_API
                module = PyImport_ImportModuleLevelObject(
                    name, empty_dict, empty_dict, from_list, 1);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, __pyx_d, empty_dict, from_list, 1);
                #endif
                if (unlikely(!module)) {
                    if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (unlikely(!py_level))
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            #if CYTHON_COMPILING_IN_LIMITED_API
            module = PyImport_ImportModuleLevelObject(
                name, empty_dict, empty_dict, from_list, level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_d, empty_dict, from_list, level);
            #endif
            #endif
        }
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (!r) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* FixUpExtensionType */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    (void) spec;
    (void) type;
#else
    const PyType_Slot *slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
        int changed = 0;
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
        const
#endif
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
#if PY_VERSION_HEX < 0x030900b1
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif
#else
                if ((0));
#endif
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
                        Py_DECREF(descr);
                        return -1;
                    }
                    Py_DECREF(descr);
                    changed = 1;
                }
#endif
            }
            memb++;
        }
        if (changed)
            PyType_Modified(type);
    }
#endif
    return 0;
}
#endif

/* PyObjectCallNoArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg = NULL;
    return __Pyx_PyObject_FastCall(func, (&arg)+1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#elif PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* ValidateBasesTuple */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n = PyTuple_GET_SIZE(bases);
    for (i = 1; i < n; i++)
    {
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
        PyTypeObject *b;
#if PY_MAJOR_VERSION < 3
        if (PyClass_Check(b0))
        {
            PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
                         PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
            return -1;
        }
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
            return -1;
        }
        if (dictoffset == 0 && b->tp_dictoffset)
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
            PyErr_Format(PyExc_TypeError,
                "extension type '%.200s' has no __dict__ slot, "
                "but base type '" __Pyx_FMT_TYPENAME "' has: "
                "either add 'cdef dict __dict__' to the extension type "
                "or add '__slots__ = [...]' to the base type",
                type_name, b_name);
            __Pyx_DECREF_TypeName(b_name);
            return -1;
        }
    }
    return 0;
}
#endif

/* PyType_Ready */
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
        gc = PyImport_GetModule(__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, attr_name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(attr_name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetVTable */
static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (unlikely(!ob))
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable */
static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* MergeVTables */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i;
    void** base_vtables;
    __Pyx_TypeName tp_base_name;
    __Pyx_TypeName base_name;
    void* unknown = (void*)-1;
    PyObject* bases = type->tp_bases;
    int base_depth = 0;
    {
        PyTypeObject* base = type->tp_base;
        while (base) {
            base_depth += 1;
            base = base->tp_base;
        }
    }
    base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
    for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
        void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = type->tp_base;
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = base->tp_base;
            }
        }
    }
    PyErr_Clear();
    free(base_vtables);
    return 0;
bad:
    tp_base_name = __Pyx_PyType_GetName(type->tp_base);
    base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
    free(base_vtables);
    return -1;
}
#endif

/* SetupReduce */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}
#endif

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#if !CYTHON_COMPILING_IN_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* FetchSharedCythonModule */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME);
    if (unlikely(!abi_module)) return NULL;
    Py_INCREF(abi_module);
    return abi_module;
}

/* FetchCommonType */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t basicsize,
                               Py_ssize_t expected_basicsize) {
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* abi_module;
    const char* object_name;
    PyTypeObject *cached_type = NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    object_name = strrchr(type->tp_name, '.');
    object_name = object_name ? object_name+1 : type->tp_name;
    cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        if (__Pyx_VerifyCachedType(
              (PyObject *)cached_type,
              object_name,
              cached_type->tp_basicsize,
              type->tp_basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    if (PyType_Ready(type) < 0) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
        goto bad;
    Py_INCREF(type);
    cached_type = type;
done:
    Py_DECREF(abi_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#else
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module, *cached_type = NULL;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    cached_type = PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        Py_ssize_t basicsize;
#if CYTHON_COMPILING_IN_LIMITED_API
        PyObject *py_basicsize;
        py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
        if (unlikely(!py_basicsize)) goto bad;
        basicsize = PyLong_AsSsize_t(py_basicsize);
        Py_DECREF(py_basicsize);
        py_basicsize = 0;
        if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
#else
        basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
#endif
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              basicsize,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    (void) module;
    cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
done:
    Py_DECREF(abi_module);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#endif

/* PyVectorcallFastCallDict */
#if CYTHON_METH_FASTCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &= Py_TYPE(key)->tp_flags;
        Py_INCREF(key);
        Py_INCREF(value);
        PyTuple_SET_ITEM(kwnames, i, key);
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
        return vc(func, args, nargs, NULL);
    }
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
{
    CYTHON_UNUSED_VAR(closure);
    if (unlikely(op->func_doc == NULL)) {
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_tuple;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_kwdict;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->func_annotations;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    int is_coroutine;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
#if PY_VERSION_HEX >= 0x03050000
    if (is_coroutine) {
        PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
        PyList_SET_ITEM(fromlist, 0, marker);
        module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(op->func_is_coroutine)) {
            return __Pyx_NewRef(op->func_is_coroutine);
        }
ignore:
        PyErr_Clear();
    }
#endif
    op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
    return __Pyx_NewRef(op->func_is_coroutine);
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#endif
#if PY_VERSION_HEX < 0x030500A0
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    CYTHON_UNUSED_VAR(args);
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
    if (unlikely(op == NULL))
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    cf->m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
                         ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
        PyErr_Format(PyExc_TypeError,
                     "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
#else
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
#if !CYTHON_METH_FASTCALL
    0,
#elif CYTHON_BACKPORT_VECTORCALL
    (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
#else
    offsetof(PyCFunctionObject, vectorcall),
#endif
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#ifdef _Py_TPFLAGS_HAVE_VECTORCALL
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_PyMethod_New,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
    0,
#endif
};
#endif
static int __pyx_CyFunction_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
#else
    (void) module;
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
#endif
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* ImportDottedModule */
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
    PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
    if (unlikely(PyErr_Occurred())) {
        PyErr_Clear();
    }
    if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
        partial_name = name;
    } else {
        slice = PySequence_GetSlice(parts_tuple, 0, count);
        if (unlikely(!slice))
            goto bad;
        sep = PyUnicode_FromStringAndSize(".", 1);
        if (unlikely(!sep))
            goto bad;
        partial_name = PyUnicode_Join(sep, slice);
    }
    PyErr_Format(
#if PY_MAJOR_VERSION < 3
        PyExc_ImportError,
        "No module named '%s'", PyString_AS_STRING(partial_name));
#else
#if PY_VERSION_HEX >= 0x030600B1
        PyExc_ModuleNotFoundError,
#else
        PyExc_ImportError,
#endif
        "No module named '%U'", partial_name);
#endif
bad:
    Py_XDECREF(sep);
    Py_XDECREF(slice);
    Py_XDECREF(partial_name);
    return NULL;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
    PyObject *imported_module;
#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
    PyObject *modules = PyImport_GetModuleDict();
    if (unlikely(!modules))
        return NULL;
    imported_module = __Pyx_PyDict_GetItemStr(modules, name);
    Py_XINCREF(imported_module);
#else
    imported_module = PyImport_GetModule(name);
#endif
    return imported_module;
}
#endif
static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if PY_MAJOR_VERSION < 3
    PyObject *module, *from_list, *star = __pyx_n_s__23;
    CYTHON_UNUSED_VAR(parts_tuple);
    from_list = PyList_New(1);
    if (unlikely(!from_list))
        return NULL;
    Py_INCREF(star);
    PyList_SET_ITEM(from_list, 0, star);
    module = __Pyx_Import(name, from_list, 0);
    Py_DECREF(from_list);
    return module;
#else
    Py_ssize_t i, nparts;
    PyObject *imported_module;
    PyObject *module = __Pyx_Import(name, NULL, 0);
    if (!parts_tuple || unlikely(!module))
        return module;
    imported_module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(imported_module)) {
        Py_DECREF(module);
        return imported_module;
    }
    PyErr_Clear();
    nparts = PyTuple_GET_SIZE(parts_tuple);
    for (i=1; i < nparts && module; i++) {
        PyObject *part, *submodule;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        part = PyTuple_GET_ITEM(parts_tuple, i);
#else
        part = PySequence_ITEM(parts_tuple, i);
#endif
        submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
        Py_DECREF(part);
#endif
        Py_DECREF(module);
        module = submodule;
    }
    if (likely(module))
        return module;
    return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
#endif
}
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
    PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(module)) {
        PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
        if (likely(spec)) {
            PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
            if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
                Py_DECREF(spec);
                spec = NULL;
            }
            Py_XDECREF(unsafe);
        }
        if (likely(!spec)) {
            PyErr_Clear();
            return module;
        }
        Py_DECREF(spec);
        Py_DECREF(module);
    } else if (PyErr_Occurred()) {
        PyErr_Clear();
    }
#endif
    return __Pyx__ImportDottedModule(name, parts_tuple);
}

/* ClassMethod */
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    #if PY_MAJOR_VERSION == 2
    static PyTypeObject *methoddescr_type = NULL;
    if (unlikely(methoddescr_type == NULL)) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (unlikely(!meth)) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    #else
    PyTypeObject *methoddescr_type = &PyMethodDescr_Type;
    #endif
    if (__Pyx_TypeCheck(method, methoddescr_type))
#endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
}

/* GetNameInClass */
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    PyObject *dict;
    assert(PyType_Check(nmspace));
#if CYTHON_USE_TYPE_SLOTS
    dict = ((PyTypeObject*)nmspace)->tp_dict;
    Py_XINCREF(dict);
#else
    dict = PyObject_GetAttr(nmspace, __pyx_n_s_dict);
#endif
    if (likely(dict)) {
        result = PyObject_GetItem(dict, name);
        Py_DECREF(dict);
        if (result) {
            return result;
        }
    }
    PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* PyObjectCall2Args */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectLookupSpecial */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare_2);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
#if PY_VERSION_HEX >= 0x03030000
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
#else
    CYTHON_MAYBE_UNUSED_VAR(qualname);
#endif
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *names_to_set, *key, *value, *set_name, *tmp;
    Py_ssize_t i = 0;
#if CYTHON_USE_TYPE_SLOTS
    names_to_set = PyDict_Copy(type->tp_dict);
#else
    {
        PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict);
        names_to_set = NULL;
        if (likely(d)) {
            PyObject *names_to_set = PyDict_New();
            int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
            Py_DECREF(d);
            if (unlikely(ret < 0))
                Py_CLEAR(names_to_set);
        }
    }
#endif
    if (unlikely(names_to_set == NULL))
        goto bad;
    while (PyDict_Next(names_to_set, &i, &key, &value)) {
        set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name);
        if (unlikely(set_name != NULL)) {
            tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
            Py_DECREF(set_name);
            if (unlikely(tmp == NULL)) {
                __Pyx_TypeName value_type_name =
                    __Pyx_PyType_GetName(Py_TYPE(value));
                __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
                PyErr_Format(PyExc_RuntimeError,
#if PY_MAJOR_VERSION >= 3
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name, key, type_name);
#else
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name,
                    PyString_Check(key) ? PyString_AS_STRING(key) : "?",
                    type_name);
#endif
                goto bad;
            } else {
                Py_DECREF(tmp);
            }
        }
        else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
    Py_DECREF(names_to_set);
    return 0;
bad:
    Py_XDECREF(names_to_set);
    return -1;
}
static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *mro = type->tp_mro;
    Py_ssize_t i, nbases;
    if (unlikely(!mro)) goto done;
    (void) &__Pyx_GetBuiltinName;
    Py_INCREF(mro);
    nbases = PyTuple_GET_SIZE(mro);
    assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
    for (i = 1; i < nbases-1; i++) {
        PyObject *base, *dict, *meth;
        base = PyTuple_GET_ITEM(mro, i);
        dict = ((PyTypeObject *)base)->tp_dict;
        meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
        if (unlikely(meth)) {
            descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
            PyObject *res;
            Py_INCREF(meth);
            if (likely(f)) {
                res = f(meth, NULL, type_obj);
                Py_DECREF(meth);
                if (unlikely(!res)) goto bad;
                meth = res;
            }
            res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
            Py_DECREF(meth);
            if (unlikely(!res)) goto bad;
            Py_DECREF(res);
            goto done;
        } else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
done:
    Py_XDECREF(mro);
    return type_obj;
bad:
    Py_XDECREF(mro);
    Py_DECREF(type_obj);
    return NULL;
#else
    PyObject *super_type, *super, *func, *res;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
#else
    super_type = (PyObject*) &PySuper_Type;
    (void) &__Pyx_GetBuiltinName;
#endif
    super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    Py_XDECREF(super_type);
#endif
    if (unlikely(!super)) {
        Py_CLEAR(type_obj);
        goto done;
    }
    func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
    Py_DECREF(super);
    if (likely(!func)) {
        if (unlikely(PyErr_Occurred()))
            Py_CLEAR(type_obj);
        goto done;
    }
    res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
    Py_DECREF(func);
    if (unlikely(!res))
        Py_CLEAR(type_obj);
    Py_XDECREF(res);
done:
    return type_obj;
#endif
}
#endif
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
#if PY_VERSION_HEX < 0x030600A4
        (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
#else
        mkw
#endif
    );
    Py_XDECREF(owned_metaclass);
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
    if (likely(result) && likely(PyType_Check(result))) {
        if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
            Py_CLEAR(result);
        } else {
            result = __Pyx_InitSubclassPEP487(result, mkw);
        }
    }
#else
    (void) &__Pyx_GetBuiltinName;
#endif
    return result;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}
#endif

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    _PyTraceback_Add(funcname, filename, py_line);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);  // XDECREF since it's only set on Py3 if cline
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(int) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if ((sizeof(int) <= sizeof(unsigned long))) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if ((sizeof(int) <= sizeof(long))) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if (CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(long) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if ((sizeof(long) <= sizeof(unsigned long))) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if ((sizeof(long) <= sizeof(long))) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if (CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PY_LONG_LONG) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PGPing(PGPing value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PGPing neg_one = (PGPing) -1, const_zero = (PGPing) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PGPing) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(PGPing) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PGPing) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PGPing) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PGPing) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(PGPing),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ConnStatusType(ConnStatusType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const ConnStatusType neg_one = (ConnStatusType) -1, const_zero = (ConnStatusType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(ConnStatusType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(ConnStatusType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(ConnStatusType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(ConnStatusType) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(ConnStatusType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(ConnStatusType),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PGTransactionStatusType(PGTransactionStatusType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PGTransactionStatusType neg_one = (PGTransactionStatusType) -1, const_zero = (PGTransactionStatusType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PGTransactionStatusType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(PGTransactionStatusType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PGTransactionStatusType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PGTransactionStatusType) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PGTransactionStatusType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(PGTransactionStatusType),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
static CYTHON_INLINE Oid __Pyx_PyInt_As_Oid(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Oid neg_one = (Oid) -1, const_zero = (Oid) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(Oid) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(Oid, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (Oid) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Oid) 0;
                case  1: __PYX_VERIFY_RETURN_INT(Oid, digit, digits[0])
                case 2:
                    if ((8 * sizeof(Oid) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Oid, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Oid) >= 2 * PyLong_SHIFT)) {
                            return (Oid) (((((Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Oid) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Oid, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Oid) >= 3 * PyLong_SHIFT)) {
                            return (Oid) (((((((Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Oid) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Oid, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Oid) >= 4 * PyLong_SHIFT)) {
                            return (Oid) (((((((((Oid)digits[3]) << PyLong_SHIFT) | (Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (Oid) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if ((sizeof(Oid) <= sizeof(unsigned long))) {
                __PYX_VERIFY_RETURN_INT_EXC(Oid, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(Oid) <= sizeof(unsigned PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(Oid, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Oid) 0;
                case -1: __PYX_VERIFY_RETURN_INT(Oid, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(Oid,  digit, +digits[0])
                case -2:
                    if ((8 * sizeof(Oid) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Oid, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Oid) - 1 > 2 * PyLong_SHIFT)) {
                            return (Oid) (((Oid)-1)*(((((Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(Oid) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Oid, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Oid) - 1 > 2 * PyLong_SHIFT)) {
                            return (Oid) ((((((Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(Oid) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Oid, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Oid) - 1 > 3 * PyLong_SHIFT)) {
                            return (Oid) (((Oid)-1)*(((((((Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(Oid) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Oid, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Oid) - 1 > 3 * PyLong_SHIFT)) {
                            return (Oid) ((((((((Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(Oid) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Oid, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Oid) - 1 > 4 * PyLong_SHIFT)) {
                            return (Oid) (((Oid)-1)*(((((((((Oid)digits[3]) << PyLong_SHIFT) | (Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(Oid) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(Oid, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(Oid) - 1 > 4 * PyLong_SHIFT)) {
                            return (Oid) ((((((((((Oid)digits[3]) << PyLong_SHIFT) | (Oid)digits[2]) << PyLong_SHIFT) | (Oid)digits[1]) << PyLong_SHIFT) | (Oid)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if ((sizeof(Oid) <= sizeof(long))) {
                __PYX_VERIFY_RETURN_INT_EXC(Oid, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(Oid) <= sizeof(PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(Oid, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if (CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available, cannot convert large numbers");
#else
            Oid val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (Oid) -1;
        }
    } else {
        Oid val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (Oid) -1;
        val = __Pyx_PyInt_As_Oid(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Oid");
    return (Oid) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Oid");
    return (Oid) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PGpipelineStatus(PGpipelineStatus value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PGpipelineStatus neg_one = (PGpipelineStatus) -1, const_zero = (PGpipelineStatus) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PGpipelineStatus) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(PGpipelineStatus) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PGpipelineStatus) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PGpipelineStatus) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PGpipelineStatus) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(PGpipelineStatus),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ExecStatusType(ExecStatusType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const ExecStatusType neg_one = (ExecStatusType) -1, const_zero = (ExecStatusType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(ExecStatusType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(ExecStatusType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(ExecStatusType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(ExecStatusType) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(ExecStatusType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(ExecStatusType),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Oid(Oid value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Oid neg_one = (Oid) -1, const_zero = (Oid) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Oid) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Oid) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Oid) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Oid) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Oid) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Oid),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API
static __Pyx_TypeName
__Pyx_PyType_GetName(PyTypeObject* tp)
{
    PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_n_s_name_2);
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
        PyErr_Clear();
        Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__130));
    }
    return name;
}
#endif

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[5];
    int same=1, i, found_dot;
    const char* rt_from_call = Py_GetVersion();
    PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    found_dot = 0;
    for (i = 0; i < 4; i++) {
        if (!ctversion[i]) {
            same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
            break;
        }
        if (rt_from_call[i] != ctversion[i]) {
            same = 0;
            break;
        }
    }
    if (!same) {
        char rtversion[5] = {'\0'};
        char message[200];
        for (i=0; i<4; ++i) {
            if (rt_from_call[i] == '.') {
                if (found_dot) break;
                found_dot = 1;
            } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
                break;
            }
            rtversion[i] = rt_from_call[i];
        }
        PyOS_snprintf(message, sizeof(message),
                      "compile time version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* FunctionExport */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
    cobj = PyCapsule_New(tmp.p, sig, 0);
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* InitStrings */
#if PY_MAJOR_VERSION >= 3
static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
    if (t.is_unicode | t.is_str) {
        if (t.intern) {
            *str = PyUnicode_InternFromString(t.s);
        } else if (t.encoding) {
            *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
        } else {
            *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
        }
    } else {
        *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
    }
    if (!*str)
        return -1;
    if (PyObject_Hash(*str) == -1)
        return -1;
    return 0;
}
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION >= 3
        __Pyx_InitString(*t, t->p);
        #else
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        #endif
        ++t;
    }
    return 0;
}
#endif

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
                 type_name, type_name, result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


/* #### Code section: utility_code_pragmas_end ### */
#if _MSV_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
