/* Generated by Cython 3.2.2 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [],
        "include_dirs": [
            "/usr/include"
        ],
        "libraries": [
            "pq"
        ],
        "library_dirs": [
            "/usr/lib"
        ],
        "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 */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API)
  #if !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
  #endif
#elif defined(CYTHON_LIMITED_API)
  #ifdef _MSC_VER
  #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
  #else
  #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
  #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 < 0x03080000
    #error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_2_2"
#define CYTHON_HEX_VERSION 0x030202F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#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 PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#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_CPYTHON_FREETHREADING 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
  #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_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 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 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#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_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #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_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #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
  #if PY_VERSION_HEX < 0x03090000
    #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
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 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_NUM >= 0x07031100)
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #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_CPYTHON_FREETHREADING 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_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
  #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 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 (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef 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
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #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
  #ifndef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 1
  #endif
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 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
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(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
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || 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
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef 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
  #ifndef CYTHON_USE_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef 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
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
  #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
    #undef CYTHON_IMMORTAL_CONSTANTS
    #define CYTHON_IMMORTAL_CONSTANTS 0  // definitely won't work
  #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
    #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_COMPRESS_STRINGS
  #define CYTHON_COMPRESS_STRINGS 1
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL  CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL  (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL)
#endif
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #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(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #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 && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#include <stdint.h>
typedef uintptr_t  __pyx_uintptr_t;
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #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 Py_UNREACHABLE
  #define Py_UNREACHABLE()  assert(0); abort()
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

/* CInitCode */
#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

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#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))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#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 Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef Py_TPFLAGS_IMMUTABLETYPE
  #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
#endif
#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
  #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#ifndef 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
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#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))
#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_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  #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_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _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 >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
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;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#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
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && 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 !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)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)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 __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #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))
#else
  #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_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, (Py_UCS4) 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
#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)
    #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_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#elif 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
enum __Pyx_ReferenceSharing {
  __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
  __Pyx_ReferenceSharing_OwnStrongReference,
  __Pyx_ReferenceSharing_FunctionArgument,
  __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
};
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
    (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
      (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
      (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
#else
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  #endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #else
    #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
  #endif
#else
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
    __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
#else
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #ifndef _USE_MATH_DEFINES
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#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; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifdef CYTHON_EXTERN_C
    #undef __PYX_EXTERN_C
    #define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
    #ifdef _MSC_VER
    #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
    #else
    #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
    #endif
#else
  #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 "stdio.h"
#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
#define PQsetTraceFlags(conn, stream) do {} while (0)
#endif

#if PG_VERSION_NUM < 160000
#define PQconnectionUsedGSSAPI(conn) 0
#endif

#if PG_VERSION_NUM < 170000
typedef struct pg_cancel_conn PGcancelConn;
#define PQchangePassword(conn, user, passwd) NULL
#define PQclosePrepared(conn, name) NULL
#define PQclosePortal(conn, name) NULL
#define PQsendClosePrepared(conn, name) 0
#define PQsendClosePortal(conn, name) 0
#define PQcancelCreate(conn) NULL
#define PQcancelStart(cancelConn) 0
#define PQcancelBlocking(cancelConn) 0
#define PQcancelPoll(cancelConn) CONNECTION_OK
#define PQcancelStatus(cancelConn) 0
#define PQcancelSocket(cancelConn) -1
#define PQcancelErrorMessage(cancelConn) NULL
#define PQcancelReset(cancelConn) 0
#define PQcancelFinish(cancelConn) 0
#define PQsetChunkedRowsMode(conn, chunkSize) 0
#endif

#if PG_VERSION_NUM < 180000
#define PQfullProtocolVersion(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

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#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 Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#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 CYTHON_ASSUME_SAFE_MACROS
    #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_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#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_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
    return Py_NewRef(obj);
#else
    Py_INCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
    return Py_XNewRef(obj);
#else
    Py_XINCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
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_Long(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_PyLong_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))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#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__ */
/* PretendToInitialize */
#ifdef __cplusplus
#if __cplusplus > 201103L
#include <type_traits>
#endif
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
    if ((std::is_trivially_default_constructible<T>::value))
#endif
        *ptr = T();
    (void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif


#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * const __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

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

static const char* const __pyx_f[] = {
  "psycopg_c/pq.pyx",
  "psycopg_c/pq/pgconn.pyx",
  "<stringsource>",
  "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",
  "cpython/type.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto (used by UnpackUnboundCMethod) */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_ptr_type void*
    #define __pyx_nonatomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #define __pyx_nonatomic_ptr_type void*
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif

/* CriticalSectionsDefinition.proto (used by CriticalSections) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_End(cs)
#define __Pyx_PyCriticalSection2_End(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_End PyCriticalSection_End
#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
#endif

/* CriticalSections.proto (used by ParseKeywordsImpl) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
#else
#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif

/* 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

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

/* #### 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_PGcancelConn;
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____etc;
typedef struct __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____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":766
 * 
 * 
 * cdef (Py_ssize_t, libpq.Oid *, char * const*, int *, int *) _query_params_args(             # <<<<<<<<<<<<<<
 *     param_values: Sequence[bytes | None] | None,
 *     param_types: Sequence[int] | None,
*/
struct __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____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":34
 * 
 * 
 * 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":41
 * 
 * 
 * cdef class PGcancelConn:             # <<<<<<<<<<<<<<
 *     cdef libpq.PGcancelConn* pgcancelconn_ptr
 * 
*/
struct __pyx_obj_9psycopg_c_2pq_PGcancelConn {
  PyObject_HEAD
  struct __pyx_vtabstruct_9psycopg_c_2pq_PGcancelConn *__pyx_vtab;
  PGcancelConn *pgcancelconn_ptr;
};


/* "psycopg_c/pq.pxd":48
 * 
 * 
 * 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":55
 * 
 * 
 * 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":65
 * 
 * 
 * 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":73
 * 
 * 
 * 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":47
 *         )
 * 
 * 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 *);
  int (*flush)(struct __pyx_obj_9psycopg_c_2pq_PGconn *, int __pyx_skip_dispatch);
  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":14
 * 
 * 
 * @cython.freelist(8)             # <<<<<<<<<<<<<<
 * cdef class PGresult:
 *     def __cinit__(self):
*/

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 PGcancelConn:             # <<<<<<<<<<<<<<
 *     def __cinit__(self):
 *         self.pgcancelconn_ptr = NULL
*/

struct __pyx_vtabstruct_9psycopg_c_2pq_PGcancelConn {
  struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *(*_from_ptr)(PGcancelConn *);
};
static struct __pyx_vtabstruct_9psycopg_c_2pq_PGcancelConn *__pyx_vtabptr_9psycopg_c_2pq_PGcancelConn;


/* "psycopg_c/pq/pgcancel.pyx":79
 * 
 * 
 * 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":11
 * 
 * 
 * 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":13
 * 
 * 
 * @cython.freelist(32)             # <<<<<<<<<<<<<<
 * cdef class PQBuffer:
 *     """
*/

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":56
 * 
 * 
 * @cython.freelist(32)             # <<<<<<<<<<<<<<
 * cdef class ViewBuffer:
 *     """
*/

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;
  #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);\
          }
  #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 (used by PyObjectGetAttrStrNoError) */
#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 (used by PyErrFetchRestore) */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto (used by PyObjectGetAttrStrNoError) */
#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 && PY_VERSION_HEX < 0x030C00A6
#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 (used by PyObjectGetAttrStrNoError) */
#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 (used by GetBuiltinName) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

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

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

/* IncludeStringH.proto (used by BytesEquals) */
#include <string.h>

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

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

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#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_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_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);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_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
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* PyDictVersioning.proto (used by GetModuleGlobalName) */
#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_XNewRef(__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)  do {\
    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_mstate_global->__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);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  do {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
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

/* 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 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

/* PyObjectCall.proto (used by PyObjectFastCall) */
#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 (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */
#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 * const*args, size_t nargs, PyObject *kwargs);

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

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

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

/* 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);

/* py_dict_items.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

/* CallCFunction.proto (used by CallUnboundCMethod0) */
#define __Pyx_CallCFunction(cfunc, self, args)\
    ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
    ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
    ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
    ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)

/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
typedef struct {
    PyObject *type;
    PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
    return 1;
#else
    __pyx_nonatomic_int_type expected = 0;
    if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
        return 0;
    }
    return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
    __pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif

/* CallUnboundCMethod0.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* py_dict_values.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);

/* OwnedDictNext.proto (used by RejectKeywords) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
#else
CYTHON_INLINE
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
#endif

/* RejectKeywords.export */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);

/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif

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

/* 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

/* PyMemoryError_Check.proto */
#define __Pyx_PyExc_MemoryError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_MemoryError)

/* pyint_simplify.proto */
static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none);

/* AssertionsEnabled.proto */
#if CYTHON_COMPILING_IN_LIMITED_API  ||  PY_VERSION_HEX >= 0x030C0000
  static int __pyx_assertions_enabled_flag;
  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
  #if __clang__ || __GNUC__
  __attribute__((no_sanitize("thread")))
  #endif
  static int __Pyx_init_assertions_enabled(void) {
    PyObject *builtins, *debug, *debug_str;
    int flag;
    builtins = PyEval_GetBuiltins();
    if (!builtins) goto bad;
    debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
    if (!debug_str) goto bad;
    debug = PyObject_GetItem(builtins, debug_str);
    Py_DECREF(debug_str);
    if (!debug) goto bad;
    flag = PyObject_IsTrue(debug);
    Py_DECREF(debug);
    if (flag == -1) goto bad;
    __pyx_assertions_enabled_flag = flag;
    return 0;
  bad:
    __pyx_assertions_enabled_flag = 1;
    return -1;
  }
#else
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (!Py_OptimizeFlag)
#endif

/* PyAssertionError_Check.proto */
#define __Pyx_PyExc_AssertionError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_AssertionError)

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

/* ParseKeywordsImpl.export */
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name
);
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

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

/* ArgTypeTestFunc.export */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* 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))

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

/* RaiseUnboundLocalError.proto */
static void __Pyx_RaiseUnboundLocalError(const char *varname);

/* PyTypeError_Check.proto */
#define __Pyx_PyExc_TypeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_TypeError)

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

/* GetTopmostException.proto (used by SaveResetException) */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
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

/* PyValueError_Check.proto */
#define __Pyx_PyExc_ValueError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ValueError)

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

/* COrdinalToPyUnicode.proto (used by CIntToPyUnicode) */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);

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

/* IncludeStdlibH.proto (used by CIntToPyUnicode) */
#include <stdlib.h>

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\
    (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, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
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, int unsafe_shared);

/* decode_c_string_utf16.proto (used by decode_c_string) */
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);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __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

/* PyObjectVectorCallKwBuilder.proto */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif

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

/* AllocateExtensionType.proto */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);

/* CallTypeTraverse.proto */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif

/* CheckTypeForFreelists.proto */
#if CYTHON_USE_FREELISTS
#if CYTHON_USE_TYPE_SPECS
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  Py_TPFLAGS_IS_ABSTRACT
#else
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)
#endif
#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\
    (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\
     (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS)))
#endif

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

/* GetApiDict.proto */
static PyObject *__Pyx_ApiExport_GetApiDict(void);

/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif

/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

/* FixUpExtensionType.proto */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);

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

/* PyObjectGetMethod.proto (used by PyObjectCallMethod0) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
#endif

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

/* ValidateBasesTuple.proto (used by PyType_Ready) */
#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 */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

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

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

/* MergeVTables.proto */
static int __Pyx_MergeVtables(PyTypeObject *type);

/* DelItemOnTypeDict.proto (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_2_2
#define __PYX_HAVE_RT_ImportType_proto_3_2_2
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_2(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_2(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_2_2 {
   __Pyx_ImportType_CheckSize_Error_3_2_2 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_2_2 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_2_2 = 2
};
static PyTypeObject *__Pyx_ImportType_3_2_2(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_2 check_size);
#endif

/* HasAttr.proto (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n)  PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif

/* ImportImpl.export */
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);

/* Import.proto */
static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);

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

/* dict_setdefault.proto (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);

/* AddModuleRef.proto (used by FetchSharedCythonModule) */
#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\
     __PYX_LIMITED_VERSION_HEX < 0x030d0000)
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
#else
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#endif

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

/* FetchCommonType.proto (used by CommonTypesMetaclass) */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);

/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED

/* PyMethodNew.proto (used by CythonFunctionShared) */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);

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

/* CythonFunctionShared.proto (used by CythonFunction) */
#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 || CYTHON_COMPILING_IN_LIMITED_API
  #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 CYTHON_COMPILING_IN_LIMITED_API
    PyObject_HEAD
    PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_dict;
#endif
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    PyObject *defaults;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
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 PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
                                                         PyTypeObject *defaults_type);
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_COMPILING_IN_LIMITED_API
#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);

/* ClassMethod.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
#include "descrobject.h"
#endif
CYTHON_UNUSED static 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 < 0x030d0000
#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 (used by Py3ClassCreate) */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

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

/* PyObjectLookupSpecial.proto (used by Py3ClassCreate) */
#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 (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#else
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#endif

/* CodeObjectCache.proto (used by AddTraceback) */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
    __Pyx_CachedCodeObjectType* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_int_type accessor_count;
  #endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);

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

/* CheckUnpickleChecksum.proto */
static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);

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

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

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

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

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

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

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

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

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

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PostgresPollingStatusType(PostgresPollingStatusType value);

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

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* UpdateUnpickledDict.proto */
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
#else
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#endif
#else  // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(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)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
    return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#ifdef PyExceptionInstance_Check
  #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
  #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif

/* GetRuntimeVersion.proto */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
static unsigned long __Pyx_cached_runtime_version = 0;
static void __Pyx_init_runtime_version(void);
#else
#define __Pyx_init_runtime_version()
#endif
static unsigned long __Pyx_get_runtime_version(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

/* DecompressString.proto */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);

/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif

/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
    #if CYTHON_METH_FASTCALL
        #define __PYX_FASTCALL_ABI_SUFFIX  "_fastcall"
    #else
        #define __PYX_FASTCALL_ABI_SUFFIX
    #endif
    #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
    #define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    #define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
    #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
    #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
    #define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
    #define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
    #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
    #define __PYX_FREELISTS_ABI_SUFFIX
#else
    #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#define CYTHON_ABI  __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."

static struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_f_9psycopg_c_2pq_6PGconn__from_ptr(PGconn *__pyx_v_ptr); /* proto*/
static int __pyx_f_9psycopg_c_2pq_6PGconn_flush(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, int __pyx_skip_dispatch); /* 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_PGcancelConn *__pyx_f_9psycopg_c_2pq_12PGcancelConn__from_ptr(PGcancelConn *__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" */

/* Module declarations from "libc.string" */

/* Module declarations from "libc.stdio" */

/* Module declarations from "cpython.mem" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.type" */

/* Module declarations from "cpython" */

/* Module declarations from "cpython.object" */

/* Module declarations from "cpython.bytes" */

/* Module declarations from "cpython.sequence" */

/* Module declarations from "cpython.memoryview" */

/* Module declarations from "cython" */

/* Module declarations from "cpython.buffer" */

/* Module declarations from "psycopg_c.pq" */
static int __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(PyObject *, char **, Py_ssize_t *); /*proto*/
static PyObject *__pyx_f_9psycopg_c_2pq__check_supported(PyObject *, int); /*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____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;
/* #### Code section: string_decls ### */
static const char __pyx_k_w[] = "w";
static const char __pyx_k_UTF8[] = "UTF8";
static const char __pyx_k_conn[] = "conn";
static const char __pyx_k_ignore[] = "ignore";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_client_encoding[] = "client_encoding";
static const char __pyx_k_libpq_Python_wrapper_using_cyth[] = "\nlibpq Python wrapper using cython bindings.\n";
/* #### 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_24get_error_message(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_9_encoding___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_21full_protocol_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_11used_gssapi___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_26exec_(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_command); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_28send_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_30exec_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_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_34send_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_36send_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_38prepare(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_40exec_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_42describe_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_44send_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_46describe_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_48send_describe_portal(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_50close_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_52send_close_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_54close_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_56send_close_portal(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_58get_result(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_60consume_input(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_62is_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_64flush(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_66set_single_row_mode(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_68set_chunked_rows_mode(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_pf_9psycopg_c_2pq_6PGconn_70cancel_conn(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_72get_cancel(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_74notifies(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_76put_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_78put_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_80get_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_82trace(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_fileno); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_84set_trace_flags(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_flags); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_86untrace(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_88encrypt_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 PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_90change_password(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_user, char const *__pyx_v_passwd); /* proto */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_92make_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_94enter_pipeline_mode(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_96exit_pipeline_mode(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_98pipeline_sync(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_100send_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_102__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_104__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_8get_error_message(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_10error_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_12fname(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_14ftable(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_16ftablecol(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_18fformat(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_20ftype(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_22fmod(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, int __pyx_v_column_number); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_24fsize(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_26get_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_28param_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_30set_attributes(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, PyObject *__pyx_v_descriptions); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_34__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_12PGcancelConn___cinit__(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static void __pyx_pf_9psycopg_c_2pq_12PGcancelConn_2__dealloc__(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_4start(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_6blocking(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_8poll(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_6status___get__(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_6socket___get__(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_13error_message___get__(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_10get_error_message(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_12reset(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_14finish(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_16_ensure_pgcancelconn(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__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_PGcancelConn(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*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#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

typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  PyObject *__pyx_type_9psycopg_c_2pq_PGconn;
  PyObject *__pyx_type_9psycopg_c_2pq_PGresult;
  PyObject *__pyx_type_9psycopg_c_2pq_PGcancelConn;
  PyObject *__pyx_type_9psycopg_c_2pq_PGcancel;
  PyObject *__pyx_type_9psycopg_c_2pq_Escaping;
  PyObject *__pyx_type_9psycopg_c_2pq_PQBuffer;
  PyObject *__pyx_type_9psycopg_c_2pq_ViewBuffer;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PGconn;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PGresult;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PGcancelConn;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PGcancel;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_Escaping;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_PQBuffer;
  PyTypeObject *__pyx_ptype_9psycopg_c_2pq_ViewBuffer;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
  int __pyx_k__6;
  int __pyx_k__7;
  int __pyx_k__8;
  int __pyx_k__9;
  PyObject *__pyx_tuple[5];
  PyObject *__pyx_codeobj_tab[94];
  PyObject *__pyx_string_tab[522];
  PyObject *__pyx_number_tab[1];
/* #### Code section: module_state_contents ### */

#if CYTHON_USE_FREELISTS
struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_freelist_9psycopg_c_2pq_PGresult[8];
int __pyx_freecount_9psycopg_c_2pq_PGresult;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_9psycopg_c_2pq_PQBuffer *__pyx_freelist_9psycopg_c_2pq_PQBuffer[32];
int __pyx_freecount_9psycopg_c_2pq_PQBuffer;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *__pyx_freelist_9psycopg_c_2pq_ViewBuffer[32];
int __pyx_freecount_9psycopg_c_2pq_ViewBuffer;
#endif
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif

/* CythonFunctionShared.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;

/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;

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

#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_ __pyx_string_tab[0]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[1]
#define __pyx_kp_u_PGresult_None __pyx_string_tab[2]
#define __pyx_kp_u_PQsendFlushRequest __pyx_string_tab[3]
#define __pyx_kp_u_PQsetResultAttrs_failed __pyx_string_tab[4]
#define __pyx_kp_u_Sequence_bytes_None __pyx_string_tab[5]
#define __pyx_kp_u_Sequence_bytes_None_None __pyx_string_tab[6]
#define __pyx_kp_u_Sequence_int_None __pyx_string_tab[7]
#define __pyx_kp_u__10 __pyx_string_tab[8]
#define __pyx_kp_u__11 __pyx_string_tab[9]
#define __pyx_kp_u__12 __pyx_string_tab[10]
#define __pyx_kp_u__13 __pyx_string_tab[11]
#define __pyx_kp_u__14 __pyx_string_tab[12]
#define __pyx_kp_u__15 __pyx_string_tab[13]
#define __pyx_kp_u__2 __pyx_string_tab[14]
#define __pyx_kp_u__3 __pyx_string_tab[15]
#define __pyx_kp_u__4 __pyx_string_tab[16]
#define __pyx_kp_u__5 __pyx_string_tab[17]
#define __pyx_kp_u_add_note __pyx_string_tab[18]
#define __pyx_kp_u_at_0x __pyx_string_tab[19]
#define __pyx_kp_u_at_0x_2 __pyx_string_tab[20]
#define __pyx_kp_u_available_instead __pyx_string_tab[21]
#define __pyx_kp_u_bytes __pyx_string_tab[22]
#define __pyx_kp_u_bytes_None __pyx_string_tab[23]
#define __pyx_kp_u_bytes_or_buffer_expected_got __pyx_string_tab[24]
#define __pyx_kp_u_cancel_connection_not_opened __pyx_string_tab[25]
#define __pyx_kp_u_cancel_failed __pyx_string_tab[26]
#define __pyx_kp_u_close_prepared_failed __pyx_string_tab[27]
#define __pyx_kp_u_connection_not_in_pipeline_mode __pyx_string_tab[28]
#define __pyx_kp_u_consuming_input_failed __pyx_string_tab[29]
#define __pyx_kp_u_couldn_t_allocate_PGconn __pyx_string_tab[30]
#define __pyx_kp_u_couldn_t_allocate_connection_def __pyx_string_tab[31]
#define __pyx_kp_u_couldn_t_allocate_connection_inf __pyx_string_tab[32]
#define __pyx_kp_u_couldn_t_allocate_empty_PGresult __pyx_string_tab[33]
#define __pyx_kp_u_couldn_t_allocate_for_escape_byt __pyx_string_tab[34]
#define __pyx_kp_u_couldn_t_allocate_for_unescape_b __pyx_string_tab[35]
#define __pyx_kp_u_couldn_t_allocate_on_conninfo_pa __pyx_string_tab[36]
#define __pyx_kp_u_couldn_t_create_cancelConn_objec __pyx_string_tab[37]
#define __pyx_kp_u_couldn_t_create_cancel_object __pyx_string_tab[38]
#define __pyx_kp_u_couldn_t_reset_connection __pyx_string_tab[39]
#define __pyx_kp_u_couldn_t_send_cancellation __pyx_string_tab[40]
#define __pyx_kp_u_currently_only_supported_on_Linu __pyx_string_tab[41]
#define __pyx_kp_u_describe_prepared_failed __pyx_string_tab[42]
#define __pyx_kp_u_disable __pyx_string_tab[43]
#define __pyx_kp_u_enable __pyx_string_tab[44]
#define __pyx_kp_u_error_in_notice_receiver_s __pyx_string_tab[45]
#define __pyx_kp_u_escape_identifier_failed __pyx_string_tab[46]
#define __pyx_kp_u_escape_identifier_failed_no_conn __pyx_string_tab[47]
#define __pyx_kp_u_escape_literal_failed __pyx_string_tab[48]
#define __pyx_kp_u_escape_literal_failed_no_connect __pyx_string_tab[49]
#define __pyx_kp_u_escape_string_failed __pyx_string_tab[50]
#define __pyx_kp_u_executing_prepared_query_failed __pyx_string_tab[51]
#define __pyx_kp_u_executing_query_failed __pyx_string_tab[52]
#define __pyx_kp_u_failed_to_enter_pipeline_mode __pyx_string_tab[53]
#define __pyx_kp_u_failed_to_sync_pipeline __pyx_string_tab[54]
#define __pyx_kp_u_flush_request_failed __pyx_string_tab[55]
#define __pyx_kp_u_flushing_failed __pyx_string_tab[56]
#define __pyx_kp_u_flushing_failed_the_connection_i __pyx_string_tab[57]
#define __pyx_kp_u_gc __pyx_string_tab[58]
#define __pyx_kp_u_got __pyx_string_tab[59]
#define __pyx_kp_u_isenabled __pyx_string_tab[60]
#define __pyx_kp_u_list_ConninfoOption __pyx_string_tab[61]
#define __pyx_kp_u_list_PGresAttDesc __pyx_string_tab[62]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[63]
#define __pyx_kp_u_on_the_client_version __pyx_string_tab[64]
#define __pyx_kp_u_param_formats_2 __pyx_string_tab[65]
#define __pyx_kp_u_param_types_2 __pyx_string_tab[66]
#define __pyx_kp_u_param_values_but __pyx_string_tab[67]
#define __pyx_kp_u_password_encryption_failed __pyx_string_tab[68]
#define __pyx_kp_u_preparing_query_failed __pyx_string_tab[69]
#define __pyx_kp_u_psycopg_c_pq_conninfo_pyx __pyx_string_tab[70]
#define __pyx_kp_u_psycopg_c_pq_escaping_pyx __pyx_string_tab[71]
#define __pyx_kp_u_psycopg_c_pq_pgcancel_pyx __pyx_string_tab[72]
#define __pyx_kp_u_psycopg_c_pq_pgconn_pyx __pyx_string_tab[73]
#define __pyx_kp_u_psycopg_c_pq_pgresult_pyx __pyx_string_tab[74]
#define __pyx_kp_u_psycopg_c_pq_pyx __pyx_string_tab[75]
#define __pyx_kp_u_receiving_copy_data_failed __pyx_string_tab[76]
#define __pyx_kp_u_requires_libpq_from_PostgreSQL __pyx_string_tab[77]
#define __pyx_kp_u_self_conn_is_not_None __pyx_string_tab[78]
#define __pyx_kp_u_sending_close_prepared_failed __pyx_string_tab[79]
#define __pyx_kp_u_sending_copy_data_failed __pyx_string_tab[80]
#define __pyx_kp_u_sending_copy_end_failed __pyx_string_tab[81]
#define __pyx_kp_u_sending_describe_prepared_failed __pyx_string_tab[82]
#define __pyx_kp_u_sending_prepared_query_failed __pyx_string_tab[83]
#define __pyx_kp_u_sending_query_and_params_failed __pyx_string_tab[84]
#define __pyx_kp_u_sending_query_failed __pyx_string_tab[85]
#define __pyx_kp_u_setting_chunked_rows_mode_failed __pyx_string_tab[86]
#define __pyx_kp_u_setting_nonblocking_failed __pyx_string_tab[87]
#define __pyx_kp_u_setting_single_row_mode_failed __pyx_string_tab[88]
#define __pyx_kp_u_stringsource __pyx_string_tab[89]
#define __pyx_kp_u_the_cancel_connection_is_closed __pyx_string_tab[90]
#define __pyx_kp_u_the_connection_is_closed __pyx_string_tab[91]
#define __pyx_kp_u_the_connection_is_lost __pyx_string_tab[92]
#define __pyx_kp_u_tuple_int_memoryview __pyx_string_tab[93]
#define __pyx_kp_u_utf_8 __pyx_string_tab[94]
#define __pyx_n_u_COMMAND_OK __pyx_string_tab[95]
#define __pyx_n_u_Conninfo __pyx_string_tab[96]
#define __pyx_n_u_ConninfoOption __pyx_string_tab[97]
#define __pyx_n_u_Conninfo___repr __pyx_string_tab[98]
#define __pyx_n_u_Conninfo_get_defaults __pyx_string_tab[99]
#define __pyx_n_u_Conninfo_parse __pyx_string_tab[100]
#define __pyx_n_u_Escaping __pyx_string_tab[101]
#define __pyx_n_u_Escaping___reduce_cython __pyx_string_tab[102]
#define __pyx_n_u_Escaping___setstate_cython __pyx_string_tab[103]
#define __pyx_n_u_Escaping_escape_bytea __pyx_string_tab[104]
#define __pyx_n_u_Escaping_escape_identifier __pyx_string_tab[105]
#define __pyx_n_u_Escaping_escape_literal __pyx_string_tab[106]
#define __pyx_n_u_Escaping_escape_string __pyx_string_tab[107]
#define __pyx_n_u_Escaping_unescape_bytea __pyx_string_tab[108]
#define __pyx_n_u_ExecStatus __pyx_string_tab[109]
#define __pyx_n_u_Format __pyx_string_tab[110]
#define __pyx_n_u_None __pyx_string_tab[111]
#define __pyx_n_u_NotSupportedError __pyx_string_tab[112]
#define __pyx_n_u_OperationalError __pyx_string_tab[113]
#define __pyx_n_u_PGcancel __pyx_string_tab[114]
#define __pyx_n_u_PGcancelConn __pyx_string_tab[115]
#define __pyx_n_u_PGcancelConn___reduce_cython __pyx_string_tab[116]
#define __pyx_n_u_PGcancelConn___setstate_cython __pyx_string_tab[117]
#define __pyx_n_u_PGcancelConn__ensure_pgcancelcon __pyx_string_tab[118]
#define __pyx_n_u_PGcancelConn_blocking __pyx_string_tab[119]
#define __pyx_n_u_PGcancelConn_finish __pyx_string_tab[120]
#define __pyx_n_u_PGcancelConn_get_error_message __pyx_string_tab[121]
#define __pyx_n_u_PGcancelConn_poll __pyx_string_tab[122]
#define __pyx_n_u_PGcancelConn_reset __pyx_string_tab[123]
#define __pyx_n_u_PGcancelConn_start __pyx_string_tab[124]
#define __pyx_n_u_PGcancel___reduce_cython __pyx_string_tab[125]
#define __pyx_n_u_PGcancel___setstate_cython __pyx_string_tab[126]
#define __pyx_n_u_PGcancel_cancel __pyx_string_tab[127]
#define __pyx_n_u_PGcancel_free __pyx_string_tab[128]
#define __pyx_n_u_PGconn __pyx_string_tab[129]
#define __pyx_n_u_PGconn___reduce_cython __pyx_string_tab[130]
#define __pyx_n_u_PGconn___setstate_cython __pyx_string_tab[131]
#define __pyx_n_u_PGconn_cancel_conn __pyx_string_tab[132]
#define __pyx_n_u_PGconn_change_password __pyx_string_tab[133]
#define __pyx_n_u_PGconn_close_portal __pyx_string_tab[134]
#define __pyx_n_u_PGconn_close_prepared __pyx_string_tab[135]
#define __pyx_n_u_PGconn_connect __pyx_string_tab[136]
#define __pyx_n_u_PGconn_connect_poll __pyx_string_tab[137]
#define __pyx_n_u_PGconn_connect_start __pyx_string_tab[138]
#define __pyx_n_u_PGconn_consume_input __pyx_string_tab[139]
#define __pyx_n_u_PGconn_describe_portal __pyx_string_tab[140]
#define __pyx_n_u_PGconn_describe_prepared __pyx_string_tab[141]
#define __pyx_n_u_PGconn_encrypt_password __pyx_string_tab[142]
#define __pyx_n_u_PGconn_enter_pipeline_mode __pyx_string_tab[143]
#define __pyx_n_u_PGconn_exec __pyx_string_tab[144]
#define __pyx_n_u_PGconn_exec_params __pyx_string_tab[145]
#define __pyx_n_u_PGconn_exec_prepared __pyx_string_tab[146]
#define __pyx_n_u_PGconn_exit_pipeline_mode __pyx_string_tab[147]
#define __pyx_n_u_PGconn_finish __pyx_string_tab[148]
#define __pyx_n_u_PGconn_flush __pyx_string_tab[149]
#define __pyx_n_u_PGconn_get_cancel __pyx_string_tab[150]
#define __pyx_n_u_PGconn_get_copy_data __pyx_string_tab[151]
#define __pyx_n_u_PGconn_get_error_message __pyx_string_tab[152]
#define __pyx_n_u_PGconn_get_result __pyx_string_tab[153]
#define __pyx_n_u_PGconn_is_busy __pyx_string_tab[154]
#define __pyx_n_u_PGconn_make_empty_result __pyx_string_tab[155]
#define __pyx_n_u_PGconn_notifies __pyx_string_tab[156]
#define __pyx_n_u_PGconn_parameter_status __pyx_string_tab[157]
#define __pyx_n_u_PGconn_ping __pyx_string_tab[158]
#define __pyx_n_u_PGconn_pipeline_sync __pyx_string_tab[159]
#define __pyx_n_u_PGconn_prepare __pyx_string_tab[160]
#define __pyx_n_u_PGconn_put_copy_data __pyx_string_tab[161]
#define __pyx_n_u_PGconn_put_copy_end __pyx_string_tab[162]
#define __pyx_n_u_PGconn_reset __pyx_string_tab[163]
#define __pyx_n_u_PGconn_reset_poll __pyx_string_tab[164]
#define __pyx_n_u_PGconn_reset_start __pyx_string_tab[165]
#define __pyx_n_u_PGconn_send_close_portal __pyx_string_tab[166]
#define __pyx_n_u_PGconn_send_close_prepared __pyx_string_tab[167]
#define __pyx_n_u_PGconn_send_describe_portal __pyx_string_tab[168]
#define __pyx_n_u_PGconn_send_describe_prepared __pyx_string_tab[169]
#define __pyx_n_u_PGconn_send_flush_request __pyx_string_tab[170]
#define __pyx_n_u_PGconn_send_prepare __pyx_string_tab[171]
#define __pyx_n_u_PGconn_send_query __pyx_string_tab[172]
#define __pyx_n_u_PGconn_send_query_params __pyx_string_tab[173]
#define __pyx_n_u_PGconn_send_query_prepared __pyx_string_tab[174]
#define __pyx_n_u_PGconn_set_chunked_rows_mode __pyx_string_tab[175]
#define __pyx_n_u_PGconn_set_single_row_mode __pyx_string_tab[176]
#define __pyx_n_u_PGconn_set_trace_flags __pyx_string_tab[177]
#define __pyx_n_u_PGconn_trace __pyx_string_tab[178]
#define __pyx_n_u_PGconn_untrace __pyx_string_tab[179]
#define __pyx_n_u_PGnotify __pyx_string_tab[180]
#define __pyx_n_u_PGresAttDesc __pyx_string_tab[181]
#define __pyx_n_u_PGresult __pyx_string_tab[182]
#define __pyx_n_u_PGresult___reduce_cython __pyx_string_tab[183]
#define __pyx_n_u_PGresult___setstate_cython __pyx_string_tab[184]
#define __pyx_n_u_PGresult_clear __pyx_string_tab[185]
#define __pyx_n_u_PGresult_error_field __pyx_string_tab[186]
#define __pyx_n_u_PGresult_fformat __pyx_string_tab[187]
#define __pyx_n_u_PGresult_fmod __pyx_string_tab[188]
#define __pyx_n_u_PGresult_fname __pyx_string_tab[189]
#define __pyx_n_u_PGresult_fsize __pyx_string_tab[190]
#define __pyx_n_u_PGresult_ftable __pyx_string_tab[191]
#define __pyx_n_u_PGresult_ftablecol __pyx_string_tab[192]
#define __pyx_n_u_PGresult_ftype __pyx_string_tab[193]
#define __pyx_n_u_PGresult_get_error_message __pyx_string_tab[194]
#define __pyx_n_u_PGresult_get_value __pyx_string_tab[195]
#define __pyx_n_u_PGresult_param_type __pyx_string_tab[196]
#define __pyx_n_u_PGresult_set_attributes __pyx_string_tab[197]
#define __pyx_n_u_PQBuffer __pyx_string_tab[198]
#define __pyx_n_u_PQBuffer___reduce_cython __pyx_string_tab[199]
#define __pyx_n_u_PQBuffer___setstate_cython __pyx_string_tab[200]
#define __pyx_n_u_PQcancelCreate __pyx_string_tab[201]
#define __pyx_n_u_PQchangePassword __pyx_string_tab[202]
#define __pyx_n_u_PQclosePortal __pyx_string_tab[203]
#define __pyx_n_u_PQclosePrepared __pyx_string_tab[204]
#define __pyx_n_u_PQconnectionUsedGSSAPI __pyx_string_tab[205]
#define __pyx_n_u_PQencryptPasswordConn __pyx_string_tab[206]
#define __pyx_n_u_PQenterPipelineMode __pyx_string_tab[207]
#define __pyx_n_u_PQexitPipelineMode __pyx_string_tab[208]
#define __pyx_n_u_PQfullProtocolVersion __pyx_string_tab[209]
#define __pyx_n_u_PQhostaddr __pyx_string_tab[210]
#define __pyx_n_u_PQpipelineSync __pyx_string_tab[211]
#define __pyx_n_u_PQsendClosePortal __pyx_string_tab[212]
#define __pyx_n_u_PQsendClosePrepared __pyx_string_tab[213]
#define __pyx_n_u_PQsetTraceFlags __pyx_string_tab[214]
#define __pyx_n_u_PqFormat __pyx_string_tab[215]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[216]
#define __pyx_n_u_TEXT __pyx_string_tab[217]
#define __pyx_n_u_Trace __pyx_string_tab[218]
#define __pyx_n_u_ViewBuffer __pyx_string_tab[219]
#define __pyx_n_u_ViewBuffer___reduce_cython __pyx_string_tab[220]
#define __pyx_n_u_ViewBuffer___setstate_cython __pyx_string_tab[221]
#define __pyx_n_u_algorithm __pyx_string_tab[222]
#define __pyx_n_u_ascii __pyx_string_tab[223]
#define __pyx_n_u_async __pyx_string_tab[224]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[225]
#define __pyx_n_u_attrs __pyx_string_tab[226]
#define __pyx_n_u_atttypmod __pyx_string_tab[227]
#define __pyx_n_u_atypes __pyx_string_tab[228]
#define __pyx_n_u_blocking __pyx_string_tab[229]
#define __pyx_n_u_buf __pyx_string_tab[230]
#define __pyx_n_u_buffer __pyx_string_tab[231]
#define __pyx_n_u_buffer_ptr __pyx_string_tab[232]
#define __pyx_n_u_build_version __pyx_string_tab[233]
#define __pyx_n_u_bytes_2 __pyx_string_tab[234]
#define __pyx_n_u_c __pyx_string_tab[235]
#define __pyx_n_u_calgo __pyx_string_tab[236]
#define __pyx_n_u_cancel __pyx_string_tab[237]
#define __pyx_n_u_cancel_conn __pyx_string_tab[238]
#define __pyx_n_u_cbuffer __pyx_string_tab[239]
#define __pyx_n_u_ccol __pyx_string_tab[240]
#define __pyx_n_u_cerr __pyx_string_tab[241]
#define __pyx_n_u_cformats __pyx_string_tab[242]
#define __pyx_n_u_change_password __pyx_string_tab[243]
#define __pyx_n_u_class __pyx_string_tab[244]
#define __pyx_n_u_clean_error_message __pyx_string_tab[245]
#define __pyx_n_u_clear __pyx_string_tab[246]
#define __pyx_n_u_clengths __pyx_string_tab[247]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[248]
#define __pyx_n_u_close_portal __pyx_string_tab[249]
#define __pyx_n_u_close_prepared __pyx_string_tab[250]
#define __pyx_n_u_cls __pyx_string_tab[251]
#define __pyx_n_u_cnparams __pyx_string_tab[252]
#define __pyx_n_u_column_number __pyx_string_tab[253]
#define __pyx_n_u_columnid __pyx_string_tab[254]
#define __pyx_n_u_command __pyx_string_tab[255]
#define __pyx_n_u_compiled __pyx_string_tab[256]
#define __pyx_n_u_conn __pyx_string_tab[257]
#define __pyx_n_u_connect __pyx_string_tab[258]
#define __pyx_n_u_connect_poll __pyx_string_tab[259]
#define __pyx_n_u_connect_start __pyx_string_tab[260]
#define __pyx_n_u_connection_summary __pyx_string_tab[261]
#define __pyx_n_u_conninfo __pyx_string_tab[262]
#define __pyx_n_u_consume_input __pyx_string_tab[263]
#define __pyx_n_u_crow __pyx_string_tab[264]
#define __pyx_n_u_ctypes __pyx_string_tab[265]
#define __pyx_n_u_cvalues __pyx_string_tab[266]
#define __pyx_n_u_data __pyx_string_tab[267]
#define __pyx_n_u_decode __pyx_string_tab[268]
#define __pyx_n_u_descr __pyx_string_tab[269]
#define __pyx_n_u_describe_portal __pyx_string_tab[270]
#define __pyx_n_u_describe_prepared __pyx_string_tab[271]
#define __pyx_n_u_descriptions __pyx_string_tab[272]
#define __pyx_n_u_dict __pyx_string_tab[273]
#define __pyx_n_u_dict_2 __pyx_string_tab[274]
#define __pyx_n_u_dispchar __pyx_string_tab[275]
#define __pyx_n_u_dispsize __pyx_string_tab[276]
#define __pyx_n_u_doc __pyx_string_tab[277]
#define __pyx_n_u_e __pyx_string_tab[278]
#define __pyx_n_u_encoding __pyx_string_tab[279]
#define __pyx_n_u_encoding_2 __pyx_string_tab[280]
#define __pyx_n_u_encrypt_password __pyx_string_tab[281]
#define __pyx_n_u_ensure_pgcancelconn __pyx_string_tab[282]
#define __pyx_n_u_enter_pipeline_mode __pyx_string_tab[283]
#define __pyx_n_u_envvar __pyx_string_tab[284]
#define __pyx_n_u_errmsg __pyx_string_tab[285]
#define __pyx_n_u_error __pyx_string_tab[286]
#define __pyx_n_u_error_field __pyx_string_tab[287]
#define __pyx_n_u_error_message __pyx_string_tab[288]
#define __pyx_n_u_errors __pyx_string_tab[289]
#define __pyx_n_u_escape_bytea __pyx_string_tab[290]
#define __pyx_n_u_escape_identifier __pyx_string_tab[291]
#define __pyx_n_u_escape_literal __pyx_string_tab[292]
#define __pyx_n_u_escape_string __pyx_string_tab[293]
#define __pyx_n_u_exc __pyx_string_tab[294]
#define __pyx_n_u_exception __pyx_string_tab[295]
#define __pyx_n_u_exec __pyx_string_tab[296]
#define __pyx_n_u_exec_params __pyx_string_tab[297]
#define __pyx_n_u_exec_prepared __pyx_string_tab[298]
#define __pyx_n_u_exec_status __pyx_string_tab[299]
#define __pyx_n_u_exit_pipeline_mode __pyx_string_tab[300]
#define __pyx_n_u_fformat __pyx_string_tab[301]
#define __pyx_n_u_fieldcode __pyx_string_tab[302]
#define __pyx_n_u_fileno __pyx_string_tab[303]
#define __pyx_n_u_finish __pyx_string_tab[304]
#define __pyx_n_u_flags __pyx_string_tab[305]
#define __pyx_n_u_flush __pyx_string_tab[306]
#define __pyx_n_u_fmod __pyx_string_tab[307]
#define __pyx_n_u_fname __pyx_string_tab[308]
#define __pyx_n_u_format __pyx_string_tab[309]
#define __pyx_n_u_free __pyx_string_tab[310]
#define __pyx_n_u_fsize __pyx_string_tab[311]
#define __pyx_n_u_ftable __pyx_string_tab[312]
#define __pyx_n_u_ftablecol __pyx_string_tab[313]
#define __pyx_n_u_ftype __pyx_string_tab[314]
#define __pyx_n_u_func __pyx_string_tab[315]
#define __pyx_n_u_getLogger __pyx_string_tab[316]
#define __pyx_n_u_get_cancel __pyx_string_tab[317]
#define __pyx_n_u_get_copy_data __pyx_string_tab[318]
#define __pyx_n_u_get_defaults __pyx_string_tab[319]
#define __pyx_n_u_get_error_message __pyx_string_tab[320]
#define __pyx_n_u_get_result __pyx_string_tab[321]
#define __pyx_n_u_get_value __pyx_string_tab[322]
#define __pyx_n_u_getstate __pyx_string_tab[323]
#define __pyx_n_u_i __pyx_string_tab[324]
#define __pyx_n_u_id __pyx_string_tab[325]
#define __pyx_n_u_impl __pyx_string_tab[326]
#define __pyx_n_u_int __pyx_string_tab[327]
#define __pyx_n_u_is_busy __pyx_string_tab[328]
#define __pyx_n_u_is_coroutine __pyx_string_tab[329]
#define __pyx_n_u_items __pyx_string_tab[330]
#define __pyx_n_u_keyword __pyx_string_tab[331]
#define __pyx_n_u_label __pyx_string_tab[332]
#define __pyx_n_u_length __pyx_string_tab[333]
#define __pyx_n_u_linux __pyx_string_tab[334]
#define __pyx_n_u_logger __pyx_string_tab[335]
#define __pyx_n_u_logging __pyx_string_tab[336]
#define __pyx_n_u_main __pyx_string_tab[337]
#define __pyx_n_u_make_empty_result __pyx_string_tab[338]
#define __pyx_n_u_metaclass __pyx_string_tab[339]
#define __pyx_n_u_module __pyx_string_tab[340]
#define __pyx_n_u_name __pyx_string_tab[341]
#define __pyx_n_u_name_2 __pyx_string_tab[342]
#define __pyx_n_u_nbytes __pyx_string_tab[343]
#define __pyx_n_u_new __pyx_string_tab[344]
#define __pyx_n_u_notifies __pyx_string_tab[345]
#define __pyx_n_u_nparams __pyx_string_tab[346]
#define __pyx_n_u_num __pyx_string_tab[347]
#define __pyx_n_u_opts __pyx_string_tab[348]
#define __pyx_n_u_out __pyx_string_tab[349]
#define __pyx_n_u_param_formats __pyx_string_tab[350]
#define __pyx_n_u_param_number __pyx_string_tab[351]
#define __pyx_n_u_param_type __pyx_string_tab[352]
#define __pyx_n_u_param_types __pyx_string_tab[353]
#define __pyx_n_u_param_values __pyx_string_tab[354]
#define __pyx_n_u_parameter_status __pyx_string_tab[355]
#define __pyx_n_u_parse __pyx_string_tab[356]
#define __pyx_n_u_passwd __pyx_string_tab[357]
#define __pyx_n_u_pg2pyenc __pyx_string_tab[358]
#define __pyx_n_u_pgconn __pyx_string_tab[359]
#define __pyx_n_u_pgresult __pyx_string_tab[360]
#define __pyx_n_u_ping __pyx_string_tab[361]
#define __pyx_n_u_pipeline_sync __pyx_string_tab[362]
#define __pyx_n_u_platform __pyx_string_tab[363]
#define __pyx_n_u_poll __pyx_string_tab[364]
#define __pyx_n_u_pop __pyx_string_tab[365]
#define __pyx_n_u_prepare __pyx_string_tab[366]
#define __pyx_n_u_prepare_2 __pyx_string_tab[367]
#define __pyx_n_u_psycopg __pyx_string_tab[368]
#define __pyx_n_u_psycopg__encodings __pyx_string_tab[369]
#define __pyx_n_u_psycopg_c_pq __pyx_string_tab[370]
#define __pyx_n_u_psycopg_pq __pyx_string_tab[371]
#define __pyx_n_u_psycopg_pq__enums __pyx_string_tab[372]
#define __pyx_n_u_psycopg_pq_misc __pyx_string_tab[373]
#define __pyx_n_u_ptr __pyx_string_tab[374]
#define __pyx_n_u_put_copy_data __pyx_string_tab[375]
#define __pyx_n_u_put_copy_end __pyx_string_tab[376]
#define __pyx_n_u_pyx_capi __pyx_string_tab[377]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[378]
#define __pyx_n_u_pyx_result __pyx_string_tab[379]
#define __pyx_n_u_pyx_state __pyx_string_tab[380]
#define __pyx_n_u_pyx_type __pyx_string_tab[381]
#define __pyx_n_u_pyx_unpickle_Escaping __pyx_string_tab[382]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[383]
#define __pyx_n_u_qualname __pyx_string_tab[384]
#define __pyx_n_u_reduce __pyx_string_tab[385]
#define __pyx_n_u_reduce_cython __pyx_string_tab[386]
#define __pyx_n_u_reduce_ex __pyx_string_tab[387]
#define __pyx_n_u_repr __pyx_string_tab[388]
#define __pyx_n_u_res __pyx_string_tab[389]
#define __pyx_n_u_reset __pyx_string_tab[390]
#define __pyx_n_u_reset_poll __pyx_string_tab[391]
#define __pyx_n_u_reset_start __pyx_string_tab[392]
#define __pyx_n_u_result_format __pyx_string_tab[393]
#define __pyx_n_u_return __pyx_string_tab[394]
#define __pyx_n_u_row_number __pyx_string_tab[395]
#define __pyx_n_u_rv __pyx_string_tab[396]
#define __pyx_n_u_self __pyx_string_tab[397]
#define __pyx_n_u_send_close_portal __pyx_string_tab[398]
#define __pyx_n_u_send_close_prepared __pyx_string_tab[399]
#define __pyx_n_u_send_describe_portal __pyx_string_tab[400]
#define __pyx_n_u_send_describe_prepared __pyx_string_tab[401]
#define __pyx_n_u_send_flush_request __pyx_string_tab[402]
#define __pyx_n_u_send_prepare __pyx_string_tab[403]
#define __pyx_n_u_send_query __pyx_string_tab[404]
#define __pyx_n_u_send_query_params __pyx_string_tab[405]
#define __pyx_n_u_send_query_prepared __pyx_string_tab[406]
#define __pyx_n_u_set_attributes __pyx_string_tab[407]
#define __pyx_n_u_set_chunked_rows_mode __pyx_string_tab[408]
#define __pyx_n_u_set_name __pyx_string_tab[409]
#define __pyx_n_u_set_single_row_mode __pyx_string_tab[410]
#define __pyx_n_u_set_trace_flags __pyx_string_tab[411]
#define __pyx_n_u_setdefault __pyx_string_tab[412]
#define __pyx_n_u_setstate __pyx_string_tab[413]
#define __pyx_n_u_setstate_cython __pyx_string_tab[414]
#define __pyx_n_u_size __pyx_string_tab[415]
#define __pyx_n_u_ssl __pyx_string_tab[416]
#define __pyx_n_u_start __pyx_string_tab[417]
#define __pyx_n_u_state __pyx_string_tab[418]
#define __pyx_n_u_status __pyx_string_tab[419]
#define __pyx_n_u_str __pyx_string_tab[420]
#define __pyx_n_u_stream __pyx_string_tab[421]
#define __pyx_n_u_sys __pyx_string_tab[422]
#define __pyx_n_u_tableid __pyx_string_tab[423]
#define __pyx_n_u_test __pyx_string_tab[424]
#define __pyx_n_u_trace __pyx_string_tab[425]
#define __pyx_n_u_types_fast __pyx_string_tab[426]
#define __pyx_n_u_typid __pyx_string_tab[427]
#define __pyx_n_u_typlen __pyx_string_tab[428]
#define __pyx_n_u_unescape_bytea __pyx_string_tab[429]
#define __pyx_n_u_untrace __pyx_string_tab[430]
#define __pyx_n_u_update __pyx_string_tab[431]
#define __pyx_n_u_use_setstate __pyx_string_tab[432]
#define __pyx_n_u_user __pyx_string_tab[433]
#define __pyx_n_u_v __pyx_string_tab[434]
#define __pyx_n_u_val __pyx_string_tab[435]
#define __pyx_n_u_values __pyx_string_tab[436]
#define __pyx_n_u_version __pyx_string_tab[437]
#define __pyx_n_u_version_pretty __pyx_string_tab[438]
#define __pyx_n_u_x __pyx_string_tab[439]
#define __pyx_kp_b__5 __pyx_string_tab[440]
#define __pyx_kp_b_int_PyObject_char_Py_ssize_t__bu __pyx_string_tab[441]
#define __pyx_kp_b_iso88591_0_aq_Qd_3c_A_z __pyx_string_tab[442]
#define __pyx_kp_b_iso88591_1_IQd_2 __pyx_string_tab[443]
#define __pyx_kp_b_iso88591_1_aq_l_4_Q_4q_A_q __pyx_string_tab[444]
#define __pyx_kp_b_iso88591_1_c_1_E_aq_L_HE_KuA_L_Q_Je1_IU __pyx_string_tab[445]
#define __pyx_kp_b_iso88591_1_nAT_q_A_7_a_A_at3EQ_gQ_Q_7_1 __pyx_string_tab[446]
#define __pyx_kp_b_iso88591_2_A_aq_7q_N_3c_A_z __pyx_string_tab[447]
#define __pyx_kp_b_iso88591_31_aq_8_1_3c_A_AT1C1_z __pyx_string_tab[448]
#define __pyx_kp_b_iso88591_4A_1_4A_4q_Qa_z __pyx_string_tab[449]
#define __pyx_kp_b_iso88591_4A_aq_5Qd_3gQ_1_1 __pyx_string_tab[450]
#define __pyx_kp_b_iso88591_4_Cq_AQ_81D_3b_A_8_Oq_q __pyx_string_tab[451]
#define __pyx_kp_b_iso88591_4_G1_4q_q __pyx_string_tab[452]
#define __pyx_kp_b_iso88591_4_Q_A __pyx_string_tab[453]
#define __pyx_kp_b_iso88591_5Q_a_aq_Qd_4q_A_1_6H __pyx_string_tab[454]
#define __pyx_kp_b_iso88591_5Q_aq_4_Q_3c_A_AT1C1_z __pyx_string_tab[455]
#define __pyx_kp_b_iso88591_6_1A_q_N_3b_A_1D0B_q __pyx_string_tab[456]
#define __pyx_kp_b_iso88591_7q_0_aq_q_N_4q_A_1_6H __pyx_string_tab[457]
#define __pyx_kp_b_iso88591_8_aq_0_1_4q_A_4AT9K1 __pyx_string_tab[458]
#define __pyx_kp_b_iso88591_9_Qd_A_at3EQ __pyx_string_tab[459]
#define __pyx_kp_b_iso88591_9_nA_AQ __pyx_string_tab[460]
#define __pyx_kp_b_iso88591_A45_4q_Qa_Zq __pyx_string_tab[461]
#define __pyx_kp_b_iso88591_A_0_at1_3c_A_q __pyx_string_tab[462]
#define __pyx_kp_b_iso88591_A_1D_8 __pyx_string_tab[463]
#define __pyx_kp_b_iso88591_A_1_5_1_Qa_AQ_q __pyx_string_tab[464]
#define __pyx_kp_b_iso88591_A_1_6Fa_3gQ_1_1 __pyx_string_tab[465]
#define __pyx_kp_b_iso88591_A_4q_1_3j_9Cq_1A_1_1 __pyx_string_tab[466]
#define __pyx_kp_b_iso88591_A_4vS_AQ_4uM_A_AQ_6_q_1D_5_4s_A __pyx_string_tab[467]
#define __pyx_kp_b_iso88591_A_4vWA_t5_S_a_7q_aq_4s_Q_3aq_S_q __pyx_string_tab[468]
#define __pyx_kp_b_iso88591_A_4vWE_T_m3a_AQ_6_q_4vWA_E_8_XQa __pyx_string_tab[469]
#define __pyx_kp_b_iso88591_A_6_q_4vS_AQ_4uM_A_AQ_at5_e1_4s __pyx_string_tab[470]
#define __pyx_kp_b_iso88591_A_6_q_4vWA_t5_S_a_hl_7_Bb_a_E_y __pyx_string_tab[471]
#define __pyx_kp_b_iso88591_A_AT_4q_AQ_z __pyx_string_tab[472]
#define __pyx_kp_b_iso88591_A_A_11A_AQ_5_1_wc_k_a_waxq_q_a_A __pyx_string_tab[473]
#define __pyx_kp_b_iso88591_A_A_2_1_A_nHF_4q_A_at3EQ_U_1_q_q __pyx_string_tab[474]
#define __pyx_kp_b_iso88591_A_A_a_A_aq_8J_q_M_N_5_Yj_1HIZq_9 __pyx_string_tab[475]
#define __pyx_kp_b_iso88591_A_A_a_A_aq_8J_q_N_5_Yj_1HIZq_4q __pyx_string_tab[476]
#define __pyx_kp_b_iso88591_A_A_aq_wa_a_aq_1_axr_U_1_auH_A_j __pyx_string_tab[477]
#define __pyx_kp_b_iso88591_A_A_aq_wa_a_aq_1_axr_U_1_auH_A_n __pyx_string_tab[478]
#define __pyx_kp_b_iso88591_A_G1A __pyx_string_tab[479]
#define __pyx_kp_b_iso88591_A_Jat_31 __pyx_string_tab[480]
#define __pyx_kp_b_iso88591_A_Q_AT_vQ_q_S_A_at3EQ __pyx_string_tab[481]
#define __pyx_kp_b_iso88591_A_Qa_4q_Qa_Zq __pyx_string_tab[482]
#define __pyx_kp_b_iso88591_A_a_9Cq_1_z __pyx_string_tab[483]
#define __pyx_kp_b_iso88591_A_a_A_aq_8J_N_Z7LA_A_1HIZq_4q_A __pyx_string_tab[484]
#define __pyx_kp_b_iso88591_A_a_A_aq_8J_oQ_N_Q_Q_A_1HIZq_3c __pyx_string_tab[485]
#define __pyx_kp_b_iso88591_A_aq_G1D_a_9Cq_A_4_A_z __pyx_string_tab[486]
#define __pyx_kp_b_iso88591_A_q_1D_c_AT_1 __pyx_string_tab[487]
#define __pyx_kp_b_iso88591_A_s_4q_hgQa __pyx_string_tab[488]
#define __pyx_kp_b_iso88591_A_y_0 __pyx_string_tab[489]
#define __pyx_kp_b_iso88591_G1D_0 __pyx_string_tab[490]
#define __pyx_kp_b_iso88591_HAT_1 __pyx_string_tab[491]
#define __pyx_kp_b_iso88591_HA_3j_1_Qa_q_Qd __pyx_string_tab[492]
#define __pyx_kp_b_iso88591_IQd_gQ_4q_A_WAXQ __pyx_string_tab[493]
#define __pyx_kp_b_iso88591_Q __pyx_string_tab[494]
#define __pyx_kp_b_iso88591_Q_0_AT_s_AQ __pyx_string_tab[495]
#define __pyx_kp_b_iso88591_Q_1_O1D_4q_AQ_Qa __pyx_string_tab[496]
#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[497]
#define __pyx_kp_b_iso88591_Q_9M_a_AQ __pyx_string_tab[498]
#define __pyx_kp_b_iso88591_Q_9_q_A_AQ __pyx_string_tab[499]
#define __pyx_kp_b_iso88591_T_G1F_a_vWE_Q_q_q_Qg_q_Qg __pyx_string_tab[500]
#define __pyx_kp_b_iso88591_XQd_3gQ_1_1 __pyx_string_tab[501]
#define __pyx_kp_b_iso88591_Zq_A_Qd __pyx_string_tab[502]
#define __pyx_kp_b_iso88591_a_1D0_a_1_5V1_1Ba_L_5V1_q_q __pyx_string_tab[503]
#define __pyx_kp_b_iso88591_a_4_A_AQ __pyx_string_tab[504]
#define __pyx_kp_b_iso88591_a_4_WA_at1 __pyx_string_tab[505]
#define __pyx_kp_b_iso88591_a_L_5Q __pyx_string_tab[506]
#define __pyx_kp_b_iso88591_a_M_a __pyx_string_tab[507]
#define __pyx_kp_b_iso88591_a_y_0 __pyx_string_tab[508]
#define __pyx_kp_b_iso88591_aq_2_4_Q_4q_A_4AT9K1 __pyx_string_tab[509]
#define __pyx_kp_b_iso88591_avQ __pyx_string_tab[510]
#define __pyx_kp_b_iso88591_iq_A_q __pyx_string_tab[511]
#define __pyx_kp_b_iso88591_q_0_kQR_881A_7_nA_1 __pyx_string_tab[512]
#define __pyx_kp_b_iso88591_q_1D __pyx_string_tab[513]
#define __pyx_kp_b_iso88591_q_1D_8_D __pyx_string_tab[514]
#define __pyx_kp_b_iso88591_q_1_a_3c_AQ_3c_AQ __pyx_string_tab[515]
#define __pyx_kp_b_iso88591_q_2X_AT_A_4_A __pyx_string_tab[516]
#define __pyx_kp_b_iso88591_q_4_gQ_a __pyx_string_tab[517]
#define __pyx_kp_b_iso88591_q_81IQa_9E_3b_A_AT1C1_q __pyx_string_tab[518]
#define __pyx_kp_b_iso88591_q_9N_4q_A_at3EQ __pyx_string_tab[519]
#define __pyx_kp_b_iso88591_q_A __pyx_string_tab[520]
#define __pyx_kp_b_iso88591_q_aq_Qd __pyx_string_tab[521]
#define __pyx_int_8405287 __pyx_number_tab[0]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(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);
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #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_PGcancelConn);
  Py_CLEAR(clear_module_state->__pyx_type_9psycopg_c_2pq_PGcancelConn);
  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);
  for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<94; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<522; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_clear_contents ### */
/* CommonTypesMetaclass.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionShared.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);

/* #### Code section: module_state_clear_end ### */
return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(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);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  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_PGcancelConn);
  Py_VISIT(traverse_module_state->__pyx_type_9psycopg_c_2pq_PGcancelConn);
  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);
  for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<94; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<522; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_traverse_contents ### */
/* CommonTypesMetaclass.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionShared.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);

/* #### Code section: module_state_traverse_end ### */
return 0;
}
#endif
/* #### Code section: module_code ### */

/* "psycopg_c/pq.pyx":19
 * 
 * 
 * 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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("version (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":20
 * 
 * def version():
 *     return libpq.PQlibVersion()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(PQlibVersion()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq.pyx":19
 * 
 * 
 * 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":39
 * 
 * 
 * cdef object _check_supported(fname, int pgversion):             # <<<<<<<<<<<<<<
 *     if libpq.PG_VERSION_NUM < pgversion:
 *         raise e.NotSupportedError(
*/

static PyObject *__pyx_f_9psycopg_c_2pq__check_supported(PyObject *__pyx_v_fname, int __pyx_v_pgversion) {
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[6];
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_supported", 0);

  /* "psycopg_c/pq/pgconn.pyx":40
 * 
 * cdef object _check_supported(fname, int pgversion):
 *     if libpq.PG_VERSION_NUM < pgversion:             # <<<<<<<<<<<<<<
 *         raise e.NotSupportedError(
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"
*/
  __pyx_t_1 = (PG_VERSION_NUM < __pyx_v_pgversion);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":41
 * cdef object _check_supported(fname, int pgversion):
 *     if libpq.PG_VERSION_NUM < pgversion:
 *         raise e.NotSupportedError(             # <<<<<<<<<<<<<<
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"
 *             f" on the client; version {version_pretty(libpq.PG_VERSION_NUM)}"
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NotSupportedError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":42
 *     if libpq.PG_VERSION_NUM < pgversion:
 *         raise e.NotSupportedError(
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"             # <<<<<<<<<<<<<<
 *             f" on the client; version {version_pretty(libpq.PG_VERSION_NUM)}"
 *             " available instead"
*/
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_fname, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_version_pretty); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_pgversion); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "psycopg_c/pq/pgconn.pyx":43
 *         raise e.NotSupportedError(
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"
 *             f" on the client; version {version_pretty(libpq.PG_VERSION_NUM)}"             # <<<<<<<<<<<<<<
 *             " available instead"
 *         )
*/
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_version_pretty); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = __Pyx_PyLong_From_int(PG_VERSION_NUM); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_10[0] = __pyx_t_4;
    __pyx_t_10[1] = __pyx_mstate_global->__pyx_kp_u_requires_libpq_from_PostgreSQL;
    __pyx_t_10[2] = __pyx_t_7;
    __pyx_t_10[3] = __pyx_mstate_global->__pyx_kp_u_on_the_client_version;
    __pyx_t_10[4] = __pyx_t_6;
    __pyx_t_10[5] = __pyx_mstate_global->__pyx_kp_u_available_instead;

    /* "psycopg_c/pq/pgconn.pyx":42
 *     if libpq.PG_VERSION_NUM < pgversion:
 *         raise e.NotSupportedError(
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"             # <<<<<<<<<<<<<<
 *             f" on the client; version {version_pretty(libpq.PG_VERSION_NUM)}"
 *             " available instead"
*/
    __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_10, 6, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 32 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 18, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
    if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 41, __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(1, 41, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":40
 * 
 * cdef object _check_supported(fname, int pgversion):
 *     if libpq.PG_VERSION_NUM < pgversion:             # <<<<<<<<<<<<<<
 *         raise e.NotSupportedError(
 *             f"{fname} requires libpq from PostgreSQL {version_pretty(pgversion)}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":39
 * 
 * 
 * cdef object _check_supported(fname, int pgversion):             # <<<<<<<<<<<<<<
 *     if libpq.PG_VERSION_NUM < pgversion:
 *         raise e.NotSupportedError(
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("psycopg_c.pq._check_supported", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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":50
 *     @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_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __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":51
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):
 *         cdef PGconn rv = PGconn.__new__(PGconn)
 *         rv._pgconn_ptr = ptr             # <<<<<<<<<<<<<<
 * 
 *         libpq.PQsetNoticeReceiver(
*/
  __pyx_v_rv->_pgconn_ptr = __pyx_v_ptr;

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

  /* "psycopg_c/pq/pgconn.pyx":55
 *         libpq.PQsetNoticeReceiver(
 *             ptr, <libpq.PQnoticeReceiver>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":48
 * 
 * cdef class PGconn:
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGconn _from_ptr(libpq.PGconn *ptr):
 *         cdef PGconn rv = PGconn.__new__(PGconn)
*/

  /* 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":57
 *         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 Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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;

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

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

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

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":61
 *         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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "psycopg_c/pq/pgconn.pyx":64
 *         # 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":65
 *         # not if this object is being GC'd after fork.
 *         if self._procpid == getpid():
 *             self.finish()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self) -> str:
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_finish, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "psycopg_c/pq/pgconn.pyx":64
 *         # 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":61
 *         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_WriteUnraisable("psycopg_c.pq.PGconn.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "psycopg_c/pq/pgconn.pyx":67
 *             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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[3];
  size_t __pyx_t_5;
  PyObject *__pyx_t_6[7];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "psycopg_c/pq/pgconn.pyx":68
 * 
 *     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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_qualname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4[0] = __pyx_t_1;
  __pyx_t_4[1] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_4[2] = __pyx_t_2;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cls = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "psycopg_c/pq/pgconn.pyx":69
 *     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_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_connection_summary); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_info = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "psycopg_c/pq/pgconn.pyx":70
 *         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_3 = __Pyx_PyObject_FormatSimple(__pyx_v_info, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_6[1] = __pyx_v_cls;
  __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_6[3] = __pyx_t_3;
  __pyx_t_6[4] = __pyx_mstate_global->__pyx_kp_u_at_0x;
  __pyx_t_6[5] = __pyx_t_2;
  __pyx_t_6[6] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_6, 7, 1 * 3 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_cls) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_cls) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":67
 *             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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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":72
 *         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;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_conninfo); {
    __pyx_v_conninfo = __Pyx_PyObject_AsString(__pyx_arg_conninfo); if (unlikely((!__pyx_v_conninfo) && PyErr_Occurred())) __PYX_ERR(1, 73, __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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect", 0);

  /* "psycopg_c/pq/pgconn.pyx":74
 *     @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":75
 *     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":76
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectdb(conninfo)
 *         if not pgconn:
 *             raise MemoryError("couldn't allocate PGconn")             # <<<<<<<<<<<<<<
 * 
 *         return PGconn._from_ptr(pgconn)
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_PGconn};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 76, __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(1, 76, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":75
 *     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":78
 *             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(1, 78, __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":72
 *         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_XDECREF(__pyx_t_3);
  __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":80
 *         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;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_conninfo); {
    __pyx_v_conninfo = __Pyx_PyObject_AsString(__pyx_arg_conninfo); if (unlikely((!__pyx_v_conninfo) && PyErr_Occurred())) __PYX_ERR(1, 81, __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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect_start", 0);

  /* "psycopg_c/pq/pgconn.pyx":82
 *     @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":83
 *     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":84
 *         cdef libpq.PGconn* pgconn = libpq.PQconnectStart(conninfo)
 *         if not pgconn:
 *             raise MemoryError("couldn't allocate PGconn")             # <<<<<<<<<<<<<<
 * 
 *         return PGconn._from_ptr(pgconn)
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_PGconn};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __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(1, 84, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":83
 *     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":86
 *             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(1, 86, __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":80
 *         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_XDECREF(__pyx_t_3);
  __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":88
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect_poll (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":89
 * 
 *     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(1, 89, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_2, NULL, 0) < (0)) __PYX_ERR(1, 89, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":88
 *         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":91
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("finish (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":92
 * 
 *     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":93
 *     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":94
 *         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":92
 * 
 *     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":91
 *         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":96
 *             self._pgconn_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgconn_ptr(self) -> int | None:
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":98
 *     @property
 *     def pgconn_ptr(self) -> int | None:
 *         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":99
 *     def pgconn_ptr(self) -> int | None:
 *         if self._pgconn_ptr:
 *             return <long long><void *>self._pgconn_ptr             # <<<<<<<<<<<<<<
 *         else:
 *             return None
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyLong_From_PY_LONG_LONG(((PY_LONG_LONG)((void *)__pyx_v_self->_pgconn_ptr))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 99, __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":98
 *     @property
 *     def pgconn_ptr(self) -> int | None:
 *         if self._pgconn_ptr:             # <<<<<<<<<<<<<<
 *             return <long long><void *>self._pgconn_ptr
 *         else:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":101
 *             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":96
 *             self._pgconn_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgconn_ptr(self) -> int | None:
 *         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":103
 *             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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":105
 *     @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(1, 105, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":106
 *     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":107
 *         _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":108
 *         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_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_connection_inf};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 108, __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(1, 108, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":107
 *         _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":109
 *         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(1, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_rv = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "psycopg_c/pq/pgconn.pyx":110
 *             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":111
 *         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":103
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def info(self) -> list[ConninfoOption]:
 *         _ensure_pgconn(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":113
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":114
 * 
 *     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(1, 114, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":115
 *     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":113
 *         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":117
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_start (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset_start", 0);

  /* "psycopg_c/pq/pgconn.pyx":118
 * 
 *     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":119
 *     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_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_reset_connection};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(1, 119, __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(1, 119, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":117
 *         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_XDECREF(__pyx_t_5);
  __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":121
 *             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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_poll (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":122
 * 
 *     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(1, 122, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_2, NULL, 0) < (0)) __PYX_ERR(1, 122, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":121
 *             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":124
 *         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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ping (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_conninfo); {
    __pyx_v_conninfo = __Pyx_PyObject_AsString(__pyx_arg_conninfo); if (unlikely((!__pyx_v_conninfo) && PyErr_Occurred())) __PYX_ERR(1, 125, __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":126
 *     @classmethod
 *     def ping(self, const char *conninfo) -> int:
 *         return libpq.PQping(conninfo)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_PGPing(PQping(__pyx_v_conninfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(1, 126, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":124
 *         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":128
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":130
 *     @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 == ((void *)NULL))) __PYX_ERR(1, 130, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 130, __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":128
 *         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":132
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":134
 *     @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 == ((void *)NULL))) __PYX_ERR(1, 134, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 134, __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":132
 *         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":136
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":138
 *     @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 == ((void *)NULL))) __PYX_ERR(1, 138, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 138, __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":136
 *         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":140
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":142
 *     @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 == ((void *)NULL))) __PYX_ERR(1, 142, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 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":140
 *         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":144
 *         return _call_bytes(self, libpq.PQhost)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def hostaddr(self) -> bytes:
 *         _check_supported("PQhostaddr", 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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  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":146
 *     @property
 *     def hostaddr(self) -> bytes:
 *         _check_supported("PQhostaddr", 120000)             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef char *rv = libpq.PQhostaddr(self._pgconn_ptr)
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQhostaddr, 0x1D4C0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":147
 *     def hostaddr(self) -> bytes:
 *         _check_supported("PQhostaddr", 120000)
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef char *rv = libpq.PQhostaddr(self._pgconn_ptr)
 *         assert rv is not NULL
*/
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 147, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":148
 *         _check_supported("PQhostaddr", 120000)
 *         _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":149
 *         _ensure_pgconn(self)
 *         cdef char *rv = libpq.PQhostaddr(self._pgconn_ptr)
 *         assert rv is not NULL             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = (__pyx_v_rv != NULL);
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(1, 149, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 149, __pyx_L1_error)
  #endif

  /* "psycopg_c/pq/pgconn.pyx":150
 *         cdef char *rv = libpq.PQhostaddr(self._pgconn_ptr)
 *         assert rv is not NULL
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 150, __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":144
 *         return _call_bytes(self, libpq.PQhost)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def hostaddr(self) -> bytes:
 *         _check_supported("PQhostaddr", 120000)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":152
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":154
 *     @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 == ((void *)NULL))) __PYX_ERR(1, 154, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 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 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":156
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":158
 *     @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 == ((void *)NULL))) __PYX_ERR(1, 158, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 158, __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":156
 *         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":160
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":162
 *     @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 == ((void *)NULL))) __PYX_ERR(1, 162, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 162, __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":160
 *         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":164
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":166
 *     @property
 *     def status(self) -> int:
 *         return libpq.PQstatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_ConnStatusType(PQstatus(__pyx_v_self->_pgconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 166, __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":164
 *         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":168
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":170
 *     @property
 *     def transaction_status(self) -> int:
 *         return libpq.PQtransactionStatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_PGTransactionStatusType(PQtransactionStatus(__pyx_v_self->_pgconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 170, __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":168
 *         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":172
 *         return libpq.PQtransactionStatus(self._pgconn_ptr)
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:             # <<<<<<<<<<<<<<
 *         _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;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 172, __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":173
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:
 *         _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(1, 173, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":174
 *     def parameter_status(self, const char *name) -> bytes | None:
 *         _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":175
 *         _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":176
 *         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(1, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":175
 *         _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":178
 *             return rv
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgconn.pyx":172
 *         return libpq.PQtransactionStatus(self._pgconn_ptr)
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:             # <<<<<<<<<<<<<<
 *         _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":180
 *             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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":182
 *     @property
 *     def error_message(self) -> bytes:
 *         return libpq.PQerrorMessage(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_error_message(self, encoding: str = "") -> str:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(PQerrorMessage(__pyx_v_self->_pgconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 182, __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":180
 *             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":184
 *         return libpq.PQerrorMessage(self._pgconn_ptr)
 * 
 *     def get_error_message(self, encoding: str = "") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_25get_error_message(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_25get_error_message = {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_25get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_25get_error_message(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_encoding = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_error_message (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_encoding,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 184, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 184, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_error_message", 0) < (0)) __PYX_ERR(1, 184, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 184, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u__5));
    }
    __pyx_v_encoding = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_error_message", 0, 0, 1, __pyx_nargs); __PYX_ERR(1, 184, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.get_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 2))) __PYX_ERR(1, 184, __pyx_L1_error)
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_24get_error_message(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), __pyx_v_encoding);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_24get_error_message(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_encoding) {
  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;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_error_message", 0);

  /* "psycopg_c/pq/pgconn.pyx":185
 * 
 *     def get_error_message(self, encoding: str = "") -> str:
 *         return _clean_error_message(self.error_message, encoding or self._encoding)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_clean_error_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_encoding); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 185, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __Pyx_INCREF(__pyx_v_encoding);
    __pyx_t_5 = __pyx_v_encoding;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_encoding_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_5 = __pyx_t_7;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(1, 185, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":184
 *         return libpq.PQerrorMessage(self._pgconn_ptr)
 * 
 *     def get_error_message(self, encoding: str = "") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.get_error_message", __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":187
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def _encoding(self) -> str:
 *         cdef const char *pgenc
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_9_encoding_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_9_encoding_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_9_encoding___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_9_encoding___get__(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  char const *__pyx_v_pgenc;
  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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":190
 *     def _encoding(self) -> str:
 *         cdef const char *pgenc
 *         if libpq.PQstatus(self._pgconn_ptr) == libpq.CONNECTION_OK:             # <<<<<<<<<<<<<<
 *             pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *             if pgenc is NULL:
*/
  __pyx_t_1 = (PQstatus(__pyx_v_self->_pgconn_ptr) == CONNECTION_OK);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":191
 *         cdef const char *pgenc
 *         if libpq.PQstatus(self._pgconn_ptr) == libpq.CONNECTION_OK:
 *             pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")             # <<<<<<<<<<<<<<
 *             if pgenc is NULL:
 *                 pgenc = b"UTF8"
*/
    __pyx_v_pgenc = PQparameterStatus(__pyx_v_self->_pgconn_ptr, __pyx_k_client_encoding);

    /* "psycopg_c/pq/pgconn.pyx":192
 *         if libpq.PQstatus(self._pgconn_ptr) == libpq.CONNECTION_OK:
 *             pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *             if pgenc is NULL:             # <<<<<<<<<<<<<<
 *                 pgenc = b"UTF8"
 *             return pg2pyenc(pgenc)
*/
    __pyx_t_1 = (__pyx_v_pgenc == NULL);
    if (__pyx_t_1) {

      /* "psycopg_c/pq/pgconn.pyx":193
 *             pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *             if pgenc is NULL:
 *                 pgenc = b"UTF8"             # <<<<<<<<<<<<<<
 *             return pg2pyenc(pgenc)
 *         else:
*/
      __pyx_v_pgenc = __pyx_k_UTF8;

      /* "psycopg_c/pq/pgconn.pyx":192
 *         if libpq.PQstatus(self._pgconn_ptr) == libpq.CONNECTION_OK:
 *             pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *             if pgenc is NULL:             # <<<<<<<<<<<<<<
 *                 pgenc = b"UTF8"
 *             return pg2pyenc(pgenc)
*/
    }

    /* "psycopg_c/pq/pgconn.pyx":194
 *             if pgenc is NULL:
 *                 pgenc = b"UTF8"
 *             return pg2pyenc(pgenc)             # <<<<<<<<<<<<<<
 *         else:
 *             return "utf-8"
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pg2pyenc); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_pgenc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 194, __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":190
 *     def _encoding(self) -> str:
 *         cdef const char *pgenc
 *         if libpq.PQstatus(self._pgconn_ptr) == libpq.CONNECTION_OK:             # <<<<<<<<<<<<<<
 *             pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *             if pgenc is NULL:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":196
 *             return pg2pyenc(pgenc)
 *         else:
 *             return "utf-8"             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_utf_8);
    __pyx_r = __pyx_mstate_global->__pyx_kp_u_utf_8;
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgconn.pyx":187
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def _encoding(self) -> str:
 *         cdef const char *pgenc
*/

  /* 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.PGconn._encoding.__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":198
 *             return "utf-8"
 * 
 *     @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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":200
 *     @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(1, 200, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 200, __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":198
 *             return "utf-8"
 * 
 *     @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":202
 *         return _call_int(self, libpq.PQprotocolVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def full_protocol_version(self) -> int:
 *         _check_supported("PQfullProtocolVersion", 180000)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_21full_protocol_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_21full_protocol_version_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_21full_protocol_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_21full_protocol_version___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":204
 *     @property
 *     def full_protocol_version(self) -> int:
 *         _check_supported("PQfullProtocolVersion", 180000)             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         return libpq.PQfullProtocolVersion(self._pgconn_ptr)
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQfullProtocolVersion, 0x2BF20); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":205
 *     def full_protocol_version(self) -> int:
 *         _check_supported("PQfullProtocolVersion", 180000)
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         return libpq.PQfullProtocolVersion(self._pgconn_ptr)
 * 
*/
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 205, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":206
 *         _check_supported("PQfullProtocolVersion", 180000)
 *         _ensure_pgconn(self)
 *         return libpq.PQfullProtocolVersion(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(PQfullProtocolVersion(__pyx_v_self->_pgconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __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":202
 *         return _call_int(self, libpq.PQprotocolVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def full_protocol_version(self) -> int:
 *         _check_supported("PQfullProtocolVersion", 180000)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.full_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":208
 *         return libpq.PQfullProtocolVersion(self._pgconn_ptr)
 * 
 *     @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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":210
 *     @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(1, 210, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 210, __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":208
 *         return libpq.PQfullProtocolVersion(self._pgconn_ptr)
 * 
 *     @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":212
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":214
 *     @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(1, 214, __pyx_L1_error)
  __pyx_v_rv = __pyx_t_1;

  /* "psycopg_c/pq/pgconn.pyx":215
 *     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":216
 *         rv = _call_int(self, libpq.PQsocket)
 *         if rv == -1:
 *             raise e.OperationalError("the connection is lost")             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_the_connection_is_lost};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 216, __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(1, 216, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":215
 *     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":217
 *         if rv == -1:
 *             raise e.OperationalError("the connection is lost")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 217, __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":212
 *         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_XDECREF(__pyx_t_6);
  __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":219
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":221
 *     @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(1, 221, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 221, __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":219
 *         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":223
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":225
 *     @property
 *     def needs_password(self) -> bool:
 *         return bool(libpq.PQconnectionNeedsPassword(self._pgconn_ptr))             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!(PQconnectionNeedsPassword(__pyx_v_self->_pgconn_ptr) != 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __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":223
 *         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":227
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":229
 *     @property
 *     def used_password(self) -> bool:
 *         return bool(libpq.PQconnectionUsedPassword(self._pgconn_ptr))             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!(PQconnectionUsedPassword(__pyx_v_self->_pgconn_ptr) != 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __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":227
 *         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":231
 *         return bool(libpq.PQconnectionUsedPassword(self._pgconn_ptr))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def used_gssapi(self) -> bool:
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_11used_gssapi_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_11used_gssapi_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_11used_gssapi___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_11used_gssapi___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":233
 *     @property
 *     def used_gssapi(self) -> bool:
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)             # <<<<<<<<<<<<<<
 *         return bool(libpq.PQconnectionUsedGSSAPI(self._pgconn_ptr))
 * 
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQconnectionUsedGSSAPI, 0x27100); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":234
 *     def used_gssapi(self) -> bool:
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)
 *         return bool(libpq.PQconnectionUsedGSSAPI(self._pgconn_ptr))             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!(PQconnectionUsedGSSAPI(__pyx_v_self->_pgconn_ptr) != 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __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":231
 *         return bool(libpq.PQconnectionUsedPassword(self._pgconn_ptr))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def used_gssapi(self) -> bool:
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.used_gssapi.__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":236
 *         return bool(libpq.PQconnectionUsedGSSAPI(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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":238
 *     @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(1, 238, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong((!(!(__pyx_t_1 != 0)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __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":236
 *         return bool(libpq.PQconnectionUsedGSSAPI(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":240
 *         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_27exec_(PyObject *__pyx_v_self, PyObject *__pyx_arg_command); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_27exec_ = {"exec_", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_27exec_, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_27exec_(PyObject *__pyx_v_self, PyObject *__pyx_arg_command) {
  char const *__pyx_v_command;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_command); {
    __pyx_v_command = __Pyx_PyObject_AsString(__pyx_arg_command); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 240, __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_26exec_(((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_26exec_(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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_", 0);

  /* "psycopg_c/pq/pgconn.pyx":241
 * 
 *     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(1, 241, __pyx_L1_error)

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

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

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

  /* "psycopg_c/pq/pgconn.pyx":245
 *         with nogil:
 *             pgresult = libpq.PQexec(self._pgconn_ptr, command)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  __pyx_t_2 = (__pyx_v_pgresult == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":246
 *             pgresult = libpq.PQexec(self._pgconn_ptr, command)
 *         if pgresult is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"executing query failed: {self.get_error_message()}")
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":247
 *         if pgresult is NULL:
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 * 
 *         return PGresult._from_ptr(pgresult)
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_executing_query_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 246, __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(1, 246, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":245
 *         with nogil:
 *             pgresult = libpq.PQexec(self._pgconn_ptr, command)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":249
 *                 f"executing query failed: {self.get_error_message()}")
 * 
 *         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(1, 249, __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":240
 *         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_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.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":251
 *         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_29send_query(PyObject *__pyx_v_self, PyObject *__pyx_arg_command); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_29send_query = {"send_query", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_29send_query, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_29send_query(PyObject *__pyx_v_self, PyObject *__pyx_arg_command) {
  char const *__pyx_v_command;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_command); {
    __pyx_v_command = __Pyx_PyObject_AsString(__pyx_arg_command); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 251, __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_28send_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_28send_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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query", 0);

  /* "psycopg_c/pq/pgconn.pyx":252
 * 
 *     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(1, 252, __pyx_L1_error)

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

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

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

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

    /* "psycopg_c/pq/pgconn.pyx":257
 *             rv = libpq.PQsendQuery(self._pgconn_ptr, command)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending query failed: {self.get_error_message()}")
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":258
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending query failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 * 
 *     def exec_params(
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 258, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_query_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 257, __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(1, 257, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":251
 *         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":260
 *                 f"sending query failed: {self.get_error_message()}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_31exec_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_31exec_params = {"exec_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_31exec_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_31exec_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 Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  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_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_command,&__pyx_mstate_global->__pyx_n_u_param_values,&__pyx_mstate_global->__pyx_n_u_param_types,&__pyx_mstate_global->__pyx_n_u_param_formats,&__pyx_mstate_global->__pyx_n_u_result_format,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 260, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "exec_params", 0) < (0)) __PYX_ERR(1, 260, __pyx_L3_error)

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

      /* "psycopg_c/pq/pgconn.pyx":265
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("exec_params", 0, 2, 5, i); __PYX_ERR(1, 260, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 260, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 260, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

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

      /* "psycopg_c/pq/pgconn.pyx":265
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_command = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 262, __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_PyLong_As_int(values[4]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 266, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_mstate_global->__pyx_k__6;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("exec_params", 0, 2, 5, __pyx_nargs); __PYX_ERR(1, 260, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_30exec_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":260
 *                 f"sending query failed: {self.get_error_message()}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_30exec_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____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;
  size_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_params", 0);

  /* "psycopg_c/pq/pgconn.pyx":268
 *         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(1, 268, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":275
 *         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(__pyx_v_param_values, __pyx_v_param_types, __pyx_v_param_formats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 275, __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":279
 * 
 *         cdef libpq.PGresult *pgresult
 *         with nogil:             # <<<<<<<<<<<<<<
 *             pgresult = libpq.PQexecParams(
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":280
 *         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":279
 * 
 *         cdef libpq.PGresult *pgresult
 *         with nogil:             # <<<<<<<<<<<<<<
 *             pgresult = libpq.PQexecParams(
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":283
 *                 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 e.OperationalError(
*/
  __pyx_f_9psycopg_c_2pq__clear_query_params(__pyx_v_ctypes, __pyx_v_cvalues, __pyx_v_clengths, __pyx_v_cformats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 283, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":284
 *                 <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  __pyx_t_8 = (__pyx_v_pgresult == NULL);
  if (unlikely(__pyx_t_8)) {

    /* "psycopg_c/pq/pgconn.pyx":285
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgresult is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"executing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(pgresult)
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "psycopg_c/pq/pgconn.pyx":286
 *         if pgresult is NULL:
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(pgresult)
 * 
*/
    __pyx_t_13 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_13);
    __pyx_t_14 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
      __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
    }
    __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_11, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_executing_query_failed, __pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
      assert(__pyx_t_10);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
      __pyx_t_14 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11};
      __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 285, __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(1, 285, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":284
 *                 <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":287
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
 *         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(1, 287, __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":260
 *                 f"sending query failed: {self.get_error_message()}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/

  /* function exit code */
  __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.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":289
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_33send_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_33send_query_params = {"send_query_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_33send_query_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_33send_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 Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  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_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_command,&__pyx_mstate_global->__pyx_n_u_param_values,&__pyx_mstate_global->__pyx_n_u_param_types,&__pyx_mstate_global->__pyx_n_u_param_formats,&__pyx_mstate_global->__pyx_n_u_result_format,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 289, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "send_query_params", 0) < (0)) __PYX_ERR(1, 289, __pyx_L3_error)

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

      /* "psycopg_c/pq/pgconn.pyx":294
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("send_query_params", 0, 2, 5, i); __PYX_ERR(1, 289, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 289, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 289, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

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

      /* "psycopg_c/pq/pgconn.pyx":294
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_command = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 291, __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_PyLong_As_int(values[4]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 295, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_mstate_global->__pyx_k__7;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send_query_params", 0, 2, 5, __pyx_nargs); __PYX_ERR(1, 289, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_32send_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":289
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_32send_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____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;
  size_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query_params", 0);

  /* "psycopg_c/pq/pgconn.pyx":297
 *         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(1, 297, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":304
 *         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(__pyx_v_param_values, __pyx_v_param_types, __pyx_v_param_formats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 304, __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":308
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendQueryParams(
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":309
 *         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":308
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendQueryParams(
 *                 self._pgconn_ptr, command, <int>cnparams, ctypes,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":312
 *                 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); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 312, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":313
 *                 <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: {self.get_error_message()}"
*/
  __pyx_t_8 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_8)) {

    /* "psycopg_c/pq/pgconn.pyx":314
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending query and params failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "psycopg_c/pq/pgconn.pyx":315
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_13 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_13);
    __pyx_t_14 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
      __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
    }
    __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_11, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_query_and_params_failed, __pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
      assert(__pyx_t_10);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
      __pyx_t_14 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11};
      __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 314, __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(1, 314, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":313
 *                 <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: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":289
 *         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":318
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_35send_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_35send_prepare = {"send_prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_35send_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_35send_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 Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  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_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_command,&__pyx_mstate_global->__pyx_n_u_param_types,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 318, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 318, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 318, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 318, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "send_prepare", 0) < (0)) __PYX_ERR(1, 318, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":322
 *         const char *name,
 *         const char *command,
 *         param_types: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         _ensure_pgconn(self)
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("send_prepare", 0, 2, 3, i); __PYX_ERR(1, 318, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 318, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 318, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 318, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 320, __pyx_L3_error)
    __pyx_v_command = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 321, __pyx_L3_error)
    __pyx_v_param_types = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send_prepare", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 318, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_34send_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":318
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_34send_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;
  PyObject *__pyx_v_types_fast = 0;
  Py_ssize_t __pyx_v_nparams;
  Oid *__pyx_v_atypes;
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6;
  Oid __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_prepare", 0);

  /* "psycopg_c/pq/pgconn.pyx":324
 *         param_types: Sequence[int] | None = 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(1, 324, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":328
 *         cdef int i
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0             # <<<<<<<<<<<<<<
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
*/
  __pyx_v_nparams = 0;

  /* "psycopg_c/pq/pgconn.pyx":329
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:             # <<<<<<<<<<<<<<
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
*/
  __pyx_t_2 = (__pyx_v_param_types != Py_None);
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":330
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")             # <<<<<<<<<<<<<<
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
 * 
*/
    __pyx_t_3 = PySequence_Fast(__pyx_v_param_types, ((char *)"'param_types' is not a sequence")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_types_fast = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "psycopg_c/pq/pgconn.pyx":331
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.Oid *atypes = NULL
*/
    __pyx_v_nparams = PySequence_Fast_GET_SIZE(__pyx_v_types_fast);

    /* "psycopg_c/pq/pgconn.pyx":329
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:             # <<<<<<<<<<<<<<
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":333
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
 * 
 *         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":334
 * 
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
*/
  __pyx_t_2 = (__pyx_v_nparams != 0);
  if (__pyx_t_2) {

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

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

      /* "psycopg_c/pq/pgconn.pyx":337
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
 *                 atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)             # <<<<<<<<<<<<<<
 * 
 *         cdef int rv
*/
      if (unlikely(!__pyx_v_types_fast)) { __Pyx_RaiseUnboundLocalError("types_fast"); __PYX_ERR(1, 337, __pyx_L1_error) }
      __pyx_t_6 = PySequence_Fast_GET_ITEM(__pyx_v_types_fast, __pyx_v_i);
      __pyx_t_7 = __Pyx_PyLong_As_Oid(((PyObject *)__pyx_t_6)); if (unlikely((__pyx_t_7 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(1, 337, __pyx_L1_error)
      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_7;
    }

    /* "psycopg_c/pq/pgconn.pyx":334
 * 
 *         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":340
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendPrepare(
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":341
 *         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":340
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendPrepare(
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":344
 *                 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":345
 *             )
 *         PyMem_Free(atypes)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"
*/
  __pyx_t_2 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":346
 *         PyMem_Free(atypes)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending query and params failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "psycopg_c/pq/pgconn.pyx":347
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_11 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_12 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
      __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_query_and_params_failed, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_12 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
      __pyx_t_12 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 346, __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(1, 346, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":318
 *             )
 * 
 *     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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_types_fast);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_37send_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_37send_query_prepared = {"send_query_prepared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_37send_query_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_37send_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 Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  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_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_param_values,&__pyx_mstate_global->__pyx_n_u_param_formats,&__pyx_mstate_global->__pyx_n_u_result_format,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 350, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 350, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 350, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 350, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 350, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "send_query_prepared", 0) < (0)) __PYX_ERR(1, 350, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":354
 *         const char *name,
 *         param_values: Sequence[bytes | None] | None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("send_query_prepared", 0, 2, 4, i); __PYX_ERR(1, 350, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 350, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 350, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 350, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 350, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 352, __pyx_L3_error)
    __pyx_v_param_values = values[1];
    __pyx_v_param_formats = values[2];
    if (values[3]) {
      __pyx_v_result_format = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 355, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_mstate_global->__pyx_k__8;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send_query_prepared", 0, 2, 4, __pyx_nargs); __PYX_ERR(1, 350, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_36send_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":350
 *             )
 * 
 *     def send_query_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_36send_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____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;
  size_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":357
 *         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(1, 357, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":364
 *         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(__pyx_v_param_values, Py_None, __pyx_v_param_formats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 364, __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":368
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendQueryPrepared(
 *                 self._pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":369
 *         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":368
 * 
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendQueryPrepared(
 *                 self._pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":372
 *                 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); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 372, __pyx_L1_error)

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

    /* "psycopg_c/pq/pgconn.pyx":374
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending prepared query failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "psycopg_c/pq/pgconn.pyx":375
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending prepared query failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_13 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_13);
    __pyx_t_14 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
      __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
    }
    __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_11, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_prepared_query_failed, __pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
      assert(__pyx_t_10);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
      __pyx_t_14 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11};
      __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 374, __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(1, 374, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":350
 *             )
 * 
 *     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":378
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_39prepare(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_39prepare = {"prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_39prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_39prepare(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 Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  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_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_command,&__pyx_mstate_global->__pyx_n_u_param_types,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 378, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "prepare", 0) < (0)) __PYX_ERR(1, 378, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":382
 *         const char *name,
 *         const char *command,
 *         param_types: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         _ensure_pgconn(self)
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("prepare", 0, 2, 3, i); __PYX_ERR(1, 378, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 378, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 378, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 380, __pyx_L3_error)
    __pyx_v_command = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 381, __pyx_L3_error)
    __pyx_v_param_types = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prepare", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 378, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_38prepare(((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":378
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_38prepare(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;
  PyObject *__pyx_v_types_fast = 0;
  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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6;
  Oid __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prepare", 0);

  /* "psycopg_c/pq/pgconn.pyx":384
 *         param_types: Sequence[int] | None = 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(1, 384, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":388
 *         cdef int i
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0             # <<<<<<<<<<<<<<
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
*/
  __pyx_v_nparams = 0;

  /* "psycopg_c/pq/pgconn.pyx":389
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:             # <<<<<<<<<<<<<<
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
*/
  __pyx_t_2 = (__pyx_v_param_types != Py_None);
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":390
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")             # <<<<<<<<<<<<<<
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
 * 
*/
    __pyx_t_3 = PySequence_Fast(__pyx_v_param_types, ((char *)"'param_types' is not a sequence")); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_types_fast = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "psycopg_c/pq/pgconn.pyx":391
 *         if param_types is not None:
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.Oid *atypes = NULL
*/
    __pyx_v_nparams = PySequence_Fast_GET_SIZE(__pyx_v_types_fast);

    /* "psycopg_c/pq/pgconn.pyx":389
 *         cdef types_fast
 *         cdef Py_ssize_t nparams = 0
 *         if param_types is not None:             # <<<<<<<<<<<<<<
 *             types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":393
 *             nparams = PySequence_Fast_GET_SIZE(types_fast)
 * 
 *         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":394
 * 
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
*/
  __pyx_t_2 = (__pyx_v_nparams != 0);
  if (__pyx_t_2) {

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

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

      /* "psycopg_c/pq/pgconn.pyx":397
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
 *                 atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.PGresult *rv
*/
      if (unlikely(!__pyx_v_types_fast)) { __Pyx_RaiseUnboundLocalError("types_fast"); __PYX_ERR(1, 397, __pyx_L1_error) }
      __pyx_t_6 = PySequence_Fast_GET_ITEM(__pyx_v_types_fast, __pyx_v_i);
      __pyx_t_7 = __Pyx_PyLong_As_Oid(((PyObject *)__pyx_t_6)); if (unlikely((__pyx_t_7 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(1, 397, __pyx_L1_error)
      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_7;
    }

    /* "psycopg_c/pq/pgconn.pyx":394
 * 
 *         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":400
 * 
 *         cdef libpq.PGresult *rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQprepare(
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":401
 *         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":400
 * 
 *         cdef libpq.PGresult *rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQprepare(
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":403
 *             rv = libpq.PQprepare(
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
  PyMem_Free(__pyx_v_atypes);

  /* "psycopg_c/pq/pgconn.pyx":404
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"preparing query failed: {self.get_error_message()}")
*/
  __pyx_t_2 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":405
 *         PyMem_Free(atypes)
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"preparing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "psycopg_c/pq/pgconn.pyx":406
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"preparing query failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(rv)
 * 
*/
    __pyx_t_11 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_12 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
      __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_preparing_query_failed, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_12 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
      __pyx_t_12 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 405, __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(1, 405, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":404
 *                 self._pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"preparing query failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":407
 *             raise e.OperationalError(
 *                 f"preparing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def exec_prepared(
*/
  __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(1, 407, __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":378
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

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

/* "psycopg_c/pq/pgconn.pyx":409
 *         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_41exec_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_41exec_prepared = {"exec_prepared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_41exec_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_41exec_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 Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  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_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_param_values,&__pyx_mstate_global->__pyx_n_u_param_formats,&__pyx_mstate_global->__pyx_n_u_result_format,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 409, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "exec_prepared", 0) < (0)) __PYX_ERR(1, 409, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":413
 *         const char *name,
 *         param_values: Sequence[bytes] | None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("exec_prepared", 0, 2, 4, i); __PYX_ERR(1, 409, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 409, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 409, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 411, __pyx_L3_error)
    __pyx_v_param_values = values[1];
    __pyx_v_param_formats = values[2];
    if (values[3]) {
      __pyx_v_result_format = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_result_format == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 414, __pyx_L3_error)
    } else {
      __pyx_v_result_format = __pyx_mstate_global->__pyx_k__9;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("exec_prepared", 0, 2, 4, __pyx_nargs); __PYX_ERR(1, 409, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_40exec_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":409
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_40exec_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____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;
  size_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":416
 *         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(1, 416, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":423
 *         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(__pyx_v_param_values, Py_None, __pyx_v_param_formats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 423, __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":427
 * 
 *         cdef libpq.PGresult *rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQexecPrepared(
 *                 self._pgconn_ptr, name, <int>cnparams,
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":428
 *         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":427
 * 
 *         cdef libpq.PGresult *rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQexecPrepared(
 *                 self._pgconn_ptr, name, <int>cnparams,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":433
 *                 clengths, cformats, result_format)
 * 
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
  __pyx_f_9psycopg_c_2pq__clear_query_params(__pyx_v_ctypes, __pyx_v_cvalues, __pyx_v_clengths, __pyx_v_cformats); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 433, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":434
 * 
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing prepared query failed: {self.get_error_message()}"
*/
  __pyx_t_8 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_8)) {

    /* "psycopg_c/pq/pgconn.pyx":435
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"executing prepared query failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "psycopg_c/pq/pgconn.pyx":436
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"executing prepared query failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_13 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_13);
    __pyx_t_14 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
      __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_14, (1-__pyx_t_14) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 436, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
    }
    __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_11, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_executing_prepared_query_failed, __pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_14 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
      assert(__pyx_t_10);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
      __pyx_t_14 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11};
      __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 435, __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(1, 435, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":434
 * 
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing prepared query failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":438
 *                 f"executing prepared query failed: {self.get_error_message()}"
 *             )
 *         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(1, 438, __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":409
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* function exit code */
  __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.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":440
 *         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_43describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_43describe_prepared = {"describe_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_43describe_prepared, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_43describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 440, __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_42describe_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_42describe_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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("describe_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":441
 * 
 *     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(1, 441, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":442
 *     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 e.OperationalError(
*/
  __pyx_v_rv = PQdescribePrepared(__pyx_v_self->_pgconn_ptr, __pyx_v_name);

  /* "psycopg_c/pq/pgconn.pyx":443
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"
*/
  __pyx_t_2 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":444
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"describe prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":445
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_describe_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 444, __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(1, 444, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":443
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePrepared(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":447
 *                 f"describe prepared failed: {self.get_error_message()}"
 *             )
 *         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(1, 447, __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":440
 *         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_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.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":449
 *         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_45send_describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_45send_describe_prepared = {"send_describe_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_45send_describe_prepared, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_45send_describe_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 449, __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_44send_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_44send_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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_describe_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":450
 * 
 *     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(1, 450, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":451
 *     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":452
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePrepared(self._pgconn_ptr, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {self.get_error_message()}"
*/
  __pyx_t_2 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":453
 *         cdef int rv = libpq.PQsendDescribePrepared(self._pgconn_ptr, name)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending describe prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":454
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 454, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_describe_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 453, __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(1, 453, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":449
 *         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":457
 *             )
 * 
 *     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_47describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_47describe_portal = {"describe_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_47describe_portal, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_47describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 457, __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_46describe_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_46describe_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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("describe_portal", 0);

  /* "psycopg_c/pq/pgconn.pyx":458
 * 
 *     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(1, 458, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":459
 *     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 e.OperationalError(
*/
  __pyx_v_rv = PQdescribePortal(__pyx_v_self->_pgconn_ptr, __pyx_v_name);

  /* "psycopg_c/pq/pgconn.pyx":460
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"
*/
  __pyx_t_2 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":461
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"describe prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":462
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 462, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_describe_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 461, __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(1, 461, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":460
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"describe prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":464
 *                 f"describe prepared failed: {self.get_error_message()}"
 *             )
 *         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(1, 464, __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":457
 *             )
 * 
 *     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_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.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":466
 *         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_49send_describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_49send_describe_portal = {"send_describe_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_49send_describe_portal, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_49send_describe_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 466, __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_48send_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_48send_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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_describe_portal", 0);

  /* "psycopg_c/pq/pgconn.pyx":467
 * 
 *     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(1, 467, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":468
 *     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":469
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendDescribePortal(self._pgconn_ptr, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {self.get_error_message()}"
*/
  __pyx_t_2 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":470
 *         cdef int rv = libpq.PQsendDescribePortal(self._pgconn_ptr, name)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending describe prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":471
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending describe prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_describe_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __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(1, 470, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":466
 *         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":474
 *             )
 * 
 *     def close_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePrepared", 170000)
 *         _ensure_pgconn(self)
*/

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_51close_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_51close_prepared = {"close_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_51close_prepared, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_51close_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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("close_prepared (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 474, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.close_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_50close_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_50close_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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":475
 * 
 *     def close_prepared(self, const char *name) -> PGresult:
 *         _check_supported("PQclosePrepared", 170000)             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQclosePrepared(self._pgconn_ptr, name)
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQclosePrepared, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":476
 *     def close_prepared(self, const char *name) -> PGresult:
 *         _check_supported("PQclosePrepared", 170000)
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = libpq.PQclosePrepared(self._pgconn_ptr, name)
 *         if rv is NULL:
*/
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 476, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":477
 *         _check_supported("PQclosePrepared", 170000)
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQclosePrepared(self._pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
  __pyx_v_rv = PQclosePrepared(__pyx_v_self->_pgconn_ptr, __pyx_v_name);

  /* "psycopg_c/pq/pgconn.pyx":478
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQclosePrepared(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"
*/
  __pyx_t_3 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":479
 *         cdef libpq.PGresult *rv = libpq.PQclosePrepared(self._pgconn_ptr, name)
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":480
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 480, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_close_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 479, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 479, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":478
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQclosePrepared(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":482
 *                 f"close prepared failed: {self.get_error_message()}"
 *             )
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def send_close_prepared(self, const char *name) -> None:
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":474
 *             )
 * 
 *     def close_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePrepared", 170000)
 *         _ensure_pgconn(self)
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.close_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":484
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePrepared", 170000)
 *         _ensure_pgconn(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_53send_close_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_53send_close_prepared = {"send_close_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_53send_close_prepared, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_53send_close_prepared(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_close_prepared (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 484, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_close_prepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_52send_close_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_52send_close_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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_close_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":485
 * 
 *     def send_close_prepared(self, const char *name) -> None:
 *         _check_supported("PQsendClosePrepared", 170000)             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendClosePrepared(self._pgconn_ptr, name)
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQsendClosePrepared, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":486
 *     def send_close_prepared(self, const char *name) -> None:
 *         _check_supported("PQsendClosePrepared", 170000)
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef int rv = libpq.PQsendClosePrepared(self._pgconn_ptr, name)
 *         if not rv:
*/
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 486, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":487
 *         _check_supported("PQsendClosePrepared", 170000)
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendClosePrepared(self._pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
  __pyx_v_rv = PQsendClosePrepared(__pyx_v_self->_pgconn_ptr, __pyx_v_name);

  /* "psycopg_c/pq/pgconn.pyx":488
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendClosePrepared(self._pgconn_ptr, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"
*/
  __pyx_t_3 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":489
 *         cdef int rv = libpq.PQsendClosePrepared(self._pgconn_ptr, name)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":490
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 490, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_close_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 489, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":484
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePrepared", 170000)
 *         _ensure_pgconn(self)
*/

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_close_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":493
 *             )
 * 
 *     def close_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePortal", 170000)
 *         _ensure_pgconn(self)
*/

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_55close_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_55close_portal = {"close_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_55close_portal, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_55close_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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("close_portal (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 493, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_54close_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_54close_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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close_portal", 0);

  /* "psycopg_c/pq/pgconn.pyx":494
 * 
 *     def close_portal(self, const char *name) -> PGresult:
 *         _check_supported("PQclosePortal", 170000)             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQclosePortal(self._pgconn_ptr, name)
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQclosePortal, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":495
 *     def close_portal(self, const char *name) -> PGresult:
 *         _check_supported("PQclosePortal", 170000)
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = libpq.PQclosePortal(self._pgconn_ptr, name)
 *         if rv is NULL:
*/
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 495, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":496
 *         _check_supported("PQclosePortal", 170000)
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQclosePortal(self._pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
  __pyx_v_rv = PQclosePortal(__pyx_v_self->_pgconn_ptr, __pyx_v_name);

  /* "psycopg_c/pq/pgconn.pyx":497
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQclosePortal(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"
*/
  __pyx_t_3 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":498
 *         cdef libpq.PGresult *rv = libpq.PQclosePortal(self._pgconn_ptr, name)
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":499
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_close_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 498, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":497
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQclosePortal(self._pgconn_ptr, name)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":501
 *                 f"close prepared failed: {self.get_error_message()}"
 *             )
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     def send_close_portal(self, const char *name) -> None:
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":493
 *             )
 * 
 *     def close_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePortal", 170000)
 *         _ensure_pgconn(self)
*/

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.close_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":503
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePortal", 170000)
 *         _ensure_pgconn(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_57send_close_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_57send_close_portal = {"send_close_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_57send_close_portal, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_57send_close_portal(PyObject *__pyx_v_self, PyObject *__pyx_arg_name) {
  char const *__pyx_v_name;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_close_portal (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_name); {
    __pyx_v_name = __Pyx_PyObject_AsString(__pyx_arg_name); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(1, 503, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_56send_close_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_56send_close_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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_close_portal", 0);

  /* "psycopg_c/pq/pgconn.pyx":504
 * 
 *     def send_close_portal(self, const char *name) -> None:
 *         _check_supported("PQsendClosePortal", 170000)             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendClosePortal(self._pgconn_ptr, name)
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQsendClosePortal, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":505
 *     def send_close_portal(self, const char *name) -> None:
 *         _check_supported("PQsendClosePortal", 170000)
 *         _ensure_pgconn(self)             # <<<<<<<<<<<<<<
 *         cdef int rv = libpq.PQsendClosePortal(self._pgconn_ptr, name)
 *         if not rv:
*/
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq__ensure_pgconn(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 505, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":506
 *         _check_supported("PQsendClosePortal", 170000)
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendClosePortal(self._pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
  __pyx_v_rv = PQsendClosePortal(__pyx_v_self->_pgconn_ptr, __pyx_v_name);

  /* "psycopg_c/pq/pgconn.pyx":507
 *         _ensure_pgconn(self)
 *         cdef int rv = libpq.PQsendClosePortal(self._pgconn_ptr, name)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"
*/
  __pyx_t_3 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":508
 *         cdef int rv = libpq.PQsendClosePortal(self._pgconn_ptr, name)
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":509
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_close_prepared_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 508, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":503
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePortal", 170000)
 *         _ensure_pgconn(self)
*/

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.send_close_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":512
 *             )
 * 
 *     def get_result(self) -> "PGresult" | None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
*/

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_59get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_59get_result = {"get_result", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_59get_result, METH_NOARGS, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_59get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_result (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_58get_result(((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_PGresult *__pyx_pf_9psycopg_c_2pq_6PGconn_58get_result(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PGresult *__pyx_v_pgresult;
  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("get_result", 0);

  /* "psycopg_c/pq/pgconn.pyx":513
 * 
 *     def get_result(self) -> "PGresult" | None:
 *         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":514
 *     def get_result(self) -> "PGresult" | None:
 *         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":515
 *         cdef libpq.PGresult *pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(pgresult)
 * 
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":514
 *     def get_result(self) -> "PGresult" | None:
 *         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":516
 *         if pgresult is NULL:
 *             return None
 *         return PGresult._from_ptr(pgresult)             # <<<<<<<<<<<<<<
 * 
 *     def consume_input(self) -> None:
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_pgresult)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 516, __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":512
 *             )
 * 
 *     def get_result(self) -> "PGresult" | None:             # <<<<<<<<<<<<<<
 *         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((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":518
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):
 *             raise e.OperationalError(
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_61consume_input(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_61consume_input = {"consume_input", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_61consume_input, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_61consume_input(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("consume_input (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_60consume_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_60consume_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;
  size_t __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":519
 * 
 *     def consume_input(self) -> None:
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"consuming input failed: {self.get_error_message()}")
*/
  __pyx_t_1 = (1 != PQconsumeInput(__pyx_v_self->_pgconn_ptr));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":520
 *     def consume_input(self) -> None:
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"consuming input failed: {self.get_error_message()}")
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":521
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):
 *             raise e.OperationalError(
 *                 f"consuming input failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 * 
 *     def is_busy(self) -> int:
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_consuming_input_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 520, __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(1, 520, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":518
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):
 *             raise e.OperationalError(
*/

  /* 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":523
 *                 f"consuming input failed: {self.get_error_message()}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with nogil:
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_63is_busy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_63is_busy = {"is_busy", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_63is_busy, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_63is_busy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_busy (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_62is_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_62is_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":525
 *     def is_busy(self) -> int:
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisBusy(self._pgconn_ptr)
 *         return rv
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":526
 *         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":525
 *     def is_busy(self) -> int:
 *         cdef int rv
 *         with nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisBusy(self._pgconn_ptr)
 *         return rv
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":527
 *         with nogil:
 *             rv = libpq.PQisBusy(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(1, 527, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":523
 *                 f"consuming input failed: {self.get_error_message()}")
 * 
 *     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":529
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":531
 *     @property
 *     def nonblocking(self) -> int:
 *         return libpq.PQisnonblocking(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @nonblocking.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(PQisnonblocking(__pyx_v_self->_pgconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 531, __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":529
 *         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":533
 *         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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_arg); {
    __pyx_v_arg = __Pyx_PyLong_As_int(__pyx_arg_arg); if (unlikely((__pyx_v_arg == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 534, __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;
  size_t __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":535
 *     @nonblocking.setter
 *     def nonblocking(self, int arg) -> None:
 *         if 0 > libpq.PQsetnonblocking(self._pgconn_ptr, arg):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"setting nonblocking failed: {self.get_error_message()}")
*/
  __pyx_t_1 = (0 > PQsetnonblocking(__pyx_v_self->_pgconn_ptr, __pyx_v_arg));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":536
 *     def nonblocking(self, int arg) -> None:
 *         if 0 > libpq.PQsetnonblocking(self._pgconn_ptr, arg):
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"setting nonblocking failed: {self.get_error_message()}")
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":537
 *         if 0 > libpq.PQsetnonblocking(self._pgconn_ptr, arg):
 *             raise e.OperationalError(
 *                 f"setting nonblocking failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 * 
 *     cpdef int flush(self) except -1:
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 537, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_setting_nonblocking_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 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(1, 536, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":533
 *         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":539
 *                 f"setting nonblocking failed: {self.get_error_message()}")
 * 
 *     cpdef int flush(self) except -1:             # <<<<<<<<<<<<<<
 *         if self._pgconn_ptr == NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")
*/

static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_65flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static int __pyx_f_9psycopg_c_2pq_6PGconn_flush(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_v_rv;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flush", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  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)))
  #endif
  ) {
    #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_mstate_global->__pyx_n_u_flush); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9psycopg_c_2pq_6PGconn_65flush)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __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(1, 539, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 539, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __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":540
 * 
 *     cpdef int flush(self) except -1:
 *         if self._pgconn_ptr == NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("flushing failed: the connection is closed")
 *         cdef int rv = libpq.PQflush(self._pgconn_ptr)
*/
  __pyx_t_7 = (__pyx_v_self->_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_7)) {

    /* "psycopg_c/pq/pgconn.pyx":541
 *     cpdef int flush(self) except -1:
 *         if self._pgconn_ptr == NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")             # <<<<<<<<<<<<<<
 *         cdef int rv = libpq.PQflush(self._pgconn_ptr)
 *         if rv < 0:
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_flushing_failed_the_connection_i};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 541, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 541, __pyx_L1_error)

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

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

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

    /* "psycopg_c/pq/pgconn.pyx":544
 *         cdef int rv = libpq.PQflush(self._pgconn_ptr)
 *         if rv < 0:
 *             raise e.OperationalError(f"flushing failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 544, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_flushing_failed, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 544, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 544, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":545
 *         if rv < 0:
 *             raise e.OperationalError(f"flushing failed: {self.get_error_message()}")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def set_single_row_mode(self) -> None:
*/
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":539
 *                 f"setting nonblocking failed: {self.get_error_message()}")
 * 
 *     cpdef int flush(self) except -1:             # <<<<<<<<<<<<<<
 *         if self._pgconn_ptr == NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")
*/

  /* 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_8);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_65flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_65flush = {"flush", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_65flush, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_65flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_64flush(((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_64flush(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("flush", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq_6PGconn_flush(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 539, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":547
 *         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_67set_single_row_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_67set_single_row_mode = {"set_single_row_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_67set_single_row_mode, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_67set_single_row_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_single_row_mode (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_66set_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_66set_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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  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":548
 * 
 *     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":549
 *     def set_single_row_mode(self) -> None:
 *         if not libpq.PQsetSingleRowMode(self._pgconn_ptr):
 *             raise e.OperationalError("setting single row mode failed")             # <<<<<<<<<<<<<<
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_setting_single_row_mode_failed};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(1, 549, __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(1, 549, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":548
 * 
 *     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":547
 *         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_XDECREF(__pyx_t_5);
  __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":551
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:             # <<<<<<<<<<<<<<
 *         if not libpq.PQsetChunkedRowsMode(self._pgconn_ptr, size):
 *             raise e.OperationalError("setting chunked rows mode failed")
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_69set_chunked_rows_mode(PyObject *__pyx_v_self, PyObject *__pyx_v_size); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_69set_chunked_rows_mode = {"set_chunked_rows_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_69set_chunked_rows_mode, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_69set_chunked_rows_mode(PyObject *__pyx_v_self, PyObject *__pyx_v_size) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_chunked_rows_mode (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_size), (&PyLong_Type), 0, "size", 2))) __PYX_ERR(1, 551, __pyx_L1_error)
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_68set_chunked_rows_mode(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((PyObject*)__pyx_v_size));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_68set_chunked_rows_mode(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_size) {
  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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_chunked_rows_mode", 0);

  /* "psycopg_c/pq/pgconn.pyx":552
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:
 *         if not libpq.PQsetChunkedRowsMode(self._pgconn_ptr, size):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 552, __pyx_L1_error)
  __pyx_t_2 = (!(PQsetChunkedRowsMode(__pyx_v_self->_pgconn_ptr, __pyx_t_1) != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":553
 *     def set_chunked_rows_mode(self, size: int) -> None:
 *         if not libpq.PQsetChunkedRowsMode(self._pgconn_ptr, size):
 *             raise e.OperationalError("setting chunked rows mode failed")             # <<<<<<<<<<<<<<
 * 
 *     def cancel_conn(self) -> PGcancelConn:
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_setting_chunked_rows_mode_failed};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 553, __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(1, 553, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":552
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:
 *         if not libpq.PQsetChunkedRowsMode(self._pgconn_ptr, size):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":551
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:             # <<<<<<<<<<<<<<
 *         if not libpq.PQsetChunkedRowsMode(self._pgconn_ptr, size):
 *             raise e.OperationalError("setting chunked rows mode failed")
*/

  /* 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_AddTraceback("psycopg_c.pq.PGconn.set_chunked_rows_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":555
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
 *     def cancel_conn(self) -> PGcancelConn:             # <<<<<<<<<<<<<<
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr = libpq.PQcancelCreate(self._pgconn_ptr)
*/

/* Python wrapper */
static struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_pw_9psycopg_c_2pq_6PGconn_71cancel_conn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_71cancel_conn = {"cancel_conn", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_71cancel_conn, METH_NOARGS, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_pw_9psycopg_c_2pq_6PGconn_71cancel_conn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel_conn (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_70cancel_conn(((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_PGcancelConn *__pyx_pf_9psycopg_c_2pq_6PGconn_70cancel_conn(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PGcancelConn *__pyx_v_ptr;
  struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cancel_conn", 0);

  /* "psycopg_c/pq/pgconn.pyx":556
 * 
 *     def cancel_conn(self) -> PGcancelConn:
 *         _check_supported("PQcancelCreate", 170000)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancelConn *ptr = libpq.PQcancelCreate(self._pgconn_ptr)
 *         if not ptr:
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQcancelCreate, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":557
 *     def cancel_conn(self) -> PGcancelConn:
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr = libpq.PQcancelCreate(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancelConn object")
*/
  __pyx_v_ptr = PQcancelCreate(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":558
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr = libpq.PQcancelCreate(self._pgconn_ptr)
 *         if not ptr:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't create cancelConn object")
 *         return PGcancelConn._from_ptr(ptr)
*/
  __pyx_t_2 = (!(__pyx_v_ptr != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":559
 *         cdef libpq.PGcancelConn *ptr = libpq.PQcancelCreate(self._pgconn_ptr)
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancelConn object")             # <<<<<<<<<<<<<<
 *         return PGcancelConn._from_ptr(ptr)
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_create_cancelConn_objec};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 559, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":558
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr = libpq.PQcancelCreate(self._pgconn_ptr)
 *         if not ptr:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't create cancelConn object")
 *         return PGcancelConn._from_ptr(ptr)
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":560
 *         if not ptr:
 *             raise e.OperationalError("couldn't create cancelConn object")
 *         return PGcancelConn._from_ptr(ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_cancel(self) -> PGcancel:
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9psycopg_c_2pq_12PGcancelConn__from_ptr(__pyx_v_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":555
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
 *     def cancel_conn(self) -> PGcancelConn:             # <<<<<<<<<<<<<<
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr = libpq.PQcancelCreate(self._pgconn_ptr)
*/

  /* 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.PGconn.cancel_conn", __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":562
 *         return PGcancelConn._from_ptr(ptr)
 * 
 *     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_73get_cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_73get_cancel = {"get_cancel", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_73get_cancel, METH_NOARGS, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_pw_9psycopg_c_2pq_6PGconn_73get_cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  struct __pyx_obj_9psycopg_c_2pq_PGcancel *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_cancel (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_72get_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_72get_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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_cancel", 0);

  /* "psycopg_c/pq/pgconn.pyx":563
 * 
 *     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":564
 *     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":565
 *         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_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_create_cancel_object};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(1, 565, __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(1, 565, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":564
 *     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":566
 *         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(1, 566, __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":562
 *         return PGcancelConn._from_ptr(ptr)
 * 
 *     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_XDECREF(__pyx_t_5);
  __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":568
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with nogil:
*/

static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_75notifies(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;
  size_t __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 (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  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)))
  #endif
  ) {
    #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_mstate_global->__pyx_n_u_notifies); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9psycopg_c_2pq_6PGconn_75notifies)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __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(1, 568, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __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":570
 *     cpdef object notifies(self):
 *         cdef libpq.PGnotify *ptr
 *         with nogil:             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":571
 *         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":570
 *     cpdef object notifies(self):
 *         cdef libpq.PGnotify *ptr
 *         with nogil:             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "psycopg_c/pq/pgconn.pyx":572
 *         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":573
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:
 *             ret = PGnotify(ptr.relname, ptr.be_pid, ptr.extra)             # <<<<<<<<<<<<<<
 *             libpq.PQfreemem(ptr)
 *             return ret
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PGnotify); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_ptr->relname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_ptr->be_pid); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_ptr->extra); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_t_7, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_ret = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "psycopg_c/pq/pgconn.pyx":574
 *         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":575
 *             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":572
 *         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":577
 *             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":568
 *         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_75notifies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_75notifies = {"notifies", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_75notifies, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_75notifies(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("notifies (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_74notifies(((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_74notifies(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(1, 568, __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":579
 *             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_77put_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_v_buffer); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_77put_copy_data = {"put_copy_data", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_77put_copy_data, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_77put_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_v_buffer) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("put_copy_data (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_76put_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_76put_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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("put_copy_data", 0);

  /* "psycopg_c/pq/pgconn.pyx":584
 *         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(1, 584, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":585
 * 
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)
 *         rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)             # <<<<<<<<<<<<<<
 *         if rv < 0:
 *             raise e.OperationalError(
*/
  __pyx_v_rv = PQputCopyData(__pyx_v_self->_pgconn_ptr, __pyx_v_cbuffer, ((int)__pyx_v_length));

  /* "psycopg_c/pq/pgconn.pyx":586
 *         _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: {self.get_error_message()}")
*/
  __pyx_t_2 = (__pyx_v_rv < 0);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":587
 *         rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending copy data failed: {self.get_error_message()}")
 *         return rv
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":588
 *         if rv < 0:
 *             raise e.OperationalError(
 *                 f"sending copy data failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_copy_data_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 587, __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(1, 587, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":586
 *         _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: {self.get_error_message()}")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":589
 *             raise e.OperationalError(
 *                 f"sending copy data failed: {self.get_error_message()}")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def put_copy_end(self, error: bytes | None = None) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_3, NULL, 0) < (0)) __PYX_ERR(1, 589, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":579
 *             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":591
 *         return rv
 * 
 *     def put_copy_end(self, error: bytes | None = None) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef const char *cerr = NULL
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_79put_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_79put_copy_end = {"put_copy_end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_79put_copy_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_79put_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 Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  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_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_error,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 591, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "put_copy_end", 0) < (0)) __PYX_ERR(1, 591, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));
    }
    __pyx_v_error = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("put_copy_end", 0, 0, 1, __pyx_nargs); __PYX_ERR(1, 591, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.put_copy_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_error), (&PyBytes_Type), 1, "error", 2))) __PYX_ERR(1, 591, __pyx_L1_error)
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_78put_copy_end(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), __pyx_v_error);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_78put_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;
  size_t __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":593
 *     def put_copy_end(self, error: bytes | None = 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":594
 *         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 != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":595
 *         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 == ((void *)NULL))) __PYX_ERR(1, 595, __pyx_L1_error)
    __pyx_v_cerr = __pyx_t_2;

    /* "psycopg_c/pq/pgconn.pyx":594
 *         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":596
 *         if error is not None:
 *             cerr = PyBytes_AsString(error)
 *         rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)             # <<<<<<<<<<<<<<
 *         if rv < 0:
 *             raise e.OperationalError(
*/
  __pyx_v_rv = PQputCopyEnd(__pyx_v_self->_pgconn_ptr, __pyx_v_cerr);

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

    /* "psycopg_c/pq/pgconn.pyx":598
 *         rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending copy end failed: {self.get_error_message()}")
 *         return rv
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":599
 *         if rv < 0:
 *             raise e.OperationalError(
 *                 f"sending copy end failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 599, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_copy_end_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __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(1, 598, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":600
 *             raise e.OperationalError(
 *                 f"sending copy end failed: {self.get_error_message()}")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def get_copy_data(self, int async_) -> tuple[int, memoryview]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_3, NULL, 0) < (0)) __PYX_ERR(1, 600, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":591
 *         return rv
 * 
 *     def put_copy_end(self, error: bytes | None = 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":602
 *         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_81get_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_arg_async_); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_81get_copy_data = {"get_copy_data", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_81get_copy_data, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_81get_copy_data(PyObject *__pyx_v_self, PyObject *__pyx_arg_async_) {
  int __pyx_v_async_;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_async_); {
    __pyx_v_async_ = __Pyx_PyLong_As_int(__pyx_arg_async_); if (unlikely((__pyx_v_async_ == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 602, __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_80get_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_80get_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;
  size_t __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":603
 * 
 *     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":605
 *         cdef char *buffer_ptr = NULL
 *         cdef int nbytes
 *         nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)             # <<<<<<<<<<<<<<
 *         if nbytes == -2:
 *             raise e.OperationalError(
*/
  __pyx_v_nbytes = PQgetCopyData(__pyx_v_self->_pgconn_ptr, (&__pyx_v_buffer_ptr), __pyx_v_async_);

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

    /* "psycopg_c/pq/pgconn.pyx":607
 *         nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 *         if nbytes == -2:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"receiving copy data failed: {self.get_error_message()}")
 *         if buffer_ptr is not NULL:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":608
 *         if nbytes == -2:
 *             raise e.OperationalError(
 *                 f"receiving copy data failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 *         if buffer_ptr is not NULL:
 *             data = PyMemoryView_FromObject(
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_receiving_copy_data_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __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(1, 607, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":609
 *             raise e.OperationalError(
 *                 f"receiving copy data failed: {self.get_error_message()}")
 *         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":611
 *         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(1, 611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

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

    /* "psycopg_c/pq/pgconn.pyx":612
 *             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_5 = __Pyx_PyLong_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 612, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_data) != (0)) __PYX_ERR(1, 612, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

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

  /* "psycopg_c/pq/pgconn.pyx":614
 *             return nbytes, data
 *         else:
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview             # <<<<<<<<<<<<<<
 * 
 *     def trace(self, fileno: int) -> None:
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 614, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__5);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b__5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_b__5) != (0)) __PYX_ERR(1, 614, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgconn.pyx":602
 *         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":616
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 * 
 *     def trace(self, fileno: int) -> None:             # <<<<<<<<<<<<<<
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_83trace(PyObject *__pyx_v_self, PyObject *__pyx_v_fileno); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_83trace = {"trace", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_83trace, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_83trace(PyObject *__pyx_v_self, PyObject *__pyx_v_fileno) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("trace (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fileno), (&PyLong_Type), 0, "fileno", 2))) __PYX_ERR(1, 616, __pyx_L1_error)
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_82trace(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((PyObject*)__pyx_v_fileno));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_82trace(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_fileno) {
  FILE *__pyx_v_stream;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trace", 0);

  /* "psycopg_c/pq/pgconn.pyx":617
 * 
 *     def trace(self, fileno: int) -> None:
 *         if sys.platform != "linux":             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_linux, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 617, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":618
 *     def trace(self, fileno: int) -> None:
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")             # <<<<<<<<<<<<<<
 *         stream = fdopen(fileno, b"w")
 *         libpq.PQtrace(self._pgconn_ptr, stream)
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NotSupportedError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_currently_only_supported_on_Linu};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __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(1, 618, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":617
 * 
 *     def trace(self, fileno: int) -> None:
 *         if sys.platform != "linux":             # <<<<<<<<<<<<<<
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":619
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")             # <<<<<<<<<<<<<<
 *         libpq.PQtrace(self._pgconn_ptr, stream)
 * 
*/
  __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_fileno); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 619, __pyx_L1_error)
  __pyx_v_stream = fdopen(__pyx_t_7, __pyx_k_w);

  /* "psycopg_c/pq/pgconn.pyx":620
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")
 *         libpq.PQtrace(self._pgconn_ptr, stream)             # <<<<<<<<<<<<<<
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:
*/
  PQtrace(__pyx_v_self->_pgconn_ptr, __pyx_v_stream);

  /* "psycopg_c/pq/pgconn.pyx":616
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 * 
 *     def trace(self, fileno: int) -> None:             # <<<<<<<<<<<<<<
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")
*/

  /* 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_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.trace", __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":622
 *         libpq.PQtrace(self._pgconn_ptr, stream)
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsetTraceFlags", 140000)
 *         libpq.PQsetTraceFlags(self._pgconn_ptr, flags)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_85set_trace_flags(PyObject *__pyx_v_self, PyObject *__pyx_v_flags); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_85set_trace_flags = {"set_trace_flags", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_85set_trace_flags, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_85set_trace_flags(PyObject *__pyx_v_self, PyObject *__pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_trace_flags (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_84set_trace_flags(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), ((PyObject *)__pyx_v_flags));

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

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_84set_trace_flags(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, PyObject *__pyx_v_flags) {
  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("set_trace_flags", 0);

  /* "psycopg_c/pq/pgconn.pyx":623
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:
 *         _check_supported("PQsetTraceFlags", 140000)             # <<<<<<<<<<<<<<
 *         libpq.PQsetTraceFlags(self._pgconn_ptr, flags)
 * 
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQsetTraceFlags, 0x222E0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":624
 *     def set_trace_flags(self, flags: Trace) -> None:
 *         _check_supported("PQsetTraceFlags", 140000)
 *         libpq.PQsetTraceFlags(self._pgconn_ptr, flags)             # <<<<<<<<<<<<<<
 * 
 *     def untrace(self) -> None:
*/
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_v_flags); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 624, __pyx_L1_error)
  PQsetTraceFlags(__pyx_v_self->_pgconn_ptr, __pyx_t_2);

  /* "psycopg_c/pq/pgconn.pyx":622
 *         libpq.PQtrace(self._pgconn_ptr, stream)
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsetTraceFlags", 140000)
 *         libpq.PQsetTraceFlags(self._pgconn_ptr, flags)
*/

  /* 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.PGconn.set_trace_flags", __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":626
 *         libpq.PQsetTraceFlags(self._pgconn_ptr, flags)
 * 
 *     def untrace(self) -> None:             # <<<<<<<<<<<<<<
 *         libpq.PQuntrace(self._pgconn_ptr)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_87untrace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_87untrace = {"untrace", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_87untrace, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_87untrace(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("untrace (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_86untrace(((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_86untrace(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("untrace", 0);

  /* "psycopg_c/pq/pgconn.pyx":627
 * 
 *     def untrace(self) -> None:
 *         libpq.PQuntrace(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def encrypt_password(
*/
  PQuntrace(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":626
 *         libpq.PQsetTraceFlags(self._pgconn_ptr, flags)
 * 
 *     def untrace(self) -> None:             # <<<<<<<<<<<<<<
 *         libpq.PQuntrace(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":629
 *         libpq.PQuntrace(self._pgconn_ptr)
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_89encrypt_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_89encrypt_password = {"encrypt_password", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_89encrypt_password, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_89encrypt_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 Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  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_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_passwd,&__pyx_mstate_global->__pyx_n_u_user,&__pyx_mstate_global->__pyx_n_u_algorithm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 629, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 629, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 629, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 629, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "encrypt_password", 0) < (0)) __PYX_ERR(1, 629, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":630
 * 
 *     def encrypt_password(
 *         self, const char *passwd, const char *user, algorithm = None             # <<<<<<<<<<<<<<
 *     ) -> bytes:
 *         _check_supported("PQencryptPasswordConn", 100000)
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("encrypt_password", 0, 2, 3, i); __PYX_ERR(1, 629, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 629, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 629, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 629, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_passwd = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_passwd) && PyErr_Occurred())) __PYX_ERR(1, 630, __pyx_L3_error)
    __pyx_v_user = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_user) && PyErr_Occurred())) __PYX_ERR(1, 630, __pyx_L3_error)
    __pyx_v_algorithm = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("encrypt_password", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 629, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_88encrypt_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":629
 *         libpq.PQuntrace(self._pgconn_ptr)
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_88encrypt_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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  char const *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encrypt_password", 0);

  /* "psycopg_c/pq/pgconn.pyx":632
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
 *         _check_supported("PQencryptPasswordConn", 100000)             # <<<<<<<<<<<<<<
 * 
 *         cdef char *out
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQencryptPasswordConn, 0x186A0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":635
 * 
 *         cdef char *out
 *         cdef const char *calgo = NULL             # <<<<<<<<<<<<<<
 *         if algorithm:
 *             calgo = algorithm
*/
  __pyx_v_calgo = NULL;

  /* "psycopg_c/pq/pgconn.pyx":636
 *         cdef char *out
 *         cdef const char *calgo = NULL
 *         if algorithm:             # <<<<<<<<<<<<<<
 *             calgo = algorithm
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_algorithm); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 636, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":637
 *         cdef const char *calgo = NULL
 *         if algorithm:
 *             calgo = algorithm             # <<<<<<<<<<<<<<
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:
*/
    __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_algorithm); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 637, __pyx_L1_error)
    __pyx_v_calgo = __pyx_t_3;

    /* "psycopg_c/pq/pgconn.pyx":636
 *         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":638
 *         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":639
 *             calgo = algorithm
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"
*/
  __pyx_t_2 = (!(__pyx_v_out != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":640
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"password encryption failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":641
 *         if not out:
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 641, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_password_encryption_failed, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 640, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":639
 *             calgo = algorithm
 *         out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":644
 *             )
 * 
 *         rv = bytes(out)             # <<<<<<<<<<<<<<
 *         libpq.PQfreemem(out)
 *         return rv
*/
  __pyx_t_6 = NULL;
  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_out); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":645
 * 
 *         rv = bytes(out)
 *         libpq.PQfreemem(out)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PQfreemem(__pyx_v_out);

  /* "psycopg_c/pq/pgconn.pyx":646
 *         rv = bytes(out)
 *         libpq.PQfreemem(out)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def change_password(
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":629
 *         libpq.PQuntrace(self._pgconn_ptr)
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
*/

  /* 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_XDECREF(__pyx_t_7);
  __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":648
 *         return rv
 * 
 *     def change_password(             # <<<<<<<<<<<<<<
 *         self, const char *user, const char *passwd
 *     ) -> None:
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_91change_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_91change_password = {"change_password", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_91change_password, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_91change_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_user;
  char const *__pyx_v_passwd;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("change_password (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_user,&__pyx_mstate_global->__pyx_n_u_passwd,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 648, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 648, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 648, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "change_password", 0) < (0)) __PYX_ERR(1, 648, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("change_password", 1, 2, 2, i); __PYX_ERR(1, 648, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 648, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 648, __pyx_L3_error)
    }
    __pyx_v_user = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_user) && PyErr_Occurred())) __PYX_ERR(1, 649, __pyx_L3_error)
    __pyx_v_passwd = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_passwd) && PyErr_Occurred())) __PYX_ERR(1, 649, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("change_password", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 648, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.change_password", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_90change_password(((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_v_self), __pyx_v_user, __pyx_v_passwd);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_6PGconn_90change_password(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, char const *__pyx_v_user, char const *__pyx_v_passwd) {
  PGresult *__pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("change_password", 0);

  /* "psycopg_c/pq/pgconn.pyx":651
 *         self, const char *user, const char *passwd
 *     ) -> None:
 *         _check_supported("PQchangePassword", 170000)             # <<<<<<<<<<<<<<
 * 
 *         cdef libpq.PGresult *res
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQchangePassword, 0x29810); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":654
 * 
 *         cdef libpq.PGresult *res
 *         res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)             # <<<<<<<<<<<<<<
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:
 *             raise e.OperationalError(
*/
  __pyx_v_res = PQchangePassword(__pyx_v_self->_pgconn_ptr, __pyx_v_user, __pyx_v_passwd);

  /* "psycopg_c/pq/pgconn.pyx":655
 *         cdef libpq.PGresult *res
 *         res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"
*/
  __pyx_t_1 = __Pyx_PyLong_From_ExecStatusType(PQresultStatus(__pyx_v_res)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExecStatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_COMMAND_OK); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "psycopg_c/pq/pgconn.pyx":656
 *         res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"password encryption failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "psycopg_c/pq/pgconn.pyx":657
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_password_encryption_failed, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 656, __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(1, 656, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":655
 *         cdef libpq.PGresult *res
 *         res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"password encryption failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":648
 *         return rv
 * 
 *     def change_password(             # <<<<<<<<<<<<<<
 *         self, const char *user, const char *passwd
 *     ) -> None:
*/

  /* 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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_c.pq.PGconn.change_password", __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":660
 *             )
 * 
 *     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_93make_empty_result(PyObject *__pyx_v_self, PyObject *__pyx_arg_exec_status); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_93make_empty_result = {"make_empty_result", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_93make_empty_result, METH_O, 0};
static struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_pw_9psycopg_c_2pq_6PGconn_93make_empty_result(PyObject *__pyx_v_self, PyObject *__pyx_arg_exec_status) {
  int __pyx_v_exec_status;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_exec_status); {
    __pyx_v_exec_status = __Pyx_PyLong_As_int(__pyx_arg_exec_status); if (unlikely((__pyx_v_exec_status == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 660, __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_92make_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_92make_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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_empty_result", 0);

  /* "psycopg_c/pq/pgconn.pyx":661
 * 
 *     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":663
 *         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":664
 *             self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
 *         if not rv:
 *             raise MemoryError("couldn't allocate empty PGresult")             # <<<<<<<<<<<<<<
 *         return PGresult._from_ptr(rv)
 * 
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_empty_PGresult};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 664, __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(1, 664, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":663
 *         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":665
 *         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(1, 665, __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":660
 *             )
 * 
 *     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_XDECREF(__pyx_t_3);
  __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":667
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":673
 *         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":674
 *         """
 *         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_PyLong_From_PGpipelineStatus(PQ_PIPELINE_OFF); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 674, __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":673
 *         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":675
 *         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":676
 *             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_PyLong_From_int(__pyx_v_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 676, __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":667
 *         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":678
 *         return status
 * 
 *     def enter_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enter pipeline mode.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_95enter_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_9psycopg_c_2pq_6PGconn_94enter_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_95enter_pipeline_mode = {"enter_pipeline_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_95enter_pipeline_mode, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_94enter_pipeline_mode};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_95enter_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("enter_pipeline_mode (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_94enter_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_94enter_pipeline_mode(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;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("enter_pipeline_mode", 0);

  /* "psycopg_c/pq/pgconn.pyx":684
 *             mode.
 *         """
 *         _check_supported("PQenterPipelineMode", 140000)             # <<<<<<<<<<<<<<
 *         if libpq.PQenterPipelineMode(self._pgconn_ptr) != 1:
 *             raise e.OperationalError("failed to enter pipeline mode")
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQenterPipelineMode, 0x222E0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":685
 *         """
 *         _check_supported("PQenterPipelineMode", 140000)
 *         if libpq.PQenterPipelineMode(self._pgconn_ptr) != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
*/
  __pyx_t_2 = (PQenterPipelineMode(__pyx_v_self->_pgconn_ptr) != 1);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":686
 *         _check_supported("PQenterPipelineMode", 140000)
 *         if libpq.PQenterPipelineMode(self._pgconn_ptr) != 1:
 *             raise e.OperationalError("failed to enter pipeline mode")             # <<<<<<<<<<<<<<
 * 
 *     def exit_pipeline_mode(self) -> None:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_failed_to_enter_pipeline_mode};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 686, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":685
 *         """
 *         _check_supported("PQenterPipelineMode", 140000)
 *         if libpq.PQenterPipelineMode(self._pgconn_ptr) != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":678
 *         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_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":688
 *             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_97exit_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_9psycopg_c_2pq_6PGconn_96exit_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_97exit_pipeline_mode = {"exit_pipeline_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_97exit_pipeline_mode, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_96exit_pipeline_mode};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_97exit_pipeline_mode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("exit_pipeline_mode (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_96exit_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_96exit_pipeline_mode(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;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exit_pipeline_mode", 0);

  /* "psycopg_c/pq/pgconn.pyx":694
 *             mode.
 *         """
 *         _check_supported("PQexitPipelineMode", 140000)             # <<<<<<<<<<<<<<
 *         if libpq.PQexitPipelineMode(self._pgconn_ptr) != 1:
 *             raise e.OperationalError(self.get_error_message())
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQexitPipelineMode, 0x222E0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":695
 *         """
 *         _check_supported("PQexitPipelineMode", 140000)
 *         if libpq.PQexitPipelineMode(self._pgconn_ptr) != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(self.get_error_message())
 * 
*/
  __pyx_t_2 = (PQexitPipelineMode(__pyx_v_self->_pgconn_ptr) != 1);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":696
 *         _check_supported("PQexitPipelineMode", 140000)
 *         if libpq.PQexitPipelineMode(self._pgconn_ptr) != 1:
 *             raise e.OperationalError(self.get_error_message())             # <<<<<<<<<<<<<<
 * 
 *     def pipeline_sync(self) -> None:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 696, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 696, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 696, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":695
 *         """
 *         _check_supported("PQexitPipelineMode", 140000)
 *         if libpq.PQexitPipelineMode(self._pgconn_ptr) != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(self.get_error_message())
 * 
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":688
 *             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_1);
  __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.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":698
 *             raise e.OperationalError(self.get_error_message())
 * 
 *     def pipeline_sync(self) -> None:             # <<<<<<<<<<<<<<
 *         """Mark a synchronization point in a pipeline.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_99pipeline_sync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_9psycopg_c_2pq_6PGconn_98pipeline_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_99pipeline_sync = {"pipeline_sync", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_99pipeline_sync, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_98pipeline_sync};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_99pipeline_sync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pipeline_sync (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_98pipeline_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_98pipeline_sync(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_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pipeline_sync", 0);

  /* "psycopg_c/pq/pgconn.pyx":704
 *             or if sync failed.
 *         """
 *         _check_supported("PQpipelineSync", 140000)             # <<<<<<<<<<<<<<
 *         rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_n_u_PQpipelineSync, 0x222E0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":705
 *         """
 *         _check_supported("PQpipelineSync", 140000)
 *         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":706
 *         _check_supported("PQpipelineSync", 140000)
 *         rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:
*/
  __pyx_t_2 = (__pyx_v_rv == 0);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":707
 *         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_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_connection_not_in_pipeline_mode};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 707, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 707, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":706
 *         _check_supported("PQpipelineSync", 140000)
 *         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":708
 *         if rv == 0:
 *             raise e.OperationalError("connection not in pipeline mode")
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to sync pipeline")
 * 
*/
  __pyx_t_2 = (__pyx_v_rv != 1);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":709
 *             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_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_failed_to_sync_pipeline};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 709, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 709, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":708
 *         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":698
 *             raise e.OperationalError(self.get_error_message())
 * 
 *     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_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":711
 *             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_101send_flush_request(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_9psycopg_c_2pq_6PGconn_100send_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_101send_flush_request = {"send_flush_request", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_101send_flush_request, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_100send_flush_request};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_101send_flush_request(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send_flush_request (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_100send_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_100send_flush_request(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_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_flush_request", 0);

  /* "psycopg_c/pq/pgconn.pyx":716
 *         :raises ~e.OperationalError: if the flush request failed.
 *         """
 *         _check_supported("PQsendFlushRequest ", 140000)             # <<<<<<<<<<<<<<
 *         cdef int rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__check_supported(__pyx_mstate_global->__pyx_kp_u_PQsendFlushRequest, 0x222E0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":717
 *         """
 *         _check_supported("PQsendFlushRequest ", 140000)
 *         cdef int rv = libpq.PQsendFlushRequest(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv == 0:
 *             raise e.OperationalError(
*/
  __pyx_v_rv = PQsendFlushRequest(__pyx_v_self->_pgconn_ptr);

  /* "psycopg_c/pq/pgconn.pyx":718
 *         _check_supported("PQsendFlushRequest ", 140000)
 *         cdef int rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"flush request failed: {self.get_error_message()}")
*/
  __pyx_t_2 = (__pyx_v_rv == 0);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":719
 *         cdef int rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"flush request failed: {self.get_error_message()}")
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 719, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 719, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":720
 *         if rv == 0:
 *             raise e.OperationalError(
 *                 f"flush request failed: {self.get_error_message()}")             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_flush_request_failed, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 719, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 719, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":718
 *         _check_supported("PQsendFlushRequest ", 140000)
 *         cdef int rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"flush request failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":711
 *             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_1);
  __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.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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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_103__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_103__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_103__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_103__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_102__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_102__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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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_105__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_6PGconn_105__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_105__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_6PGconn_105__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_6PGconn_104__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_104__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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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":723
 * 
 * 
 * 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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ensure_pgconn", 0);

  /* "psycopg_c/pq/pgconn.pyx":724
 * 
 * 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":725
 * 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":724
 * 
 * cdef int _ensure_pgconn(PGconn pgconn) except 0:
 *     if pgconn._pgconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *         return 1
 * 
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":727
 *         return 1
 * 
 *     raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __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(1, 727, __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(1, 727, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":723
 * 
 * 
 * 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_XDECREF(__pyx_t_5);
  __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":730
 * 
 * 
 * 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;
  int __pyx_t_1;
  int __pyx_t_2;
  char *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "psycopg_c/pq/pgconn.pyx":734
 *     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(1, 734, __pyx_L1_error)
  __pyx_t_2 = (!(__pyx_t_1 != 0));
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":735
 *     """
 *     if not _ensure_pgconn(pgconn):
 *         return NULL             # <<<<<<<<<<<<<<
 *     cdef char *rv = func(pgconn._pgconn_ptr)
 *     if rv is not NULL:
*/
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":734
 *     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":736
 *     if not _ensure_pgconn(pgconn):
 *         return NULL
 *     cdef char *rv = func(pgconn._pgconn_ptr)             # <<<<<<<<<<<<<<
 *     if rv is not NULL:
 *         return rv
*/
  __pyx_t_3 = __pyx_v_func(__pyx_v_pgconn->_pgconn_ptr); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 736, __pyx_L1_error)
  __pyx_v_rv = __pyx_t_3;

  /* "psycopg_c/pq/pgconn.pyx":737
 *         return NULL
 *     cdef char *rv = func(pgconn._pgconn_ptr)
 *     if rv is not NULL:             # <<<<<<<<<<<<<<
 *         return rv
 *     else:
*/
  __pyx_t_2 = (__pyx_v_rv != NULL);
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":738
 *     cdef char *rv = func(pgconn._pgconn_ptr)
 *     if rv is not NULL:
 *         return rv             # <<<<<<<<<<<<<<
 *     else:
 *         return b""
*/
    __pyx_r = __pyx_v_rv;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":737
 *         return NULL
 *     cdef char *rv = func(pgconn._pgconn_ptr)
 *     if rv is not NULL:             # <<<<<<<<<<<<<<
 *         return rv
 *     else:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":740
 *         return rv
 *     else:
 *         return b""             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __pyx_r = ((char *)"");
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgconn.pyx":730
 * 
 * 
 * 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:;
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":743
 * 
 * 
 * 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;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "psycopg_c/pq/pgconn.pyx":747
 *     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(1, 747, __pyx_L1_error)
  __pyx_t_2 = (!(__pyx_t_1 != 0));
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":748
 *     """
 *     if not _ensure_pgconn(pgconn):
 *         return -2             # <<<<<<<<<<<<<<
 *     return func(pgconn._pgconn_ptr)
 * 
*/
    __pyx_r = -2;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":747
 *     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":749
 *     if not _ensure_pgconn(pgconn):
 *         return -2
 *     return func(pgconn._pgconn_ptr)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_v_func(__pyx_v_pgconn->_pgconn_ptr); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":743
 * 
 * 
 * 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:;
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":752
 * 
 * 
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) noexcept 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;
  size_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  char const *__pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("notice_receiver", 0);

  /* "psycopg_c/pq/pgconn.pyx":753
 * 
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) noexcept with gil:
 *     cdef PGconn pgconn = <object>arg             # <<<<<<<<<<<<<<
 *     if pgconn.notice_handler is None:
 *         return
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_arg);
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn))))) __PYX_ERR(1, 753, __pyx_L1_error)
  __pyx_v_pgconn = ((struct __pyx_obj_9psycopg_c_2pq_PGconn *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":754
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) noexcept 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":755
 *     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":754
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) noexcept with gil:
 *     cdef PGconn pgconn = <object>arg
 *     if pgconn.notice_handler is None:             # <<<<<<<<<<<<<<
 *         return
 * 
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":757
 *         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(1, 757, __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":758
 * 
 *     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":759
 *     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_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_pgconn->notice_handler);
        __pyx_t_7 = __pyx_v_pgconn->notice_handler; 
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          assert(__pyx_t_6);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_res)};
          __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 759, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "psycopg_c/pq/pgconn.pyx":758
 * 
 *     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":760
 *     try:
 *         pgconn.notice_handler(res)
 *     except Exception as e:             # <<<<<<<<<<<<<<
 *         logger.exception("error in notice receiver: %s", e)
 *     finally:
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("psycopg_c.pq.notice_receiver", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 760, __pyx_L9_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_v_e = __pyx_t_7;
        /*try:*/ {

          /* "psycopg_c/pq/pgconn.pyx":761
 *         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_t_11 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_logger); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 761, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_exception); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 761, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_8 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
            assert(__pyx_t_11);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
            __pyx_t_8 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_error_in_notice_receiver_s, __pyx_v_e};
            __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 761, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }

        /* "psycopg_c/pq/pgconn.pyx":760
 *     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_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            if ( unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __pyx_t_9 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
            goto __pyx_L9_except_error;
          }
          __pyx_L19:;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L8_exception_handled;
      }
      goto __pyx_L9_except_error;

      /* "psycopg_c/pq/pgconn.pyx":758
 * 
 *     cdef PGresult res = PGresult._from_ptr(<libpq.PGresult *>res_ptr)
 *     try:             # <<<<<<<<<<<<<<
 *         pgconn.notice_handler(res)
 *     except Exception as e:
*/
      __pyx_L9_except_error:;
      __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":763
 *         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_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 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_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
      if ( 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_21);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __pyx_t_14 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_22 = __pyx_filename;
      {
        __pyx_v_res->_pgresult_ptr = NULL;
      }
      __Pyx_XGIVEREF(__pyx_t_21);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
      __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_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
      __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_22;
      goto __pyx_L1_error;
    }
    __pyx_L6:;
  }

  /* "psycopg_c/pq/pgconn.pyx":752
 * 
 * 
 * cdef void notice_receiver(void *arg, const libpq.PGresult *res_ptr) noexcept 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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
}

/* "psycopg_c/pq/pgconn.pyx":766
 * 
 * 
 * cdef (Py_ssize_t, libpq.Oid *, char * const*, int *, int *) _query_params_args(             # <<<<<<<<<<<<<<
 *     param_values: Sequence[bytes | None] | None,
 *     param_types: Sequence[int] | None,
*/

static __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____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_values_fast = 0;
  PyObject *__pyx_v_types_fast = 0;
  PyObject *__pyx_v_formats_fast = 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;
  Oid *__pyx_v_atypes;
  int *__pyx_v_aformats;
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_r;
  __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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[5];
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13;
  Oid __pyx_t_14;
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_query_params_args", 0);

  /* "psycopg_c/pq/pgconn.pyx":777
 *     cdef formats_fast
 * 
 *     cdef Py_ssize_t nparams = 0             # <<<<<<<<<<<<<<
 *     if param_values is not None:
 *         values_fast = PySequence_Fast(param_values, "'param_values' is not a sequence")
*/
  __pyx_v_nparams = 0;

  /* "psycopg_c/pq/pgconn.pyx":778
 * 
 *     cdef Py_ssize_t nparams = 0
 *     if param_values is not None:             # <<<<<<<<<<<<<<
 *         values_fast = PySequence_Fast(param_values, "'param_values' is not a sequence")
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)
*/
  __pyx_t_1 = (__pyx_v_param_values != Py_None);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":779
 *     cdef Py_ssize_t nparams = 0
 *     if param_values is not None:
 *         values_fast = PySequence_Fast(param_values, "'param_values' is not a sequence")             # <<<<<<<<<<<<<<
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)
 * 
*/
    __pyx_t_2 = PySequence_Fast(__pyx_v_param_values, ((char *)"'param_values' is not a sequence")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_values_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_c/pq/pgconn.pyx":780
 *     if param_values is not None:
 *         values_fast = PySequence_Fast(param_values, "'param_values' is not a sequence")
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)             # <<<<<<<<<<<<<<
 * 
 *     if param_types is not None:
*/
    __pyx_v_nparams = PySequence_Fast_GET_SIZE(__pyx_v_values_fast);

    /* "psycopg_c/pq/pgconn.pyx":778
 * 
 *     cdef Py_ssize_t nparams = 0
 *     if param_values is not None:             # <<<<<<<<<<<<<<
 *         values_fast = PySequence_Fast(param_values, "'param_values' is not a sequence")
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":782
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)
 * 
 *     if param_types is not None:             # <<<<<<<<<<<<<<
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:
*/
  __pyx_t_1 = (__pyx_v_param_types != Py_None);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":783
 * 
 *     if param_types is not None:
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")             # <<<<<<<<<<<<<<
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:
 *             raise ValueError(
*/
    __pyx_t_2 = PySequence_Fast(__pyx_v_param_types, ((char *)"'param_types' is not a sequence")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_types_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_c/pq/pgconn.pyx":784
 *     if param_types is not None:
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_types)} param_types"
*/
    __pyx_t_1 = (PySequence_Fast_GET_SIZE(__pyx_v_types_fast) != __pyx_v_nparams);
    if (unlikely(__pyx_t_1)) {

      /* "psycopg_c/pq/pgconn.pyx":785
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 f"got {nparams} param_values but {len(param_types)} param_types"
 *             )
*/
      __pyx_t_3 = NULL;

      /* "psycopg_c/pq/pgconn.pyx":786
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_types)} param_types"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
      __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_nparams, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_Length(__pyx_v_param_types); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 786, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_got;
      __pyx_t_7[1] = __pyx_t_4;
      __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_param_values_but;
      __pyx_t_7[3] = __pyx_t_6;
      __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_param_types_2;
      __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 18 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 12, 127);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 785, __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(1, 785, __pyx_L1_error)

      /* "psycopg_c/pq/pgconn.pyx":784
 *     if param_types is not None:
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_types)} param_types"
*/
    }

    /* "psycopg_c/pq/pgconn.pyx":782
 *         nparams = PySequence_Fast_GET_SIZE(values_fast)
 * 
 *     if param_types is not None:             # <<<<<<<<<<<<<<
 *         types_fast = PySequence_Fast(param_types, "'param_types' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(types_fast) != nparams:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":789
 *             )
 * 
 *     if param_formats is not None:             # <<<<<<<<<<<<<<
 *         formats_fast = PySequence_Fast(
 *             param_formats, "'param_formats' is not a sequence")
*/
  __pyx_t_1 = (__pyx_v_param_formats != Py_None);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":790
 * 
 *     if param_formats is not None:
 *         formats_fast = PySequence_Fast(             # <<<<<<<<<<<<<<
 *             param_formats, "'param_formats' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(formats_fast) != nparams:
*/
    __pyx_t_2 = PySequence_Fast(__pyx_v_param_formats, ((char *)"'param_formats' is not a sequence")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_formats_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_c/pq/pgconn.pyx":792
 *         formats_fast = PySequence_Fast(
 *             param_formats, "'param_formats' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(formats_fast) != nparams:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_formats)} param_formats"
*/
    __pyx_t_1 = (PySequence_Fast_GET_SIZE(__pyx_v_formats_fast) != __pyx_v_nparams);
    if (unlikely(__pyx_t_1)) {

      /* "psycopg_c/pq/pgconn.pyx":793
 *             param_formats, "'param_formats' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(formats_fast) != nparams:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 f"got {nparams} param_values but {len(param_formats)} param_formats"
 *             )
*/
      __pyx_t_8 = NULL;

      /* "psycopg_c/pq/pgconn.pyx":794
 *         if PySequence_Fast_GET_SIZE(formats_fast) != nparams:
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_formats)} param_formats"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
      __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_nparams, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_Length(__pyx_v_param_formats); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 794, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 794, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_got;
      __pyx_t_7[1] = __pyx_t_3;
      __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_param_values_but;
      __pyx_t_7[3] = __pyx_t_6;
      __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_param_formats_2;
      __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 18 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 14, 127);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 794, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __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(1, 793, __pyx_L1_error)

      /* "psycopg_c/pq/pgconn.pyx":792
 *         formats_fast = PySequence_Fast(
 *             param_formats, "'param_formats' is not a sequence")
 *         if PySequence_Fast_GET_SIZE(formats_fast) != nparams:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f"got {nparams} param_values but {len(param_formats)} param_formats"
*/
    }

    /* "psycopg_c/pq/pgconn.pyx":789
 *             )
 * 
 *     if param_formats is not None:             # <<<<<<<<<<<<<<
 *         formats_fast = PySequence_Fast(
 *             param_formats, "'param_formats' is not a sequence")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":797
 *             )
 * 
 *     cdef char **aparams = NULL             # <<<<<<<<<<<<<<
 *     cdef int *alenghts = NULL
 *     cdef char *ptr
*/
  __pyx_v_aparams = NULL;

  /* "psycopg_c/pq/pgconn.pyx":798
 * 
 *     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":802
 *     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":803
 * 
 *     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":804
 *     if nparams:
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))             # <<<<<<<<<<<<<<
 *         for i in range(nparams):
 *             obj = PySequence_Fast_GET_ITEM(values_fast, i)
*/
    __pyx_v_alenghts = ((int *)PyMem_Malloc((__pyx_v_nparams * (sizeof(int)))));

    /* "psycopg_c/pq/pgconn.pyx":805
 *         aparams = <char **>PyMem_Malloc(nparams * sizeof(char *))
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
 *         for i in range(nparams):             # <<<<<<<<<<<<<<
 *             obj = PySequence_Fast_GET_ITEM(values_fast, i)
 *             if obj != <PyObject *>None:
*/
    __pyx_t_5 = __pyx_v_nparams;
    __pyx_t_10 = __pyx_t_5;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "psycopg_c/pq/pgconn.pyx":806
 *         alenghts = <int *>PyMem_Malloc(nparams * sizeof(int))
 *         for i in range(nparams):
 *             obj = PySequence_Fast_GET_ITEM(values_fast, i)             # <<<<<<<<<<<<<<
 *             if obj != <PyObject *>None:
 *                 # TODO: it is a leak if this fails (but it should only fail
*/
      if (unlikely(!__pyx_v_values_fast)) { __Pyx_RaiseUnboundLocalError("values_fast"); __PYX_ERR(1, 806, __pyx_L1_error) }
      __pyx_v_obj = PySequence_Fast_GET_ITEM(__pyx_v_values_fast, __pyx_v_i);

      /* "psycopg_c/pq/pgconn.pyx":807
 *         for i in range(nparams):
 *             obj = PySequence_Fast_GET_ITEM(values_fast, i)
 *             if obj != <PyObject *>None:             # <<<<<<<<<<<<<<
 *                 # TODO: it is a leak if this fails (but it should only fail
 *                 # on internal error, e.g. if obj is not a buffer)
*/
      __pyx_t_1 = (__pyx_v_obj != ((PyObject *)Py_None));
      if (__pyx_t_1) {

        /* "psycopg_c/pq/pgconn.pyx":810
 *                 # 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(<object>obj, &ptr, &length)             # <<<<<<<<<<<<<<
 *                 aparams[i] = ptr
 *                 alenghts[i] = <int>length
*/
        __pyx_t_12 = __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(((PyObject *)__pyx_v_obj), (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 810, __pyx_L1_error)

        /* "psycopg_c/pq/pgconn.pyx":811
 *                 # on internal error, e.g. if obj is not a buffer)
 *                 _buffer_as_string_and_size(<object>obj, &ptr, &length)
 *                 aparams[i] = ptr             # <<<<<<<<<<<<<<
 *                 alenghts[i] = <int>length
 *             else:
*/
        (__pyx_v_aparams[__pyx_v_i]) = __pyx_v_ptr;

        /* "psycopg_c/pq/pgconn.pyx":812
 *                 _buffer_as_string_and_size(<object>obj, &ptr, &length)
 *                 aparams[i] = ptr
 *                 alenghts[i] = <int>length             # <<<<<<<<<<<<<<
 *             else:
 *                 aparams[i] = NULL
*/
        (__pyx_v_alenghts[__pyx_v_i]) = ((int)__pyx_v_length);

        /* "psycopg_c/pq/pgconn.pyx":807
 *         for i in range(nparams):
 *             obj = PySequence_Fast_GET_ITEM(values_fast, i)
 *             if obj != <PyObject *>None:             # <<<<<<<<<<<<<<
 *                 # TODO: it is a leak if this fails (but it should only fail
 *                 # on internal error, e.g. if obj is not a buffer)
*/
        goto __pyx_L11;
      }

      /* "psycopg_c/pq/pgconn.pyx":814
 *                 alenghts[i] = <int>length
 *             else:
 *                 aparams[i] = NULL             # <<<<<<<<<<<<<<
 *                 alenghts[i] = 0
 * 
*/
      /*else*/ {
        (__pyx_v_aparams[__pyx_v_i]) = NULL;

        /* "psycopg_c/pq/pgconn.pyx":815
 *             else:
 *                 aparams[i] = NULL
 *                 alenghts[i] = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef libpq.Oid *atypes = NULL
*/
        (__pyx_v_alenghts[__pyx_v_i]) = 0;
      }
      __pyx_L11:;
    }

    /* "psycopg_c/pq/pgconn.pyx":802
 *     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":817
 *                 alenghts[i] = 0
 * 
 *     cdef libpq.Oid *atypes = NULL             # <<<<<<<<<<<<<<
 *     if param_types is not None:
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
*/
  __pyx_v_atypes = NULL;

  /* "psycopg_c/pq/pgconn.pyx":818
 * 
 *     cdef libpq.Oid *atypes = NULL
 *     if param_types is not None:             # <<<<<<<<<<<<<<
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):
*/
  __pyx_t_1 = (__pyx_v_param_types != Py_None);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":819
 *     cdef libpq.Oid *atypes = NULL
 *     if param_types is not None:
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))             # <<<<<<<<<<<<<<
 *         for i in range(nparams):
 *             atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)
*/
    __pyx_v_atypes = ((Oid *)PyMem_Malloc((__pyx_v_nparams * (sizeof(Oid)))));

    /* "psycopg_c/pq/pgconn.pyx":820
 *     if param_types is not None:
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):             # <<<<<<<<<<<<<<
 *             atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)
 * 
*/
    __pyx_t_5 = __pyx_v_nparams;
    __pyx_t_10 = __pyx_t_5;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "psycopg_c/pq/pgconn.pyx":821
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):
 *             atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, i)             # <<<<<<<<<<<<<<
 * 
 *     cdef int *aformats = NULL
*/
      if (unlikely(!__pyx_v_types_fast)) { __Pyx_RaiseUnboundLocalError("types_fast"); __PYX_ERR(1, 821, __pyx_L1_error) }
      __pyx_t_13 = PySequence_Fast_GET_ITEM(__pyx_v_types_fast, __pyx_v_i);
      __pyx_t_14 = __Pyx_PyLong_As_Oid(((PyObject *)__pyx_t_13)); if (unlikely((__pyx_t_14 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(1, 821, __pyx_L1_error)
      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_14;
    }

    /* "psycopg_c/pq/pgconn.pyx":818
 * 
 *     cdef libpq.Oid *atypes = NULL
 *     if param_types is not None:             # <<<<<<<<<<<<<<
 *         atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *         for i in range(nparams):
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":823
 *             atypes[i] = <object>PySequence_Fast_GET_ITEM(types_fast, 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":824
 * 
 *     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 != Py_None);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":825
 *     cdef int *aformats = NULL
 *     if param_formats is not None:
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))             # <<<<<<<<<<<<<<
 *         for i in range(nparams):
 *             aformats[i] = <object>PySequence_Fast_GET_ITEM(formats_fast, i)
*/
    __pyx_v_aformats = ((int *)PyMem_Malloc((__pyx_v_nparams * (sizeof(int *)))));

    /* "psycopg_c/pq/pgconn.pyx":826
 *     if param_formats is not None:
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
 *         for i in range(nparams):             # <<<<<<<<<<<<<<
 *             aformats[i] = <object>PySequence_Fast_GET_ITEM(formats_fast, i)
 * 
*/
    __pyx_t_5 = __pyx_v_nparams;
    __pyx_t_10 = __pyx_t_5;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "psycopg_c/pq/pgconn.pyx":827
 *         aformats = <int *>PyMem_Malloc(nparams * sizeof(int *))
 *         for i in range(nparams):
 *             aformats[i] = <object>PySequence_Fast_GET_ITEM(formats_fast, i)             # <<<<<<<<<<<<<<
 * 
 *     return (nparams, atypes, aparams, alenghts, aformats)
*/
      if (unlikely(!__pyx_v_formats_fast)) { __Pyx_RaiseUnboundLocalError("formats_fast"); __PYX_ERR(1, 827, __pyx_L1_error) }
      __pyx_t_13 = PySequence_Fast_GET_ITEM(__pyx_v_formats_fast, __pyx_v_i);
      __pyx_t_12 = __Pyx_PyLong_As_int(((PyObject *)__pyx_t_13)); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 827, __pyx_L1_error)
      (__pyx_v_aformats[__pyx_v_i]) = __pyx_t_12;
    }

    /* "psycopg_c/pq/pgconn.pyx":824
 * 
 *     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":829
 *             aformats[i] = <object>PySequence_Fast_GET_ITEM(formats_fast, i)
 * 
 *     return (nparams, atypes, aparams, alenghts, aformats)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_15.f0 = __pyx_v_nparams;
  __pyx_t_15.f1 = __pyx_v_atypes;
  __pyx_t_15.f2 = __pyx_v_aparams;
  __pyx_t_15.f3 = __pyx_v_alenghts;
  __pyx_t_15.f4 = __pyx_v_aformats;
  __pyx_r = __pyx_t_15;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":766
 * 
 * 
 * cdef (Py_ssize_t, libpq.Oid *, char * const*, int *, int *) _query_params_args(             # <<<<<<<<<<<<<<
 *     param_values: Sequence[bytes | None] | None,
 *     param_types: Sequence[int] | None,
*/

  /* 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_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_values_fast);
  __Pyx_XDECREF(__pyx_v_types_fast);
  __Pyx_XDECREF(__pyx_v_formats_fast);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":832
 * 
 * 
 * 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) {

  /* "psycopg_c/pq/pgconn.pyx":835
 *     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":836
 * ):
 *     PyMem_Free(ctypes)
 *     PyMem_Free(<char **>cvalues)             # <<<<<<<<<<<<<<
 *     PyMem_Free(clenghst)
 *     PyMem_Free(cformats)
*/
  PyMem_Free(((char **)__pyx_v_cvalues));

  /* "psycopg_c/pq/pgconn.pyx":837
 *     PyMem_Free(ctypes)
 *     PyMem_Free(<char **>cvalues)
 *     PyMem_Free(clenghst)             # <<<<<<<<<<<<<<
 *     PyMem_Free(cformats)
*/
  PyMem_Free(__pyx_v_clenghst);

  /* "psycopg_c/pq/pgconn.pyx":838
 *     PyMem_Free(<char **>cvalues)
 *     PyMem_Free(clenghst)
 *     PyMem_Free(cformats)             # <<<<<<<<<<<<<<
*/
  PyMem_Free(__pyx_v_cformats);

  /* "psycopg_c/pq/pgconn.pyx":832
 * 
 * 
 * cdef void _clear_query_params(             # <<<<<<<<<<<<<<
 *     libpq.Oid *ctypes, char *const *cvalues, int *clenghst, int *cformats
 * ):
*/

  /* function exit code */
}

/* "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 Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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;

  /* "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;
  return __pyx_r;
}

/* "psycopg_c/pq/pgresult.pyx":19
 *         self._pgresult_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGresult _from_ptr(libpq.PGresult *ptr):
 *         cdef PGresult rv = PGresult.__new__(PGresult)
*/

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_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult), __pyx_mstate_global->__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":19
 *         self._pgresult_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGresult _from_ptr(libpq.PGresult *ptr):
 *         cdef PGresult rv = PGresult.__new__(PGresult)
*/

  /* 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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  size_t __pyx_t_3;
  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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __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_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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[3];
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7[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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_qualname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4[0] = __pyx_t_1;
  __pyx_t_4[1] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_4[2] = __pyx_t_2;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cls = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 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_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_status); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_status = __pyx_t_3;
  __pyx_t_3 = 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_status, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_7[1] = __pyx_v_cls;
  __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__10;
  __pyx_t_7[3] = __pyx_t_1;
  __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_at_0x_2;
  __pyx_t_7[5] = __pyx_t_5;
  __pyx_t_7[6] = __pyx_mstate_global->__pyx_kp_u__4;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_7, 7, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_cls) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 7 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_cls) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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) -> int | None:
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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) -> int | None:
 *         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) -> int | None:
 *         if self._pgresult_ptr:
 *             return <long long><void *>self._pgresult_ptr             # <<<<<<<<<<<<<<
 *         else:
 *             return None
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyLong_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) -> int | None:
 *         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) -> int | None:
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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_PyLong_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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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 get_error_message(self, encoding: str = "utf-8") -> str:
*/
  __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 get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_9get_error_message(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_9get_error_message = {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_8PGresult_9get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_9get_error_message(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_encoding = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_error_message (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_encoding,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 53, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_error_message", 0) < (0)) __PYX_ERR(3, 53, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u_utf_8));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u_utf_8));
    }
    __pyx_v_encoding = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_error_message", 0, 0, 1, __pyx_nargs); __PYX_ERR(3, 53, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("psycopg_c.pq.PGresult.get_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 2))) __PYX_ERR(3, 53, __pyx_L1_error)
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_8get_error_message(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), __pyx_v_encoding);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_8get_error_message(struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_v_self, PyObject *__pyx_v_encoding) {
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_error_message", 0);

  /* "psycopg_c/pq/pgresult.pyx":54
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:
 *         return _clean_error_message(self.error_message, encoding)             # <<<<<<<<<<<<<<
 * 
 *     def error_field(self, int fieldcode) -> bytes | None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_clean_error_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_encoding};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(3, 54, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":53
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/

  /* 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.PGresult.get_error_message", __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":56
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def error_field(self, int fieldcode) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_11error_field(PyObject *__pyx_v_self, PyObject *__pyx_arg_fieldcode); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_11error_field = {"error_field", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_11error_field, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_11error_field(PyObject *__pyx_v_self, PyObject *__pyx_arg_fieldcode) {
  int __pyx_v_fieldcode;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_fieldcode); {
    __pyx_v_fieldcode = __Pyx_PyLong_As_int(__pyx_arg_fieldcode); if (unlikely((__pyx_v_fieldcode == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 56, __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_10error_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_10error_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":57
 * 
 *     def error_field(self, int fieldcode) -> bytes | None:
 *         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":58
 *     def error_field(self, int fieldcode) -> bytes | None:
 *         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":59
 *         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, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgresult.pyx":58
 *     def error_field(self, int fieldcode) -> bytes | None:
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  }

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

  /* "psycopg_c/pq/pgresult.pyx":56
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def error_field(self, int fieldcode) -> bytes | None:             # <<<<<<<<<<<<<<
 *         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":63
 *             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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":65
 *     @property
 *     def ntuples(self) -> int:
 *         return libpq.PQntuples(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(PQntuples(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 65, __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":63
 *             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":67
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":69
 *     @property
 *     def nfields(self) -> int:
 *         return libpq.PQnfields(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def fname(self, int column_number) -> bytes | None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(PQnfields(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 69, __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":67
 *         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":71
 *         return libpq.PQnfields(self._pgresult_ptr)
 * 
 *     def fname(self, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         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_13fname(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_13fname = {"fname", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_13fname, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_13fname(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fname (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 71, __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_12fname(((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_12fname(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":72
 * 
 *     def fname(self, int column_number) -> bytes | None:
 *         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":73
 *     def fname(self, int column_number) -> bytes | None:
 *         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":74
 *         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, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgresult.pyx":73
 *     def fname(self, int column_number) -> bytes | None:
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  }

  /* "psycopg_c/pq/pgresult.pyx":76
 *             return rv
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def ftable(self, int column_number) -> int:
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgresult.pyx":71
 *         return libpq.PQnfields(self._pgresult_ptr)
 * 
 *     def fname(self, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         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":78
 *             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_15ftable(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_15ftable = {"ftable", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_15ftable, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_15ftable(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ftable (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_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.ftable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_14ftable(((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_14ftable(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":79
 * 
 *     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_PyLong_From_Oid(PQftable(__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 (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __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 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":81
 *         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_17ftablecol(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_17ftablecol = {"ftablecol", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_17ftablecol, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_17ftablecol(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ftablecol (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_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.ftablecol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_16ftablecol(((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_16ftablecol(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":82
 * 
 *     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_PyLong_From_int(PQftablecol(__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 (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __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.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":84
 *         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_19fformat(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_19fformat = {"fformat", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_19fformat, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_19fformat(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fformat (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_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.fformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_18fformat(((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_18fformat(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":85
 * 
 *     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_PyLong_From_int(PQfformat(__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 (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __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.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":87
 *         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_21ftype(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_21ftype = {"ftype", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_21ftype, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_21ftype(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ftype (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_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.ftype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_20ftype(((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_20ftype(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":88
 * 
 *     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_PyLong_From_Oid(PQftype(__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 (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __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.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":90
 *         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_23fmod(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_23fmod = {"fmod", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_23fmod, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_23fmod(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fmod (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_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.fmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_22fmod(((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_22fmod(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":91
 * 
 *     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_PyLong_From_int(PQfmod(__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 (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __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.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":93
 *         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_25fsize(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_25fsize = {"fsize", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_25fsize, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_25fsize(PyObject *__pyx_v_self, PyObject *__pyx_arg_column_number) {
  int __pyx_v_column_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fsize (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_column_number); {
    __pyx_v_column_number = __Pyx_PyLong_As_int(__pyx_arg_column_number); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 93, __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_24fsize(((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_24fsize(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":94
 * 
 *     def fsize(self, int column_number) -> int:
 *         return libpq.PQfsize(self._pgresult_ptr, column_number)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(PQfsize(__pyx_v_self->_pgresult_ptr, __pyx_v_column_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(3, 94, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":93
 *         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":96
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":98
 *     @property
 *     def binary_tuples(self) -> int:
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_value(self, int row_number, int column_number) -> bytes | None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(PQbinaryTuples(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 98, __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":96
 *         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":100
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 * 
 *     def get_value(self, int row_number, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef int crow = row_number
 *         cdef int ccol = column_number
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_27get_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_27get_value = {"get_value", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_8PGresult_27get_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_27get_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 Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  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_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_row_number,&__pyx_mstate_global->__pyx_n_u_column_number,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(3, 100, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 100, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 100, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_value", 0) < (0)) __PYX_ERR(3, 100, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, i); __PYX_ERR(3, 100, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 100, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 100, __pyx_L3_error)
    }
    __pyx_v_row_number = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_row_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 100, __pyx_L3_error)
    __pyx_v_column_number = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_column_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 100, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, __pyx_nargs); __PYX_ERR(3, 100, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_26get_value(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), __pyx_v_row_number, __pyx_v_column_number);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_26get_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":101
 * 
 *     def get_value(self, int row_number, int column_number) -> bytes | None:
 *         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":102
 *     def get_value(self, int row_number, int column_number) -> bytes | None:
 *         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":103
 *         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":105
 *         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":106
 *         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":108
 *             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, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgresult.pyx":105
 *         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":110
 *             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":111
 *         else:
 *             if libpq.PQgetisnull(self._pgresult_ptr, crow, ccol):
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 return b""
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "psycopg_c/pq/pgresult.pyx":110
 *             return v[:length]
 *         else:
 *             if libpq.PQgetisnull(self._pgresult_ptr, crow, ccol):             # <<<<<<<<<<<<<<
 *                 return None
 *             else:
*/
    }

    /* "psycopg_c/pq/pgresult.pyx":113
 *                 return None
 *             else:
 *                 return b""             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__5);
      __pyx_r = __pyx_mstate_global->__pyx_kp_b__5;
      goto __pyx_L0;
    }
  }

  /* "psycopg_c/pq/pgresult.pyx":100
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 * 
 *     def get_value(self, int row_number, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         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":115
 *                 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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":117
 *     @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_PyLong_From_int(PQnparams(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 117, __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":115
 *                 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":119
 *         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_29param_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_param_number); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_29param_type = {"param_type", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_29param_type, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_29param_type(PyObject *__pyx_v_self, PyObject *__pyx_arg_param_number) {
  int __pyx_v_param_number;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_param_number); {
    __pyx_v_param_number = __Pyx_PyLong_As_int(__pyx_arg_param_number); if (unlikely((__pyx_v_param_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 119, __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_28param_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_28param_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":120
 * 
 *     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_PyLong_From_Oid(PQparamtype(__pyx_v_self->_pgresult_ptr, __pyx_v_param_number)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(3, 120, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgresult.pyx":119
 *         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":122
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_status(self) -> bytes | None:
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":124
 *     @property
 *     def command_status(self) -> bytes | None:
 *         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":125
 *     def command_status(self) -> bytes | None:
 *         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":126
 *         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, 126, __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":125
 *     def command_status(self) -> bytes | None:
 *         cdef char *rv = libpq.PQcmdStatus(self._pgresult_ptr)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  }

  /* "psycopg_c/pq/pgresult.pyx":128
 *             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":122
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_status(self) -> bytes | None:
 *         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":130
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_tuples(self) -> int | None:
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":132
 *     @property
 *     def command_tuples(self) -> int | None:
 *         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":133
 *     def command_tuples(self) -> int | None:
 *         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":134
 *         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":133
 *     def command_tuples(self) -> int | None:
 *         cdef char *rv = libpq.PQcmdTuples(self._pgresult_ptr)
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         cdef bytes brv = rv
*/
  }

  /* "psycopg_c/pq/pgresult.pyx":135
 *         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, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_brv = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgresult.pyx":136
 *             return None
 *         cdef bytes brv = rv
 *         return int(brv) if brv else None             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  {
    Py_ssize_t __pyx_temp = __Pyx_PyBytes_GET_SIZE(__pyx_v_brv);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(3, 136, __pyx_L1_error)
    __pyx_t_1 = (__pyx_temp != 0);
  }

  if (__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_brv); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 136, __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":130
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command_tuples(self) -> int | None:
 *         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":138
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":140
 *     @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_PyLong_From_Oid(PQoidValue(__pyx_v_self->_pgresult_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 140, __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":138
 *         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":142
 *         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_31set_attributes(PyObject *__pyx_v_self, PyObject *__pyx_v_descriptions); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_31set_attributes = {"set_attributes", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_31set_attributes, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_31set_attributes(PyObject *__pyx_v_self, PyObject *__pyx_v_descriptions) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_attributes (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_descriptions), (&PyList_Type), 0, "descriptions", 2))) __PYX_ERR(3, 142, __pyx_L1_error)
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_30set_attributes(((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_v_self), ((PyObject*)__pyx_v_descriptions));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_8PGresult_30set_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;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_attributes", 0);

  /* "psycopg_c/pq/pgresult.pyx":143
 * 
 *     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 = __Pyx_PyList_GET_SIZE(__pyx_v_descriptions); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 143, __pyx_L1_error)
  __pyx_v_num = __pyx_t_1;

  /* "psycopg_c/pq/pgresult.pyx":144
 *     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":147
 *             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":148
 * 
 *         for i in range(num):
 *             descr = descriptions[i]             # <<<<<<<<<<<<<<
 *             attrs[i].name = descr.name
 *             attrs[i].tableid = descr.tableid
*/
    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_descriptions, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 148, __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":149
 *         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_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 149, __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, 149, __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":150
 *             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_mstate_global->__pyx_n_u_tableid); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyLong_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]).tableid = __pyx_t_6;

    /* "psycopg_c/pq/pgresult.pyx":151
 *             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_mstate_global->__pyx_n_u_columnid); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyLong_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]).columnid = __pyx_t_7;

    /* "psycopg_c/pq/pgresult.pyx":152
 *             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_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyLong_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]).format = __pyx_t_7;

    /* "psycopg_c/pq/pgresult.pyx":153
 *             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_mstate_global->__pyx_n_u_typid); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyLong_As_Oid(__pyx_t_4); if (unlikely((__pyx_t_6 == ((Oid)-1)) && PyErr_Occurred())) __PYX_ERR(3, 153, __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":154
 *             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_mstate_global->__pyx_n_u_typlen); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 154, __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":155
 *             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_mstate_global->__pyx_n_u_atttypmod); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 155, __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":157
 *             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":158
 * 
 *         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":159
 *         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":160
 *         PyMem_Free(attrs)
 *         if (res == 0):
 *             raise e.OperationalError("PQsetResultAttrs failed")             # <<<<<<<<<<<<<<
*/
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_12 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
      assert(__pyx_t_9);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
      __pyx_t_12 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_PQsetResultAttrs_failed};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 160, __pyx_L1_error)

    /* "psycopg_c/pq/pgresult.pyx":159
 *         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":142
 *         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_XDECREF(__pyx_t_11);
  __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_33__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_33__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_33__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_33__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_32__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_32__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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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_35__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_8PGresult_35__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_35__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_8PGresult_35__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_8PGresult_34__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_34__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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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 PGcancelConn:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.pgcancelconn_ptr = NULL
 * 
*/

/* Python wrapper */
static int __pyx_pw_9psycopg_c_2pq_12PGcancelConn_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9psycopg_c_2pq_12PGcancelConn_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_9psycopg_c_2pq_12PGcancelConn___cinit__(((struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *)__pyx_v_self));

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

static int __pyx_pf_9psycopg_c_2pq_12PGcancelConn___cinit__(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self) {
  int __pyx_r;

  /* "psycopg_c/pq/pgcancel.pyx":10
 * cdef class PGcancelConn:
 *     def __cinit__(self):
 *         self.pgcancelconn_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->pgcancelconn_ptr = NULL;

  /* "psycopg_c/pq/pgcancel.pyx":9
 * 
 * cdef class PGcancelConn:
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.pgcancelconn_ptr = NULL
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "psycopg_c/pq/pgcancel.pyx":12
 *         self.pgcancelconn_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGcancelConn _from_ptr(libpq.PGcancelConn *ptr):
 *         cdef PGcancelConn rv = PGcancelConn.__new__(PGcancelConn)
*/

static struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_f_9psycopg_c_2pq_12PGcancelConn__from_ptr(PGcancelConn *__pyx_v_ptr) {
  struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_rv = 0;
  struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__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 PGcancelConn _from_ptr(libpq.PGcancelConn *ptr):
 *         cdef PGcancelConn rv = PGcancelConn.__new__(PGcancelConn)             # <<<<<<<<<<<<<<
 *         rv.pgcancelconn_ptr = ptr
 *         return rv
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9psycopg_c_2pq_PGcancelConn(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancelConn), __pyx_mstate_global->__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_PGcancelConn *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":15
 *     cdef PGcancelConn _from_ptr(libpq.PGcancelConn *ptr):
 *         cdef PGcancelConn rv = PGcancelConn.__new__(PGcancelConn)
 *         rv.pgcancelconn_ptr = ptr             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  __pyx_v_rv->pgcancelconn_ptr = __pyx_v_ptr;

  /* "psycopg_c/pq/pgcancel.pyx":16
 *         cdef PGcancelConn rv = PGcancelConn.__new__(PGcancelConn)
 *         rv.pgcancelconn_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":12
 *         self.pgcancelconn_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGcancelConn _from_ptr(libpq.PGcancelConn *ptr):
 *         cdef PGcancelConn rv = PGcancelConn.__new__(PGcancelConn)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGcancelConn._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.finish()
 * 
*/

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

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

static void __pyx_pf_9psycopg_c_2pq_12PGcancelConn_2__dealloc__(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  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.finish()             # <<<<<<<<<<<<<<
 * 
 *     def start(self) -> None:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_finish, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":18
 *         return rv
 * 
 *     def __dealloc__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.finish()
 * 
*/

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

/* "psycopg_c/pq/pgcancel.pyx":21
 *         self.finish()
 * 
 *     def start(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a non-blocking manner.
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_5start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_9psycopg_c_2pq_12PGcancelConn_4start, "Requests that the server abandons processing of the current command\n        in a non-blocking manner.\n\n        See :pq:`PQcancelStart` for details.\n        ");
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_12PGcancelConn_5start = {"start", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_5start, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_12PGcancelConn_4start};
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_5start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_12PGcancelConn_4start(((struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *)__pyx_v_self));

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

static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_4start(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

  /* "psycopg_c/pq/pgcancel.pyx":27
 *         See :pq:`PQcancelStart` for details.
 *         """
 *         if not libpq.PQcancelStart(self.pgcancelconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"
*/
  __pyx_t_1 = (!(PQcancelStart(__pyx_v_self->pgcancelconn_ptr) != 0));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgcancel.pyx":28
 *         """
 *         if not libpq.PQcancelStart(self.pgcancelconn_ptr):
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"couldn't send cancellation: {self.get_error_message()}"
 *             )
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 28, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgcancel.pyx":29
 *         if not libpq.PQcancelStart(self.pgcancelconn_ptr):
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_couldn_t_send_cancellation, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 28, __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(4, 28, __pyx_L1_error)

    /* "psycopg_c/pq/pgcancel.pyx":27
 *         See :pq:`PQcancelStart` for details.
 *         """
 *         if not libpq.PQcancelStart(self.pgcancelconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgcancel.pyx":21
 *         self.finish()
 * 
 *     def start(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a non-blocking manner.
*/

  /* 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.PGcancelConn.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgcancel.pyx":32
 *             )
 * 
 *     def blocking(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a blocking manner.
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_7blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
PyDoc_STRVAR(__pyx_doc_9psycopg_c_2pq_12PGcancelConn_6blocking, "Requests that the server abandons processing of the current command\n        in a blocking manner.\n\n        See :pq:`PQcancelBlocking` for details.\n        ");
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_12PGcancelConn_7blocking = {"blocking", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_7blocking, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_12PGcancelConn_6blocking};
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_7blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("blocking (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_12PGcancelConn_6blocking(((struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *)__pyx_v_self));

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

static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_6blocking(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("blocking", 0);

  /* "psycopg_c/pq/pgcancel.pyx":38
 *         See :pq:`PQcancelBlocking` for details.
 *         """
 *         if not libpq.PQcancelBlocking(self.pgcancelconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"
*/
  __pyx_t_1 = (!(PQcancelBlocking(__pyx_v_self->pgcancelconn_ptr) != 0));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgcancel.pyx":39
 *         """
 *         if not libpq.PQcancelBlocking(self.pgcancelconn_ptr):
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"couldn't send cancellation: {self.get_error_message()}"
 *             )
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgcancel.pyx":40
 *         if not libpq.PQcancelBlocking(self.pgcancelconn_ptr):
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 40, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_couldn_t_send_cancellation, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 39, __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(4, 39, __pyx_L1_error)

    /* "psycopg_c/pq/pgcancel.pyx":38
 *         See :pq:`PQcancelBlocking` for details.
 *         """
 *         if not libpq.PQcancelBlocking(self.pgcancelconn_ptr):             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"couldn't send cancellation: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgcancel.pyx":32
 *             )
 * 
 *     def blocking(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a blocking manner.
*/

  /* 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.PGcancelConn.blocking", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgcancel.pyx":43
 *             )
 * 
 *     def poll(self) -> int:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_9poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_12PGcancelConn_9poll = {"poll", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_9poll, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_9poll(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("poll (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_12PGcancelConn_8poll(((struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *)__pyx_v_self));

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

static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_8poll(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("poll", 0);

  /* "psycopg_c/pq/pgcancel.pyx":44
 * 
 *     def poll(self) -> int:
 *         self._ensure_pgcancelconn()             # <<<<<<<<<<<<<<
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_ensure_pgcancelconn, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":45
 *     def poll(self) -> int:
 *         self._ensure_pgcancelconn()
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_PostgresPollingStatusType(PQcancelPoll(__pyx_v_self->pgcancelconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(4, 45, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgcancel.pyx":43
 *             )
 * 
 *     def poll(self) -> int:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
*/

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

/* "psycopg_c/pq/pgcancel.pyx":47
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         return libpq.PQcancelStatus(self.pgcancelconn_ptr)
*/

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

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

static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_6status___get__(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__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/pgcancel.pyx":49
 *     @property
 *     def status(self) -> int:
 *         return libpq.PQcancelStatus(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_ConnStatusType(PQcancelStatus(__pyx_v_self->pgcancelconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgcancel.pyx":47
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         return libpq.PQcancelStatus(self.pgcancelconn_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGcancelConn.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/pgcancel.pyx":51
 *         return libpq.PQcancelStatus(self.pgcancelconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def socket(self) -> int:
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)
*/

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

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

static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_6socket___get__(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgcancel.pyx":53
 *     @property
 *     def socket(self) -> int:
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv == -1:
 *             raise e.OperationalError("cancel connection not opened")
*/
  __pyx_v_rv = PQcancelSocket(__pyx_v_self->pgcancelconn_ptr);

  /* "psycopg_c/pq/pgcancel.pyx":54
 *     def socket(self) -> int:
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)
 *         if rv == -1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("cancel connection not opened")
 *         return rv
*/
  __pyx_t_1 = (__pyx_v_rv == -1L);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgcancel.pyx":55
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)
 *         if rv == -1:
 *             raise e.OperationalError("cancel connection not opened")             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_cancel_connection_not_opened};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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, 55, __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(4, 55, __pyx_L1_error)

    /* "psycopg_c/pq/pgcancel.pyx":54
 *     def socket(self) -> int:
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)
 *         if rv == -1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("cancel connection not opened")
 *         return rv
*/
  }

  /* "psycopg_c/pq/pgcancel.pyx":56
 *         if rv == -1:
 *             raise e.OperationalError("cancel connection not opened")
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgcancel.pyx":51
 *         return libpq.PQcancelStatus(self.pgcancelconn_ptr)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def socket(self) -> int:
 *         rv = libpq.PQcancelSocket(self.pgcancelconn_ptr)
*/

  /* 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.PGcancelConn.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/pgcancel.pyx":58
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)
*/

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

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

static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_13error_message___get__(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__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/pgcancel.pyx":60
 *     @property
 *     def error_message(self) -> bytes:
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(PQcancelErrorMessage(__pyx_v_self->pgcancelconn_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgcancel.pyx":58
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("psycopg_c.pq.PGcancelConn.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/pgcancel.pyx":62
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_11get_error_message(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_12PGcancelConn_11get_error_message = {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_11get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_11get_error_message(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_encoding = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_error_message (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_encoding,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(4, 62, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 62, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_error_message", 0) < (0)) __PYX_ERR(4, 62, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u_utf_8));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 62, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_kp_u_utf_8));
    }
    __pyx_v_encoding = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_error_message", 0, 0, 1, __pyx_nargs); __PYX_ERR(4, 62, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("psycopg_c.pq.PGcancelConn.get_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyUnicode_Type), 0, "encoding", 2))) __PYX_ERR(4, 62, __pyx_L1_error)
  __pyx_r = __pyx_pf_9psycopg_c_2pq_12PGcancelConn_10get_error_message(((struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *)__pyx_v_self), __pyx_v_encoding);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_10get_error_message(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self, PyObject *__pyx_v_encoding) {
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_error_message", 0);

  /* "psycopg_c/pq/pgcancel.pyx":63
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:
 *         return _clean_error_message(self.error_message, encoding)             # <<<<<<<<<<<<<<
 * 
 *     def reset(self) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_clean_error_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_encoding};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(4, 63, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgcancel.pyx":62
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/

  /* 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.PGcancelConn.get_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgcancel.pyx":65
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
*/

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

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

static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_12reset(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);

  /* "psycopg_c/pq/pgcancel.pyx":66
 * 
 *     def reset(self) -> None:
 *         self._ensure_pgcancelconn()             # <<<<<<<<<<<<<<
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_ensure_pgcancelconn, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":67
 *     def reset(self) -> None:
 *         self._ensure_pgcancelconn()
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 * 
 *     def finish(self) -> None:
*/
  PQcancelReset(__pyx_v_self->pgcancelconn_ptr);

  /* "psycopg_c/pq/pgcancel.pyx":65
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
*/

  /* 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_2);
  __Pyx_AddTraceback("psycopg_c.pq.PGcancelConn.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgcancel.pyx":69
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is not NULL:
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)
*/

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

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

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

  /* "psycopg_c/pq/pgcancel.pyx":70
 * 
 *     def finish(self) -> None:
 *         if self.pgcancelconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)
 *             self.pgcancelconn_ptr = NULL
*/
  __pyx_t_1 = (__pyx_v_self->pgcancelconn_ptr != NULL);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgcancel.pyx":71
 *     def finish(self) -> None:
 *         if self.pgcancelconn_ptr is not NULL:
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)             # <<<<<<<<<<<<<<
 *             self.pgcancelconn_ptr = NULL
 * 
*/
    PQcancelFinish(__pyx_v_self->pgcancelconn_ptr);

    /* "psycopg_c/pq/pgcancel.pyx":72
 *         if self.pgcancelconn_ptr is not NULL:
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)
 *             self.pgcancelconn_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     def _ensure_pgcancelconn(self) -> None:
*/
    __pyx_v_self->pgcancelconn_ptr = NULL;

    /* "psycopg_c/pq/pgcancel.pyx":70
 * 
 *     def finish(self) -> None:
 *         if self.pgcancelconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)
 *             self.pgcancelconn_ptr = NULL
*/
  }

  /* "psycopg_c/pq/pgcancel.pyx":69
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is not NULL:
 *             libpq.PQcancelFinish(self.pgcancelconn_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":74
 *             self.pgcancelconn_ptr = NULL
 * 
 *     def _ensure_pgcancelconn(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is NULL:
 *             raise e.OperationalError("the cancel connection is closed")
*/

/* Python wrapper */
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_17_ensure_pgcancelconn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_12PGcancelConn_17_ensure_pgcancelconn = {"_ensure_pgcancelconn", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_17_ensure_pgcancelconn, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_17_ensure_pgcancelconn(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ensure_pgcancelconn (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_12PGcancelConn_16_ensure_pgcancelconn(((struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *)__pyx_v_self));

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

static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_16_ensure_pgcancelconn(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ensure_pgcancelconn", 0);

  /* "psycopg_c/pq/pgcancel.pyx":75
 * 
 *     def _ensure_pgcancelconn(self) -> None:
 *         if self.pgcancelconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the cancel connection is closed")
 * 
*/
  __pyx_t_1 = (__pyx_v_self->pgcancelconn_ptr == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgcancel.pyx":76
 *     def _ensure_pgcancelconn(self) -> None:
 *         if self.pgcancelconn_ptr is NULL:
 *             raise e.OperationalError("the cancel connection is closed")             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 76, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_the_cancel_connection_is_closed};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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, 76, __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(4, 76, __pyx_L1_error)

    /* "psycopg_c/pq/pgcancel.pyx":75
 * 
 *     def _ensure_pgcancelconn(self) -> None:
 *         if self.pgcancelconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the cancel connection is closed")
 * 
*/
  }

  /* "psycopg_c/pq/pgcancel.pyx":74
 *             self.pgcancelconn_ptr = NULL
 * 
 *     def _ensure_pgcancelconn(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is NULL:
 *             raise e.OperationalError("the cancel connection is closed")
*/

  /* 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.PGcancelConn._ensure_pgcancelconn", __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_12PGcancelConn_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_12PGcancelConn_19__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_19__reduce_cython__, METH_NOARGS, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_12PGcancelConn_18__reduce_cython__(((struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *)__pyx_v_self));

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

static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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.PGcancelConn.__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_12PGcancelConn_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyMethodDef __pyx_mdef_9psycopg_c_2pq_12PGcancelConn_21__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_21__setstate_cython__, METH_O, 0};
static PyObject *__pyx_pw_9psycopg_c_2pq_12PGcancelConn_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9psycopg_c_2pq_12PGcancelConn_20__setstate_cython__(((struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_9psycopg_c_2pq_12PGcancelConn_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *__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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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.PGcancelConn.__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":80
 * 
 * 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 Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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;

  /* "psycopg_c/pq/pgcancel.pyx":81
 * cdef class PGcancel:
 *     def __cinit__(self):
 *         self.pgcancel_ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->pgcancel_ptr = NULL;

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

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "psycopg_c/pq/pgcancel.pyx":83
 *         self.pgcancel_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGcancel _from_ptr(libpq.PGcancel *ptr):
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)
*/

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":85
 *     @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_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancel), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 85, __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":86
 *     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":87
 *         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":83
 *         self.pgcancel_ptr = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PGcancel _from_ptr(libpq.PGcancel *ptr):
 *         cdef PGcancel rv = PGcancel.__new__(PGcancel)
*/

  /* 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":89
 *         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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "psycopg_c/pq/pgcancel.pyx":90
 * 
 *     def __dealloc__(self) -> None:
 *         self.free()             # <<<<<<<<<<<<<<
 * 
 *     def free(self) -> None:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_free, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":89
 *         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_WriteUnraisable("psycopg_c.pq.PGcancel.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "psycopg_c/pq/pgcancel.pyx":92
 *         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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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":93
 * 
 *     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":94
 *     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":95
 *         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":93
 * 
 *     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":92
 *         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":97
 *             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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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[256];
  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;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cancel", 0);

  /* "psycopg_c/pq/pgcancel.pyx":99
 *     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":100
 *         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":101
 *         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_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgcancel.pyx":102
 *         if not res:
 *             raise e.OperationalError(
 *                 f"cancel failed: {buf.decode('utf8', 'ignore')}"             # <<<<<<<<<<<<<<
 *             )
*/
    __pyx_t_6 = __Pyx_ssize_strlen(__pyx_v_buf); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(4, 102, __pyx_L1_error)
    __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_buf, 0, __pyx_t_6, NULL, __pyx_k_ignore, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_cancel_failed, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 101, __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(4, 101, __pyx_L1_error)

    /* "psycopg_c/pq/pgcancel.pyx":100
 *         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":97
 *             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_XDECREF(__pyx_t_7);
  __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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_defaults (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_connection_def};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      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_t_2 = __pyx_v_rv;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(5, 18, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  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_XDECREF(__pyx_t_3);
  __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(*)(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 Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  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_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cls,&__pyx_mstate_global->__pyx_n_u_conninfo,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(5, 20, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 20, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 20, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "parse", 0) < (0)) __PYX_ERR(5, 20, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, i); __PYX_ERR(5, 20, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(5, 20, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(5, 20, __pyx_L3_error)
    }
    __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_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, __pyx_nargs); __PYX_ERR(5, 20, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  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_3 = NULL;
      __pyx_t_4 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_on_conninfo_pa};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        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_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_ssize_strlen(__pyx_v_errmsg); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(5, 28, __pyx_L1_error)
      __pyx_t_5 = __Pyx_decode_c_string(__pyx_v_errmsg, 0, __pyx_t_7, NULL, __pyx_k_replace, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 28, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __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_t_2 = __pyx_v_rv;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(5, 34, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[5];
  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 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_keyword); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_4[1] = __pyx_t_2;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__11;
  __pyx_t_4[3] = __pyx_t_3;
  __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__12;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 2 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  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 True:
*/
  __pyx_v_i = 0;

  /* "psycopg_c/pq/conninfo.pyx":44
 *     cdef int i = 0
 *     cdef libpq.PQconninfoOption* opt
 *     while True:             # <<<<<<<<<<<<<<
 *         opt = opts + i
 *         if opt.keyword is NULL:
*/
  while (1) {

    /* "psycopg_c/pq/conninfo.pyx":45
 *     cdef libpq.PQconninfoOption* opt
 *     while True:
 *         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 True:
 *         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 True:
 *         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_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ConninfoOption); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "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_5 = __Pyx_PyBytes_FromString(__pyx_v_opt->keyword); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "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,
*/
    __pyx_t_2 = (__pyx_v_opt->envvar != NULL);
    if (__pyx_t_2) {
      __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_opt->envvar); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 51, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __pyx_t_7;
      __pyx_t_7 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_6 = Py_None;
    }

    /* "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,
*/
    __pyx_t_2 = (__pyx_v_opt->compiled != NULL);
    if (__pyx_t_2) {
      __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_opt->compiled); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __pyx_t_8;
      __pyx_t_8 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_7 = Py_None;
    }

    /* "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,
*/
    __pyx_t_2 = (__pyx_v_opt->val != NULL);
    if (__pyx_t_2) {
      __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_opt->val); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_8 = Py_None;
    }

    /* "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,
*/
    __pyx_t_2 = (__pyx_v_opt->label != NULL);
    if (__pyx_t_2) {
      __pyx_t_10 = __Pyx_PyBytes_FromString(__pyx_v_opt->label); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __pyx_t_10;
      __pyx_t_10 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_9 = Py_None;
    }

    /* "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,
 *             )
*/
    __pyx_t_2 = (__pyx_v_opt->dispchar != NULL);
    if (__pyx_t_2) {
      __pyx_t_11 = __Pyx_PyBytes_FromString(__pyx_v_opt->dispchar); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 55, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = __pyx_t_11;
      __pyx_t_11 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_10 = Py_None;
    }

    /* "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_11 = __Pyx_PyLong_From_int(__pyx_v_opt->dispsize); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_12 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 7 : 0)] = {__pyx_t_3, NULL};
      __pyx_t_13 = __Pyx_MakeVectorcallBuilderKwds(7); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_keyword, __pyx_t_5, __pyx_t_13, __pyx_callargs+1, 0) < (0)) __PYX_ERR(5, 49, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_envvar, __pyx_t_6, __pyx_t_13, __pyx_callargs+1, 1) < (0)) __PYX_ERR(5, 49, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_compiled, __pyx_t_7, __pyx_t_13, __pyx_callargs+1, 2) < (0)) __PYX_ERR(5, 49, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_val, __pyx_t_8, __pyx_t_13, __pyx_callargs+1, 3) < (0)) __PYX_ERR(5, 49, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_label, __pyx_t_9, __pyx_t_13, __pyx_callargs+1, 4) < (0)) __PYX_ERR(5, 49, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dispchar, __pyx_t_10, __pyx_t_13, __pyx_callargs+1, 5) < (0)) __PYX_ERR(5, 49, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_dispsize, __pyx_t_11, __pyx_t_13, __pyx_callargs+1, 6) < (0)) __PYX_ERR(5, 49, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_13);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }

    /* "psycopg_c/pq/conninfo.pyx":48
 *         if opt.keyword is NULL:
 *             break
 *         rv.append(             # <<<<<<<<<<<<<<
 *             ConninfoOption(
 *                 keyword=opt.keyword,
*/
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_1); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(5, 48, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __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":12
 * 
 * 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 Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  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_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_conn,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(6, 12, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 12, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(6, 12, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9psycopg_c_2pq_PGconn *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 12, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9psycopg_c_2pq_PGconn *)Py_None));
    }
    __pyx_v_conn = ((struct __pyx_obj_9psycopg_c_2pq_PGconn *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(6, 12, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, 1, "conn", 0))) __PYX_ERR(6, 12, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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":13
 * 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":12
 * 
 * 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":15
 *         self.conn = conn
 * 
 *     cpdef escape_literal(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
*/

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_v_rv = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = 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 (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  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)))
  #endif
  ) {
    #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_mstate_global->__pyx_n_u_escape_literal); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9psycopg_c_2pq_8Escaping_3escape_literal)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __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(6, 15, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __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":20
 *         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":21
 * 
 *         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_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_escape_literal_failed_no_connect};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 21, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 21, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":20
 *         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":22
 *         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":23
 *             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_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 23, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 23, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 23, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":22
 *         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":25
 *             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_7 = __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 25, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":27
 *         _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":28
 * 
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_literal failed: {self.conn.get_error_message()}"
*/
  __pyx_t_6 = (__pyx_v_out == NULL);
  if (unlikely(__pyx_t_6)) {

    /* "psycopg_c/pq/escaping.pyx":29
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"escape_literal failed: {self.conn.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_c/pq/escaping.pyx":30
 *         if out is NULL:
 *             raise e.OperationalError(
 *                 f"escape_literal failed: {self.conn.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self->conn);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_escape_literal_failed, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 30, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 29, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":28
 * 
 *         out = libpq.PQescapeLiteral(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_literal failed: {self.conn.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/escaping.pyx":33
 *             )
 * 
 *         rv = out[:strlen(out)]             # <<<<<<<<<<<<<<
 *         libpq.PQfreemem(out)
 *         return rv
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_out + 0, strlen(__pyx_v_out) - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/escaping.pyx":34
 * 
 *         rv = out[:strlen(out)]
 *         libpq.PQfreemem(out)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PQfreemem(__pyx_v_out);

  /* "psycopg_c/pq/escaping.pyx":35
 *         rv = out[:strlen(out)]
 *         libpq.PQfreemem(out)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     cpdef escape_identifier(self, data):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/escaping.pyx":15
 *         self.conn = conn
 * 
 *     cpdef escape_literal(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_8);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.escape_literal", __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_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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_literal (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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, 15, __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":37
 *         return rv
 * 
 *     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_v_rv = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = 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 (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  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)))
  #endif
  ) {
    #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_mstate_global->__pyx_n_u_escape_identifier); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9psycopg_c_2pq_8Escaping_5escape_identifier)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __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(6, 37, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __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":42
 *         cdef Py_ssize_t length
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)             # <<<<<<<<<<<<<<
 * 
 *         if self.conn is None:
*/
  __pyx_t_6 = __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 42, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":44
 *         _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_7 = (((PyObject *)__pyx_v_self->conn) == Py_None);
  if (unlikely(__pyx_t_7)) {

    /* "psycopg_c/pq/escaping.pyx":45
 * 
 *         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_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_escape_identifier_failed_no_conn};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 45, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":44
 *         _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":46
 *         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_7 = (__pyx_v_self->conn->_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_7)) {

    /* "psycopg_c/pq/escaping.pyx":47
 *             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_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 47, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":46
 *         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":49
 *             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":50
 * 
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_identifier failed: {self.conn.get_error_message()}"
*/
  __pyx_t_7 = (__pyx_v_out == NULL);
  if (unlikely(__pyx_t_7)) {

    /* "psycopg_c/pq/escaping.pyx":51
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"escape_identifier failed: {self.conn.get_error_message()}"
 *             )
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "psycopg_c/pq/escaping.pyx":52
 *         if out is NULL:
 *             raise e.OperationalError(
 *                 f"escape_identifier failed: {self.conn.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self->conn);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_escape_identifier_failed, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 51, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 51, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":50
 * 
 *         out = libpq.PQescapeIdentifier(self.conn._pgconn_ptr, ptr, length)
 *         if out is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"escape_identifier failed: {self.conn.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/escaping.pyx":55
 *             )
 * 
 *         rv = out[:strlen(out)]             # <<<<<<<<<<<<<<
 *         libpq.PQfreemem(out)
 *         return rv
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_out + 0, strlen(__pyx_v_out) - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/escaping.pyx":56
 * 
 *         rv = out[:strlen(out)]
 *         libpq.PQfreemem(out)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PQfreemem(__pyx_v_out);

  /* "psycopg_c/pq/escaping.pyx":57
 *         rv = out[:strlen(out)]
 *         libpq.PQfreemem(out)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     cpdef escape_string(self, data):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/escaping.pyx":37
 *         return rv
 * 
 *     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_8);
  __Pyx_AddTraceback("psycopg_c.pq.Escaping.escape_identifier", __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_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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_identifier (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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, 37, __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":59
 *         return rv
 * 
 *     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;
  char *__pyx_v_buf_out;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_rv = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = 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 (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  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)))
  #endif
  ) {
    #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_mstate_global->__pyx_n_u_escape_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 59, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9psycopg_c_2pq_8Escaping_7escape_string)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __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(6, 59, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __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":66
 *         cdef Py_ssize_t length
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)             # <<<<<<<<<<<<<<
 * 
 *         if self.conn is not None:
*/
  __pyx_t_6 = __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 66, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":68
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         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":69
 * 
 *         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":70
 *         if self.conn is not None:
 *             if self.conn._pgconn_ptr is NULL:
 *                 raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *             buf_out = <char *>PyMem_Malloc(length * 2 + 1)
*/
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 70, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 70, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 70, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(6, 70, __pyx_L1_error)

      /* "psycopg_c/pq/escaping.pyx":69
 * 
 *         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":72
 *                 raise e.OperationalError("the connection is closed")
 * 
 *             buf_out = <char *>PyMem_Malloc(length * 2 + 1)             # <<<<<<<<<<<<<<
 *             len_out = libpq.PQescapeStringConn(
 *                 self.conn._pgconn_ptr, buf_out, ptr, length, &error
*/
    __pyx_v_buf_out = ((char *)PyMem_Malloc(((__pyx_v_length * 2) + 1)));

    /* "psycopg_c/pq/escaping.pyx":73
 * 
 *             buf_out = <char *>PyMem_Malloc(length * 2 + 1)
 *             len_out = libpq.PQescapeStringConn(             # <<<<<<<<<<<<<<
 *                 self.conn._pgconn_ptr, buf_out, ptr, length, &error
 *             )
*/
    __pyx_v_len_out = PQescapeStringConn(__pyx_v_self->conn->_pgconn_ptr, __pyx_v_buf_out, __pyx_v_ptr, __pyx_v_length, (&__pyx_v_error));

    /* "psycopg_c/pq/escaping.pyx":76
 *                 self.conn._pgconn_ptr, buf_out, ptr, length, &error
 *             )
 *             if error:             # <<<<<<<<<<<<<<
 *                 PyMem_Free(buf_out)
 *                 raise e.OperationalError(
*/
    __pyx_t_7 = (__pyx_v_error != 0);
    if (unlikely(__pyx_t_7)) {

      /* "psycopg_c/pq/escaping.pyx":77
 *             )
 *             if error:
 *                 PyMem_Free(buf_out)             # <<<<<<<<<<<<<<
 *                 raise e.OperationalError(
 *                     f"escape_string failed: {self.conn.get_error_message()}"
*/
      PyMem_Free(__pyx_v_buf_out);

      /* "psycopg_c/pq/escaping.pyx":78
 *             if error:
 *                 PyMem_Free(buf_out)
 *                 raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                     f"escape_string failed: {self.conn.get_error_message()}"
 *                 )
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 78, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 78, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "psycopg_c/pq/escaping.pyx":79
 *                 PyMem_Free(buf_out)
 *                 raise e.OperationalError(
 *                     f"escape_string failed: {self.conn.get_error_message()}"             # <<<<<<<<<<<<<<
 *                 )
 * 
*/
      __pyx_t_8 = ((PyObject *)__pyx_v_self->conn);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 79, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_escape_string_failed, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 78, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(6, 78, __pyx_L1_error)

      /* "psycopg_c/pq/escaping.pyx":76
 *                 self.conn._pgconn_ptr, buf_out, ptr, length, &error
 *             )
 *             if error:             # <<<<<<<<<<<<<<
 *                 PyMem_Free(buf_out)
 *                 raise e.OperationalError(
*/
    }

    /* "psycopg_c/pq/escaping.pyx":68
 *         _buffer_as_string_and_size(data, &ptr, &length)
 * 
 *         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":83
 * 
 *         else:
 *             buf_out = <char *>PyMem_Malloc(length * 2 + 1)             # <<<<<<<<<<<<<<
 *             len_out = libpq.PQescapeString(buf_out, ptr, length)
 * 
*/
  /*else*/ {
    __pyx_v_buf_out = ((char *)PyMem_Malloc(((__pyx_v_length * 2) + 1)));

    /* "psycopg_c/pq/escaping.pyx":84
 *         else:
 *             buf_out = <char *>PyMem_Malloc(length * 2 + 1)
 *             len_out = libpq.PQescapeString(buf_out, ptr, length)             # <<<<<<<<<<<<<<
 * 
 *         rv = buf_out[:len_out]
*/
    __pyx_v_len_out = PQescapeString(__pyx_v_buf_out, __pyx_v_ptr, __pyx_v_length);
  }
  __pyx_L3:;

  /* "psycopg_c/pq/escaping.pyx":86
 *             len_out = libpq.PQescapeString(buf_out, ptr, length)
 * 
 *         rv = buf_out[:len_out]             # <<<<<<<<<<<<<<
 *         PyMem_Free(buf_out)
 *         return rv
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_buf_out + 0, __pyx_v_len_out - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/escaping.pyx":87
 * 
 *         rv = buf_out[:len_out]
 *         PyMem_Free(buf_out)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PyMem_Free(__pyx_v_buf_out);

  /* "psycopg_c/pq/escaping.pyx":88
 *         rv = buf_out[:len_out]
 *         PyMem_Free(buf_out)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     cpdef escape_bytea(self, data):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/escaping.pyx":59
 *         return rv
 * 
 *     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_8);
  __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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_string (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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, 59, __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":90
 *         return 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_v_rv = 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10[3];
  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 (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  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)))
  #endif
  ) {
    #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_mstate_global->__pyx_n_u_escape_bytea); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9psycopg_c_2pq_8Escaping_9escape_bytea)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_data};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __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(6, 90, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __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":96
 *         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":97
 * 
 *         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_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 97, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 97, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":96
 *         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":99
 *             raise e.OperationalError("the connection is closed")
 * 
 *         _buffer_as_string_and_size(data, &ptr, &length)             # <<<<<<<<<<<<<<
 * 
 *         if self.conn is not None:
*/
  __pyx_t_8 = __pyx_f_9psycopg_c_2pq__buffer_as_string_and_size(__pyx_v_data, (&__pyx_v_ptr), (&__pyx_v_length)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 99, __pyx_L1_error)

  /* "psycopg_c/pq/escaping.pyx":101
 *         _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":102
 * 
 *         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":101
 *         _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":105
 *                 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":107
 *             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":108
 * 
 *         if out is NULL:
 *             raise MemoryError(             # <<<<<<<<<<<<<<
 *                 f"couldn't allocate for escape_bytea of {len(data)} bytes"
 *             )
*/
    __pyx_t_3 = NULL;

    /* "psycopg_c/pq/escaping.pyx":109
 *         if out is NULL:
 *             raise MemoryError(
 *                 f"couldn't allocate for escape_bytea of {len(data)} bytes"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_9 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(6, 109, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_9, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_for_escape_byt;
    __pyx_t_10[1] = __pyx_t_2;
    __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_bytes;
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, 38 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 6, 127);
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 108, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":107
 *             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":112
 *             )
 * 
 *         rv = out[:len_out - 1]  # out includes final 0             # <<<<<<<<<<<<<<
 *         libpq.PQfreemem(out)
 *         return rv
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_out) + 0, (__pyx_v_len_out - 1) - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/escaping.pyx":113
 * 
 *         rv = out[:len_out - 1]  # out includes final 0
 *         libpq.PQfreemem(out)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
  PQfreemem(__pyx_v_out);

  /* "psycopg_c/pq/escaping.pyx":114
 *         rv = out[:len_out - 1]  # out includes final 0
 *         libpq.PQfreemem(out)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     cpdef unescape_bytea(self, const unsigned char *data):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/escaping.pyx":90
 *         return 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_XDECREF(__pyx_v_rv);
  __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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_bytea (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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, 90, __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":116
 *         return rv
 * 
 *     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_v_rv = 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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9[3];
  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 (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  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)))
  #endif
  ) {
    #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_mstate_global->__pyx_n_u_unescape_bytea); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9psycopg_c_2pq_8Escaping_11unescape_bytea)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyBytes_FromCString(__pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 116, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 116, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __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":119
 *         # 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":120
 *         # 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":121
 *         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_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OperationalError); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(6, 121, __pyx_L1_error)

      /* "psycopg_c/pq/escaping.pyx":120
 *         # 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":119
 *         # 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":124
 * 
 *         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":125
 *         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":126
 *         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_5 = NULL;

    /* "psycopg_c/pq/escaping.pyx":127
 *         if out is NULL:
 *             raise MemoryError(
 *                 f"couldn't allocate for unescape_bytea of {len(data)} bytes"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_8 = __Pyx_ssize_strlen(((char const *)__pyx_v_data)); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(6, 127, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_8, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_for_unescape_b;
    __pyx_t_9[1] = __pyx_t_2;
    __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_bytes;
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, 40 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 6, 127);
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 126, __pyx_L1_error)

    /* "psycopg_c/pq/escaping.pyx":125
 *         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":130
 *             )
 * 
 *         rv = out[:len_out]             # <<<<<<<<<<<<<<
 *         libpq.PQfreemem(out)
 *         return rv
*/
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_out) + 0, __pyx_v_len_out - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "psycopg_c/pq/escaping.pyx":131
 * 
 *         rv = out[:len_out]
 *         libpq.PQfreemem(out)             # <<<<<<<<<<<<<<
 *         return rv
*/
  PQfreemem(__pyx_v_out);

  /* "psycopg_c/pq/escaping.pyx":132
 *         rv = out[:len_out]
 *         libpq.PQfreemem(out)
 *         return rv             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/escaping.pyx":116
 *         return rv
 * 
 *     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_XDECREF(__pyx_v_rv);
  __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;
  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);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_data); {
    __pyx_v_data = __Pyx_PyObject_AsUString(__pyx_arg_data); if (unlikely((!__pyx_v_data) && PyErr_Occurred())) __PYX_ERR(6, 116, __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, 116, __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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  int __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("__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 and _dict:
*/
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_self->conn);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->conn);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->conn)) != (0)) __PYX_ERR(2, 5, __pyx_L1_error);
  __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 and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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 and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(2, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         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 and _dict:             # <<<<<<<<<<<<<<
 *         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 = __Pyx_PyObject_IsTrue(__pyx_mstate_global->__pyx_tuple[1]); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 11, __pyx_L1_error)
    __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_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Escaping); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_8405287);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_8405287);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_8405287) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 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_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Escaping); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_8405287);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_8405287);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_8405287) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  PyObject *__pyx_t_2 = 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)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(2, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_9psycopg_c_2pq___pyx_unpickle_Escaping__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_XDECREF(__pyx_t_2);
  __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":18
 *     Wrap a chunk of memory allocated by the libpq and expose it as memoryview.
 *     """
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PQBuffer _from_buffer(unsigned char *buf, Py_ssize_t length):
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)
*/

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_mstate_global->__pyx_ptype_9psycopg_c_2pq_PQBuffer), __pyx_mstate_global->__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":18
 *     Wrap a chunk of memory allocated by the libpq and expose it as memoryview.
 *     """
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef PQBuffer _from_buffer(unsigned char *buf, Py_ssize_t length):
 *         cdef PQBuffer rv = PQBuffer.__new__(PQBuffer)
*/

  /* 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 Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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;

  /* "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;
  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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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) {
  int __pyx_t_1;

  /* "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 */
}

/* "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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[6];
  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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_qualname); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq/pqbuffer.pyx":36
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *             f"({bytes(self)})"             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5[0] = __pyx_t_1;
  __pyx_t_5[1] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_5[2] = __pyx_t_2;
  __pyx_t_5[3] = __pyx_mstate_global->__pyx_kp_u__13;
  __pyx_t_5[4] = __pyx_t_4;
  __pyx_t_5[5] = __pyx_mstate_global->__pyx_kp_u__14;

  /* "psycopg_c/pq/pqbuffer.pyx":35
 *     def __repr__(self):
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *             f"({bytes(self)})"
 *         )
*/
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 6, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 1 * 3 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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 */
CYTHON_UNUSED static int __pyx_pw_9psycopg_c_2pq_8PQBuffer_7__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static 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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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 */
CYTHON_UNUSED static void __pyx_pw_9psycopg_c_2pq_8PQBuffer_9__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer); /*proto*/
CYTHON_UNUSED static 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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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) {

  /* function exit code */
}

/* "(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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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":61
 *     Wrap a chunk of memory owned by a different object.
 *     """
 *     @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_mstate_global->__pyx_ptype_9psycopg_c_2pq_ViewBuffer), __pyx_mstate_global->__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":61
 *     Wrap a chunk of memory owned by a different object.
 *     """
 *     @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 Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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;

  /* "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;
  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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[6];
  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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_qualname); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "psycopg_c/pq/pqbuffer.pyx":78
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"
 *             f"({bytes(self)})"             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5[0] = __pyx_t_1;
  __pyx_t_5[1] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_5[2] = __pyx_t_2;
  __pyx_t_5[3] = __pyx_mstate_global->__pyx_kp_u__13;
  __pyx_t_5[4] = __pyx_t_4;
  __pyx_t_5[5] = __pyx_mstate_global->__pyx_kp_u__14;

  /* "psycopg_c/pq/pqbuffer.pyx":77
 *     def __repr__(self):
 *         return (
 *             f"{self.__class__.__module__}.{self.__class__.__qualname__}"             # <<<<<<<<<<<<<<
 *             f"({bytes(self)})"
 *         )
*/
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 6, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 1 * 3 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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 */
CYTHON_UNUSED static int __pyx_pw_9psycopg_c_2pq_10ViewBuffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static 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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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 */
CYTHON_UNUSED static void __pyx_pw_9psycopg_c_2pq_10ViewBuffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer); /*proto*/
CYTHON_UNUSED static 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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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) {

  /* function exit code */
}

/* "(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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  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_5 = NULL;
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_bytes_or_buffer_expected_got, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_Escaping(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
*/

/* 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(*)(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 Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  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_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(2, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_Escaping", 0) < (0)) __PYX_ERR(2, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Escaping", 1, 3, 3, i); __PYX_ERR(2, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(2, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Escaping", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("psycopg_c.pq.__pyx_unpickle_Escaping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(2, 4, __pyx_L1_error)
  __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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  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)":6
 * def __pyx_unpickle_Escaping(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')             # <<<<<<<<<<<<<<
 *     __pyx_result = Escaping.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, __pyx_k_conn); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
 *     __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 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
 *     __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_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(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, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(2, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_9psycopg_c_2pq___pyx_unpickle_Escaping__set_state(((struct __pyx_obj_9psycopg_c_2pq_Escaping *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
 *     __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, __pyx_state: tuple):
 *     __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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_Escaping(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("psycopg_c.pq.__pyx_unpickle_Escaping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.conn = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

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;
  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, __pyx_state: tuple):
 *     __pyx_result.conn = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn))))) __PYX_ERR(2, 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, __pyx_state: tuple):
 *     __pyx_result.conn = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)

  /* "(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, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.conn = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

  /* 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.__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;
}
/* #### Code section: module_exttypes ### */
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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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_mstate_global->__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(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(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);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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__encoding(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_9_encoding_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_full_protocol_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_21full_protocol_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_used_gssapi(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_6PGconn_11used_gssapi_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 PyMethodDef __pyx_methods_9psycopg_c_2pq_PGconn[] = {
  {"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},
  {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_25get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"exec_", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_27exec_, METH_O, 0},
  {"send_query", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_29send_query, METH_O, 0},
  {"exec_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_31exec_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"send_query_params", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_33send_query_params, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"send_prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_35send_prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"send_query_prepared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_37send_query_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_39prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"exec_prepared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_41exec_prepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"describe_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_43describe_prepared, METH_O, 0},
  {"send_describe_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_45send_describe_prepared, METH_O, 0},
  {"describe_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_47describe_portal, METH_O, 0},
  {"send_describe_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_49send_describe_portal, METH_O, 0},
  {"close_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_51close_prepared, METH_O, 0},
  {"send_close_prepared", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_53send_close_prepared, METH_O, 0},
  {"close_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_55close_portal, METH_O, 0},
  {"send_close_portal", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_57send_close_portal, METH_O, 0},
  {"get_result", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_59get_result, METH_NOARGS, 0},
  {"consume_input", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_61consume_input, METH_NOARGS, 0},
  {"is_busy", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_63is_busy, METH_NOARGS, 0},
  {"set_single_row_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_67set_single_row_mode, METH_NOARGS, 0},
  {"set_chunked_rows_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_69set_chunked_rows_mode, METH_O, 0},
  {"cancel_conn", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_71cancel_conn, METH_NOARGS, 0},
  {"get_cancel", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_73get_cancel, METH_NOARGS, 0},
  {"put_copy_data", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_77put_copy_data, METH_O, 0},
  {"put_copy_end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_79put_copy_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get_copy_data", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_81get_copy_data, METH_O, 0},
  {"trace", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_83trace, METH_O, 0},
  {"set_trace_flags", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_85set_trace_flags, METH_O, 0},
  {"untrace", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_87untrace, METH_NOARGS, 0},
  {"encrypt_password", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_89encrypt_password, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"change_password", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_6PGconn_91change_password, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"make_empty_result", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_93make_empty_result, METH_O, 0},
  {"enter_pipeline_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_95enter_pipeline_mode, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_94enter_pipeline_mode},
  {"exit_pipeline_mode", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_97exit_pipeline_mode, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_96exit_pipeline_mode},
  {"pipeline_sync", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_99pipeline_sync, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_98pipeline_sync},
  {"send_flush_request", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_101send_flush_request, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_6PGconn_100send_flush_request},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_103__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_6PGconn_105__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9psycopg_c_2pq_PGconn[] = {
  {"pgconn_ptr", __pyx_getprop_9psycopg_c_2pq_6PGconn_pgconn_ptr, 0, 0, 0},
  {"info", __pyx_getprop_9psycopg_c_2pq_6PGconn_info, 0, 0, 0},
  {"db", __pyx_getprop_9psycopg_c_2pq_6PGconn_db, 0, 0, 0},
  {"user", __pyx_getprop_9psycopg_c_2pq_6PGconn_user, 0, 0, 0},
  {"password", __pyx_getprop_9psycopg_c_2pq_6PGconn_password, 0, 0, 0},
  {"host", __pyx_getprop_9psycopg_c_2pq_6PGconn_host, 0, 0, 0},
  {"hostaddr", __pyx_getprop_9psycopg_c_2pq_6PGconn_hostaddr, 0, 0, 0},
  {"port", __pyx_getprop_9psycopg_c_2pq_6PGconn_port, 0, 0, 0},
  {"tty", __pyx_getprop_9psycopg_c_2pq_6PGconn_tty, 0, 0, 0},
  {"options", __pyx_getprop_9psycopg_c_2pq_6PGconn_options, 0, 0, 0},
  {"status", __pyx_getprop_9psycopg_c_2pq_6PGconn_status, 0, 0, 0},
  {"transaction_status", __pyx_getprop_9psycopg_c_2pq_6PGconn_transaction_status, 0, 0, 0},
  {"error_message", __pyx_getprop_9psycopg_c_2pq_6PGconn_error_message, 0, 0, 0},
  {"_encoding", __pyx_getprop_9psycopg_c_2pq_6PGconn__encoding, 0, 0, 0},
  {"protocol_version", __pyx_getprop_9psycopg_c_2pq_6PGconn_protocol_version, 0, 0, 0},
  {"full_protocol_version", __pyx_getprop_9psycopg_c_2pq_6PGconn_full_protocol_version, 0, 0, 0},
  {"server_version", __pyx_getprop_9psycopg_c_2pq_6PGconn_server_version, 0, 0, 0},
  {"socket", __pyx_getprop_9psycopg_c_2pq_6PGconn_socket, 0, 0, 0},
  {"backend_pid", __pyx_getprop_9psycopg_c_2pq_6PGconn_backend_pid, 0, 0, 0},
  {"needs_password", __pyx_getprop_9psycopg_c_2pq_6PGconn_needs_password, 0, 0, 0},
  {"used_password", __pyx_getprop_9psycopg_c_2pq_6PGconn_used_password, 0, 0, 0},
  {"used_gssapi", __pyx_getprop_9psycopg_c_2pq_6PGconn_used_gssapi, 0, 0, 0},
  {"ssl_in_use", __pyx_getprop_9psycopg_c_2pq_6PGconn_ssl_in_use, 0, 0, 0},
  {"nonblocking", __pyx_getprop_9psycopg_c_2pq_6PGconn_nonblocking, __pyx_setprop_9psycopg_c_2pq_6PGconn_nonblocking, 0, 0},
  {"pipeline_status", __pyx_getprop_9psycopg_c_2pq_6PGconn_pipeline_status, 0, PyDoc_STR("The current pipeline mode status.\n\n        For libpq < 14.0, always return 0 (PQ_PIPELINE_OFF).\n        "), 0},
  {"notice_handler", __pyx_getprop_9psycopg_c_2pq_6PGconn_notice_handler, __pyx_setprop_9psycopg_c_2pq_6PGconn_notice_handler, 0, 0},
  {"notify_handler", __pyx_getprop_9psycopg_c_2pq_6PGconn_notify_handler, __pyx_setprop_9psycopg_c_2pq_6PGconn_notify_handler, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyMemberDef __pyx_type_9psycopg_c_2pq_PGconn_members[] = {
  #if !CYTHON_USE_TYPE_SLOTS
  {"__weaklistoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_9psycopg_c_2pq_PGconn, __weakref__), READONLY, 0},
  #endif
  {0, 0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
#if defined(__GNUC__) || defined(__clang__)
#warning "psycopg_c/pq.pxd:22:16: : __weakref__ is unsupported in the Limited API when running on Python <3.9."
#elif defined(_MSC_VER)
#pragma message("psycopg_c/pq.pxd:22:16: : __weakref__ is unsupported in the Limited API when running on Python <3.9.")
#endif
#endif
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},
  {Py_tp_members, (void*)__pyx_type_9psycopg_c_2pq_PGconn_members},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9psycopg_c_2pq_PGresult __pyx_vtable_9psycopg_c_2pq_PGresult;

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_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_PGresult > 0) & __PYX_CHECK_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, sizeof(struct __pyx_obj_9psycopg_c_2pq_PGresult))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_9psycopg_c_2pq_PGresult[--__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_PGresult];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_9psycopg_c_2pq_PGresult));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 0);
    if (unlikely(!o)) return 0;
  }
  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_mstate_global->__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(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(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_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_PGresult < 8) & __PYX_CHECK_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, sizeof(struct __pyx_obj_9psycopg_c_2pq_PGresult))))
  {
    __pyx_mstate_global->__pyx_freelist_9psycopg_c_2pq_PGresult[__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_PGresult++] = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

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 PyMethodDef __pyx_methods_9psycopg_c_2pq_PGresult[] = {
  {"clear", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_7clear, METH_NOARGS, 0},
  {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_8PGresult_9get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"error_field", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_11error_field, METH_O, 0},
  {"fname", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_13fname, METH_O, 0},
  {"ftable", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_15ftable, METH_O, 0},
  {"ftablecol", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_17ftablecol, METH_O, 0},
  {"fformat", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_19fformat, METH_O, 0},
  {"ftype", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_21ftype, METH_O, 0},
  {"fmod", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_23fmod, METH_O, 0},
  {"fsize", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_25fsize, METH_O, 0},
  {"get_value", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_8PGresult_27get_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"param_type", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_29param_type, METH_O, 0},
  {"set_attributes", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_31set_attributes, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_33__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_8PGresult_35__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9psycopg_c_2pq_PGresult[] = {
  {"pgresult_ptr", __pyx_getprop_9psycopg_c_2pq_8PGresult_pgresult_ptr, 0, 0, 0},
  {"status", __pyx_getprop_9psycopg_c_2pq_8PGresult_status, 0, 0, 0},
  {"error_message", __pyx_getprop_9psycopg_c_2pq_8PGresult_error_message, 0, 0, 0},
  {"ntuples", __pyx_getprop_9psycopg_c_2pq_8PGresult_ntuples, 0, 0, 0},
  {"nfields", __pyx_getprop_9psycopg_c_2pq_8PGresult_nfields, 0, 0, 0},
  {"binary_tuples", __pyx_getprop_9psycopg_c_2pq_8PGresult_binary_tuples, 0, 0, 0},
  {"nparams", __pyx_getprop_9psycopg_c_2pq_8PGresult_nparams, 0, 0, 0},
  {"command_status", __pyx_getprop_9psycopg_c_2pq_8PGresult_command_status, 0, 0, 0},
  {"command_tuples", __pyx_getprop_9psycopg_c_2pq_8PGresult_command_tuples, 0, 0, 0},
  {"oid_value", __pyx_getprop_9psycopg_c_2pq_8PGresult_oid_value, 0, 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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9psycopg_c_2pq_PGcancelConn __pyx_vtable_9psycopg_c_2pq_PGcancelConn;

static PyObject *__pyx_tp_new_9psycopg_c_2pq_PGcancelConn(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *)o);
  p->__pyx_vtab = __pyx_vtabptr_9psycopg_c_2pq_PGcancelConn;
  if (unlikely(__pyx_pw_9psycopg_c_2pq_12PGcancelConn_1__cinit__(o, __pyx_mstate_global->__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_PGcancelConn(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9psycopg_c_2pq_PGcancelConn) {
      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_12PGcancelConn_3__dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_12PGcancelConn_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_12PGcancelConn_6status_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_12PGcancelConn_socket(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_12PGcancelConn_6socket_1__get__(o);
}

static PyObject *__pyx_getprop_9psycopg_c_2pq_12PGcancelConn_error_message(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9psycopg_c_2pq_12PGcancelConn_13error_message_1__get__(o);
}

static PyMethodDef __pyx_methods_9psycopg_c_2pq_PGcancelConn[] = {
  {"start", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_5start, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_12PGcancelConn_4start},
  {"blocking", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_7blocking, METH_NOARGS, __pyx_doc_9psycopg_c_2pq_12PGcancelConn_6blocking},
  {"poll", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_9poll, METH_NOARGS, 0},
  {"get_error_message", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_11get_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"reset", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_13reset, METH_NOARGS, 0},
  {"finish", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_15finish, METH_NOARGS, 0},
  {"_ensure_pgcancelconn", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_17_ensure_pgcancelconn, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_19__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_9psycopg_c_2pq_12PGcancelConn_21__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9psycopg_c_2pq_PGcancelConn[] = {
  {"status", __pyx_getprop_9psycopg_c_2pq_12PGcancelConn_status, 0, 0, 0},
  {"socket", __pyx_getprop_9psycopg_c_2pq_12PGcancelConn_socket, 0, 0, 0},
  {"error_message", __pyx_getprop_9psycopg_c_2pq_12PGcancelConn_error_message, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9psycopg_c_2pq_PGcancelConn_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9psycopg_c_2pq_PGcancelConn},
  {Py_tp_methods, (void *)__pyx_methods_9psycopg_c_2pq_PGcancelConn},
  {Py_tp_getset, (void *)__pyx_getsets_9psycopg_c_2pq_PGcancelConn},
  {Py_tp_new, (void *)__pyx_tp_new_9psycopg_c_2pq_PGcancelConn},
  {0, 0},
};
static PyType_Spec __pyx_type_9psycopg_c_2pq_PGcancelConn_spec = {
  "psycopg_c.pq.PGcancelConn",
  sizeof(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9psycopg_c_2pq_PGcancelConn_slots,
};
#else

static PyTypeObject __pyx_type_9psycopg_c_2pq_PGcancelConn = {
  PyVarObject_HEAD_INIT(0, 0)
  "psycopg_c.pq.""PGcancelConn", /*tp_name*/
  sizeof(struct __pyx_obj_9psycopg_c_2pq_PGcancelConn), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9psycopg_c_2pq_PGcancelConn, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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_PGcancelConn, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9psycopg_c_2pq_PGcancelConn, /*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_PGcancelConn, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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_mstate_global->__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(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(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);
  }
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(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);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9psycopg_c_2pq_PQBuffer __pyx_vtable_9psycopg_c_2pq_PQBuffer;

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_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_PQBuffer > 0) & __PYX_CHECK_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PQBuffer, sizeof(struct __pyx_obj_9psycopg_c_2pq_PQBuffer))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_9psycopg_c_2pq_PQBuffer[--__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_PQBuffer];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_9psycopg_c_2pq_PQBuffer));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 0);
    if (unlikely(!o)) return 0;
  }
  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_mstate_global->__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(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(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_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_PQBuffer < 32) & __PYX_CHECK_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PQBuffer, sizeof(struct __pyx_obj_9psycopg_c_2pq_PQBuffer))))
  {
    __pyx_mstate_global->__pyx_freelist_9psycopg_c_2pq_PQBuffer[__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_PQBuffer++] = ((struct __pyx_obj_9psycopg_c_2pq_PQBuffer *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static PyMethodDef __pyx_methods_9psycopg_c_2pq_PQBuffer[] = {
  {"__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 = {
  __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__},
  #if defined(Py_bf_getbuffer)
  {Py_bf_getbuffer, (void *)__pyx_pw_9psycopg_c_2pq_8PQBuffer_7__getbuffer__},
  #endif
  #if defined(Py_bf_releasebuffer)
  {Py_bf_releasebuffer, (void *)__pyx_pw_9psycopg_c_2pq_8PQBuffer_9__releasebuffer__},
  #endif
  {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 = {
  __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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9psycopg_c_2pq_ViewBuffer __pyx_vtable_9psycopg_c_2pq_ViewBuffer;

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_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_ViewBuffer > 0) & __PYX_CHECK_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_ViewBuffer, sizeof(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_9psycopg_c_2pq_ViewBuffer[--__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_ViewBuffer];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 0);
    if (unlikely(!o)) return 0;
  }
  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_mstate_global->__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(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(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_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_ViewBuffer < 32) & __PYX_CHECK_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_ViewBuffer, sizeof(struct __pyx_obj_9psycopg_c_2pq_ViewBuffer))))
  {
    __pyx_mstate_global->__pyx_freelist_9psycopg_c_2pq_ViewBuffer[__pyx_mstate_global->__pyx_freecount_9psycopg_c_2pq_ViewBuffer++] = ((struct __pyx_obj_9psycopg_c_2pq_ViewBuffer *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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 PyMethodDef __pyx_methods_9psycopg_c_2pq_ViewBuffer[] = {
  {"__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 = {
  __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__},
  #if defined(Py_bf_getbuffer)
  {Py_bf_getbuffer, (void *)__pyx_pw_9psycopg_c_2pq_10ViewBuffer_5__getbuffer__},
  #endif
  #if defined(Py_bf_releasebuffer)
  {Py_bf_releasebuffer, (void *)__pyx_pw_9psycopg_c_2pq_10ViewBuffer_7__releasebuffer__},
  #endif
  {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 = {
  __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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  {
    __pyx_t_1 = __Pyx_ApiExport_GetApiDict(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_export_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_int_PyObject_char_Py_ssize_t__bu);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_export_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_export_name = __pyx_export_signature + 40;
    void (*const __pyx_export_pointers[])(void) = {(void (*)(void))&__pyx_f_9psycopg_c_2pq__buffer_as_string_and_size, (void (*)(void)) NULL};
    void (*const *__pyx_export_pointer)(void) = __pyx_export_pointers;
    const char *__pyx_export_current_signature = __pyx_export_signature;
    while (*__pyx_export_pointer) {
      if (__Pyx_ExportFunction(__pyx_t_1, __pyx_export_name, *__pyx_export_pointer, __pyx_export_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_export_pointer;
      __pyx_export_name = strchr(__pyx_export_name, '\0') + 1;
      __pyx_export_signature = strchr(__pyx_export_signature, '\0') + 1;
      if (*__pyx_export_signature != '\0') __pyx_export_current_signature = __pyx_export_signature;
    }
    __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_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  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.flush = (int (*)(struct __pyx_obj_9psycopg_c_2pq_PGconn *, int __pyx_skip_dispatch))__pyx_f_9psycopg_c_2pq_6PGconn_flush;
  __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_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_PGconn_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn)) __PYX_ERR(1, 47, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_PGconn_spec, __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn) < (0)) __PYX_ERR(1, 47, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn) < (0)) __PYX_ERR(1, 47, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn->tp_dictoffset && __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_vtabptr_9psycopg_c_2pq_PGconn) < (0)) __PYX_ERR(1, 47, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn) < (0)) __PYX_ERR(1, 47, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PGconn, (PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn) < (0)) __PYX_ERR(1, 47, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn->tp_weaklistoffset = offsetof(struct __pyx_obj_9psycopg_c_2pq_PGconn, __weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn) < (0)) __PYX_ERR(1, 47, __pyx_L1_error)
  __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_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_PGresult_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult)) __PYX_ERR(3, 14, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_PGresult_spec, __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult) < (0)) __PYX_ERR(3, 14, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult) < (0)) __PYX_ERR(3, 14, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult->tp_dictoffset && __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_vtabptr_9psycopg_c_2pq_PGresult) < (0)) __PYX_ERR(3, 14, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult) < (0)) __PYX_ERR(3, 14, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PGresult, (PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult) < (0)) __PYX_ERR(3, 14, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGresult) < (0)) __PYX_ERR(3, 14, __pyx_L1_error)
  __pyx_vtabptr_9psycopg_c_2pq_PGcancelConn = &__pyx_vtable_9psycopg_c_2pq_PGcancelConn;
  __pyx_vtable_9psycopg_c_2pq_PGcancelConn._from_ptr = (struct __pyx_obj_9psycopg_c_2pq_PGcancelConn *(*)(PGcancelConn *))__pyx_f_9psycopg_c_2pq_12PGcancelConn__from_ptr;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_PGcancelConn_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn)) __PYX_ERR(4, 8, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_PGcancelConn_spec, __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn) < (0)) __PYX_ERR(4, 8, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn = &__pyx_type_9psycopg_c_2pq_PGcancelConn;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn) < (0)) __PYX_ERR(4, 8, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn->tp_dictoffset && __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn, __pyx_vtabptr_9psycopg_c_2pq_PGcancelConn) < (0)) __PYX_ERR(4, 8, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn) < (0)) __PYX_ERR(4, 8, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PGcancelConn, (PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn) < (0)) __PYX_ERR(4, 8, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancelConn) < (0)) __PYX_ERR(4, 8, __pyx_L1_error)
  __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_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_PGcancel_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel)) __PYX_ERR(4, 79, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_PGcancel_spec, __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel) < (0)) __PYX_ERR(4, 79, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel) < (0)) __PYX_ERR(4, 79, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel->tp_dictoffset && __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel, __pyx_vtabptr_9psycopg_c_2pq_PGcancel) < (0)) __PYX_ERR(4, 79, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel) < (0)) __PYX_ERR(4, 79, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PGcancel, (PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel) < (0)) __PYX_ERR(4, 79, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGcancel) < (0)) __PYX_ERR(4, 79, __pyx_L1_error)
  __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_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_Escaping_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping)) __PYX_ERR(6, 11, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_Escaping_spec, __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping) < (0)) __PYX_ERR(6, 11, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping) < (0)) __PYX_ERR(6, 11, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping->tp_dictoffset && __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping, __pyx_vtabptr_9psycopg_c_2pq_Escaping) < (0)) __PYX_ERR(6, 11, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping) < (0)) __PYX_ERR(6, 11, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Escaping, (PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping) < (0)) __PYX_ERR(6, 11, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_Escaping) < (0)) __PYX_ERR(6, 11, __pyx_L1_error)
  __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_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_PQBuffer_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer)) __PYX_ERR(7, 13, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer->tp_as_buffer = &__pyx_tp_as_buffer_PQBuffer;
  #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
  /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
  #endif
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_PQBuffer_spec, __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer) < (0)) __PYX_ERR(7, 13, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer) < (0)) __PYX_ERR(7, 13, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer->tp_dictoffset && __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer, __pyx_vtabptr_9psycopg_c_2pq_PQBuffer) < (0)) __PYX_ERR(7, 13, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer) < (0)) __PYX_ERR(7, 13, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PQBuffer, (PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer) < (0)) __PYX_ERR(7, 13, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PQBuffer) < (0)) __PYX_ERR(7, 13, __pyx_L1_error)
  __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_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9psycopg_c_2pq_ViewBuffer_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer)) __PYX_ERR(7, 56, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer->tp_as_buffer = &__pyx_tp_as_buffer_ViewBuffer;
  #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
  /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
  #endif
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9psycopg_c_2pq_ViewBuffer_spec, __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer) < (0)) __PYX_ERR(7, 56, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer) < (0)) __PYX_ERR(7, 56, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer->tp_dictoffset && __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer, __pyx_vtabptr_9psycopg_c_2pq_ViewBuffer) < (0)) __PYX_ERR(7, 56, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer) < (0)) __PYX_ERR(7, 56, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ViewBuffer, (PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer) < (0)) __PYX_ERR(7, 56, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9psycopg_c_2pq_ViewBuffer) < (0)) __PYX_ERR(7, 56, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  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_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_2_2(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_2(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_2(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_2); if (!__pyx_mstate->__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(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

#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},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, Py_MOD_GIL_NOT_USED},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {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_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -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

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__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);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
    PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
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)
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        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 !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    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;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    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
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  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;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "pq" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #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("PyInit_pq", 0);
  __Pyx_init_runtime_version();
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Library function declarations ---*/
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__pyx_module_is_main_psycopg_c__pq) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "psycopg_c.pq")) {
      if (unlikely((PyDict_SetItemString(modules, "psycopg_c.pq", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_function_export_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
  (void)__Pyx_modinit_function_import_code(__pyx_mstate);
  /*--- Execution code ---*/

  /* "psycopg_c/pq.pyx":9
 * from psycopg_c.pq cimport libpq
 * 
 * import logging             # <<<<<<<<<<<<<<
 * 
 * from psycopg import errors as e
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_logging, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_logging, __pyx_t_2) < (0)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq.pyx":11
 * import logging
 * 
 * from psycopg import errors as e             # <<<<<<<<<<<<<<
 * 
 * logger = logging.getLogger("psycopg")
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_errors};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_errors};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      switch (__pyx_t_3) {
        case 0:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_e, __pyx_t_4) < (0)) __PYX_ERR(0, 11, __pyx_L1_error)
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq.pyx":13
 * from psycopg import errors as e
 * 
 * logger = logging.getLogger("psycopg")             # <<<<<<<<<<<<<<
 * 
 * __impl__ = 'c'
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getLogger); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_psycopg};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_logger, __pyx_t_2) < (0)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq.pyx":15
 * logger = logging.getLogger("psycopg")
 * 
 * __impl__ = 'c'             # <<<<<<<<<<<<<<
 * __build_version__ = libpq.PG_VERSION_NUM
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_impl, __pyx_mstate_global->__pyx_n_u_c) < (0)) __PYX_ERR(0, 15, __pyx_L1_error)

  /* "psycopg_c/pq.pyx":16
 * 
 * __impl__ = 'c'
 * __build_version__ = libpq.PG_VERSION_NUM             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = __Pyx_PyLong_From_int(PG_VERSION_NUM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_build_version, __pyx_t_2) < (0)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq.pyx":19
 * 
 * 
 * def version():             # <<<<<<<<<<<<<<
 *     return libpq.PQlibVersion()
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_1version, 0, __pyx_mstate_global->__pyx_n_u_version, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_version, __pyx_t_2) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":28
 * from cpython.memoryview cimport PyMemoryView_FromObject
 * 
 * import sys             # <<<<<<<<<<<<<<
 * 
 * from psycopg.pq import Format as PqFormat
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_2) < (0)) __PYX_ERR(1, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":30
 * import sys
 * 
 * from psycopg.pq import Format as PqFormat             # <<<<<<<<<<<<<<
 * from psycopg.pq import Trace, version_pretty
 * from psycopg.pq.misc import PGnotify, _clean_error_message, connection_summary
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Format};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Format};
    __pyx_t_3 = 0; {
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 30, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      switch (__pyx_t_3) {
        case 0:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PqFormat, __pyx_t_6) < (0)) __PYX_ERR(1, 30, __pyx_L1_error)
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":31
 * 
 * from psycopg.pq import Format as PqFormat
 * from psycopg.pq import Trace, version_pretty             # <<<<<<<<<<<<<<
 * from psycopg.pq.misc import PGnotify, _clean_error_message, connection_summary
 * from psycopg.pq._enums import ExecStatus
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Trace,__pyx_mstate_global->__pyx_n_u_version_pretty};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq, __pyx_imported_names, 2, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Trace,__pyx_mstate_global->__pyx_n_u_version_pretty};
    for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) {
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 31, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_6) < (0)) __PYX_ERR(1, 31, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":32
 * from psycopg.pq import Format as PqFormat
 * from psycopg.pq import Trace, version_pretty
 * from psycopg.pq.misc import PGnotify, _clean_error_message, connection_summary             # <<<<<<<<<<<<<<
 * from psycopg.pq._enums import ExecStatus
 * from psycopg._encodings import pg2pyenc
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_PGnotify,__pyx_mstate_global->__pyx_n_u_clean_error_message,__pyx_mstate_global->__pyx_n_u_connection_summary};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq_misc, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_PGnotify,__pyx_mstate_global->__pyx_n_u_clean_error_message,__pyx_mstate_global->__pyx_n_u_connection_summary};
    for (__pyx_t_3=0; __pyx_t_3 < 3; __pyx_t_3++) {
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_6) < (0)) __PYX_ERR(1, 32, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":33
 * from psycopg.pq import Trace, version_pretty
 * from psycopg.pq.misc import PGnotify, _clean_error_message, connection_summary
 * from psycopg.pq._enums import ExecStatus             # <<<<<<<<<<<<<<
 * from psycopg._encodings import pg2pyenc
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ExecStatus};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq__enums, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ExecStatus};
    __pyx_t_3 = 0; {
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 33, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_6) < (0)) __PYX_ERR(1, 33, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":34
 * from psycopg.pq.misc import PGnotify, _clean_error_message, connection_summary
 * from psycopg.pq._enums import ExecStatus
 * from psycopg._encodings import pg2pyenc             # <<<<<<<<<<<<<<
 * 
 * from psycopg_c.pq cimport PQBuffer
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_pg2pyenc};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg__encodings, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 34, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_pg2pyenc};
    __pyx_t_3 = 0; {
      __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 34, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_6) < (0)) __PYX_ERR(1, 34, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":72
 *         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(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGconn) < (0)) __PYX_ERR(1, 72, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_7connect, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_connect, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect, __pyx_t_6) < (0)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject*)__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect, __pyx_t_2) < (0)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":80
 *         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(1, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGconn) < (0)) __PYX_ERR(1, 80, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_9connect_start, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_connect_start, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect_start, __pyx_t_6) < (0)) __PYX_ERR(1, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject*)__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect_start, __pyx_t_2) < (0)) __PYX_ERR(1, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":88
 *         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(1, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 88, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_11connect_poll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_connect_poll, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_connect_poll, __pyx_t_6) < (0)) __PYX_ERR(1, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":91
 *         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_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 91, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_13finish, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_finish, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_finish, __pyx_t_2) < (0)) __PYX_ERR(1, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":113
 *         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(1, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 113, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_15reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_reset, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_6) < (0)) __PYX_ERR(1, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":117
 *         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_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 117, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_17reset_start, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_reset_start, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_reset_start, __pyx_t_2) < (0)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":121
 *             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(1, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 121, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_19reset_poll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_reset_poll, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_reset_poll, __pyx_t_6) < (0)) __PYX_ERR(1, 121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":124
 *         return _call_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def ping(self, const char *conninfo) -> int:
 *         return libpq.PQping(conninfo)
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 124, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_21ping, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_ping, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_ping, __pyx_t_2) < (0)) __PYX_ERR(1, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_ping); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_ping, __pyx_t_6) < (0)) __PYX_ERR(1, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":172
 *         return libpq.PQtransactionStatus(self._pgconn_ptr)
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef const char *rv = libpq.PQparameterStatus(self._pgconn_ptr, name)
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_bytes_None) < (0)) __PYX_ERR(1, 172, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_23parameter_status, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_parameter_status, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_parameter_status, __pyx_t_2) < (0)) __PYX_ERR(1, 172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":184
 *         return libpq.PQerrorMessage(self._pgconn_ptr)
 * 
 *     def get_error_message(self, encoding: str = "") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_encoding, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(1, 184, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(1, 184, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_25get_error_message, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_get_error_message, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_t_6) < (0)) __PYX_ERR(1, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":240
 *         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_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 240, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_27exec_, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_exec, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_exec, __pyx_t_2) < (0)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":251
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query(self, const char *command) -> None:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef int rv
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 251, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_29send_query, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_query, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_query, __pyx_t_6) < (0)) __PYX_ERR(1, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":266
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         _ensure_pgconn(self)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__6 = __pyx_t_8;

  /* "psycopg_c/pq/pgconn.pyx":265
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "psycopg_c/pq/pgconn.pyx":266
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         _ensure_pgconn(self)
*/
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "psycopg_c/pq/pgconn.pyx":260
 *                 f"sending query failed: {self.get_error_message()}")
 * 
 *     def exec_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/
  __pyx_t_2 = PyTuple_Pack(3, Py_None, Py_None, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_param_values, __pyx_mstate_global->__pyx_kp_u_Sequence_bytes_None_None) < (0)) __PYX_ERR(1, 260, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_param_types, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 260, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_param_formats, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 260, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 260, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_31exec_params, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_exec_params, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_exec_params, __pyx_t_4) < (0)) __PYX_ERR(1, 260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":295
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         _ensure_pgconn(self)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_mstate_global->__pyx_k__7 = __pyx_t_8;

  /* "psycopg_c/pq/pgconn.pyx":294
 *         param_values: Sequence[bytes | None] | None,
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "psycopg_c/pq/pgconn.pyx":295
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         _ensure_pgconn(self)
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "psycopg_c/pq/pgconn.pyx":289
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query_params(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *command,
*/
  __pyx_t_6 = PyTuple_Pack(3, Py_None, Py_None, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_values, __pyx_mstate_global->__pyx_kp_u_Sequence_bytes_None_None) < (0)) __PYX_ERR(1, 289, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_types, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 289, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_formats, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 289, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 289, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_33send_query_params, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_query_params, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_6);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_query_params, __pyx_t_2) < (0)) __PYX_ERR(1, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":318
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_param_types, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_35send_prepare, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_prepare, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_prepare, __pyx_t_4) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":355
 *         param_values: Sequence[bytes | None] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         _ensure_pgconn(self)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_mstate_global->__pyx_k__8 = __pyx_t_8;

  /* "psycopg_c/pq/pgconn.pyx":354
 *         const char *name,
 *         param_values: Sequence[bytes | None] | None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> None:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "psycopg_c/pq/pgconn.pyx":355
 *         param_values: Sequence[bytes | None] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         _ensure_pgconn(self)
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "psycopg_c/pq/pgconn.pyx":350
 *             )
 * 
 *     def send_query_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  __pyx_t_2 = PyTuple_Pack(2, Py_None, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_values, __pyx_mstate_global->__pyx_kp_u_Sequence_bytes_None_None) < (0)) __PYX_ERR(1, 350, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_formats, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 350, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 350, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_37send_query_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_query_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_query_prepared, __pyx_t_6) < (0)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":378
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_param_types, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 378, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 378, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_39prepare, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_prepare, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_prepare, __pyx_t_4) < (0)) __PYX_ERR(1, 378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":414
 *         param_values: Sequence[bytes] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         _ensure_pgconn(self)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_mstate_global->__pyx_k__9 = __pyx_t_8;

  /* "psycopg_c/pq/pgconn.pyx":413
 *         const char *name,
 *         param_values: Sequence[bytes] | None,
 *         param_formats: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         int result_format = PqFormat.TEXT,
 *     ) -> PGresult:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "psycopg_c/pq/pgconn.pyx":414
 *         param_values: Sequence[bytes] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         _ensure_pgconn(self)
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "psycopg_c/pq/pgconn.pyx":409
 *         return PGresult._from_ptr(rv)
 * 
 *     def exec_prepared(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  __pyx_t_6 = PyTuple_Pack(2, Py_None, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_values, __pyx_mstate_global->__pyx_kp_u_Sequence_bytes_None) < (0)) __PYX_ERR(1, 409, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_param_formats, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(1, 409, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 409, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_41exec_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_exec_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_6);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_exec_prepared, __pyx_t_2) < (0)) __PYX_ERR(1, 409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":440
 *         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_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 440, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_43describe_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_describe_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_describe_prepared, __pyx_t_4) < (0)) __PYX_ERR(1, 440, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":449
 *         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_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 449, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_45send_describe_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_describe_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_describe_prepared, __pyx_t_2) < (0)) __PYX_ERR(1, 449, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":457
 *             )
 * 
 *     def describe_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _ensure_pgconn(self)
 *         cdef libpq.PGresult *rv = libpq.PQdescribePortal(self._pgconn_ptr, name)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 457, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_47describe_portal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_describe_portal, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_describe_portal, __pyx_t_4) < (0)) __PYX_ERR(1, 457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":466
 *         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_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 466, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_49send_describe_portal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_describe_portal, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_describe_portal, __pyx_t_2) < (0)) __PYX_ERR(1, 466, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":474
 *             )
 * 
 *     def close_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePrepared", 170000)
 *         _ensure_pgconn(self)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 474, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_51close_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_close_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_close_prepared, __pyx_t_4) < (0)) __PYX_ERR(1, 474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":484
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePrepared", 170000)
 *         _ensure_pgconn(self)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 484, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_53send_close_prepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_close_prepared, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_close_prepared, __pyx_t_2) < (0)) __PYX_ERR(1, 484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":493
 *             )
 * 
 *     def close_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePortal", 170000)
 *         _ensure_pgconn(self)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 493, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_55close_portal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_close_portal, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_close_portal, __pyx_t_4) < (0)) __PYX_ERR(1, 493, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":503
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePortal", 170000)
 *         _ensure_pgconn(self)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 503, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_57send_close_portal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_close_portal, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_close_portal, __pyx_t_2) < (0)) __PYX_ERR(1, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":512
 *             )
 * 
 *     def get_result(self) -> "PGresult" | None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_PGresult_None) < (0)) __PYX_ERR(1, 512, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_59get_result, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_get_result, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_get_result, __pyx_t_4) < (0)) __PYX_ERR(1, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":518
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         if 1 != libpq.PQconsumeInput(self._pgconn_ptr):
 *             raise e.OperationalError(
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 518, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_61consume_input, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_consume_input, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_consume_input, __pyx_t_2) < (0)) __PYX_ERR(1, 518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":523
 *                 f"consuming input failed: {self.get_error_message()}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with nogil:
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 523, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_63is_busy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_is_busy, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_is_busy, __pyx_t_4) < (0)) __PYX_ERR(1, 523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":539
 *                 f"setting nonblocking failed: {self.get_error_message()}")
 * 
 *     cpdef int flush(self) except -1:             # <<<<<<<<<<<<<<
 *         if self._pgconn_ptr == NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_65flush, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_flush, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_flush, __pyx_t_4) < (0)) __PYX_ERR(1, 539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":547
 *         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_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 547, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_67set_single_row_mode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_set_single_row_mode, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_set_single_row_mode, __pyx_t_2) < (0)) __PYX_ERR(1, 547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":551
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:             # <<<<<<<<<<<<<<
 *         if not libpq.PQsetChunkedRowsMode(self._pgconn_ptr, size):
 *             raise e.OperationalError("setting chunked rows mode failed")
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 551, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 551, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_69set_chunked_rows_mode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_set_chunked_rows_mode, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_set_chunked_rows_mode, __pyx_t_4) < (0)) __PYX_ERR(1, 551, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":555
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
 *     def cancel_conn(self) -> PGcancelConn:             # <<<<<<<<<<<<<<
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr = libpq.PQcancelCreate(self._pgconn_ptr)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGcancelConn) < (0)) __PYX_ERR(1, 555, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_71cancel_conn, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_cancel_conn, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_cancel_conn, __pyx_t_2) < (0)) __PYX_ERR(1, 555, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":562
 *         return PGcancelConn._from_ptr(ptr)
 * 
 *     def get_cancel(self) -> PGcancel:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancel *ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGcancel) < (0)) __PYX_ERR(1, 562, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_73get_cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_get_cancel, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_get_cancel, __pyx_t_4) < (0)) __PYX_ERR(1, 562, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":568
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with nogil:
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_75notifies, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_notifies, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_notifies, __pyx_t_4) < (0)) __PYX_ERR(1, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":579
 *             return None
 * 
 *     def put_copy_data(self, buffer) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef char *cbuffer
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 579, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_77put_copy_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_put_copy_data, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_put_copy_data, __pyx_t_2) < (0)) __PYX_ERR(1, 579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":591
 *         return rv
 * 
 *     def put_copy_end(self, error: bytes | None = None) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef const char *cerr = NULL
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_error, __pyx_mstate_global->__pyx_kp_u_bytes_None) < (0)) __PYX_ERR(1, 591, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 591, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_79put_copy_end, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_put_copy_end, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_put_copy_end, __pyx_t_4) < (0)) __PYX_ERR(1, 591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":602
 *         return rv
 * 
 *     def get_copy_data(self, int async_) -> tuple[int, memoryview]:             # <<<<<<<<<<<<<<
 *         cdef char *buffer_ptr = NULL
 *         cdef int nbytes
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_memoryview) < (0)) __PYX_ERR(1, 602, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_81get_copy_data, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_get_copy_data, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_get_copy_data, __pyx_t_2) < (0)) __PYX_ERR(1, 602, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":616
 *             return nbytes, b""  # won't parse it, doesn't really be memoryview
 * 
 *     def trace(self, fileno: int) -> None:             # <<<<<<<<<<<<<<
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_fileno, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(1, 616, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 616, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_83trace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_trace, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_trace, __pyx_t_4) < (0)) __PYX_ERR(1, 616, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":622
 *         libpq.PQtrace(self._pgconn_ptr, stream)
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsetTraceFlags", 140000)
 *         libpq.PQsetTraceFlags(self._pgconn_ptr, flags)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_flags, __pyx_mstate_global->__pyx_n_u_Trace) < (0)) __PYX_ERR(1, 622, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 622, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_85set_trace_flags, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_set_trace_flags, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_set_trace_flags, __pyx_t_2) < (0)) __PYX_ERR(1, 622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":626
 *         libpq.PQsetTraceFlags(self._pgconn_ptr, flags)
 * 
 *     def untrace(self) -> None:             # <<<<<<<<<<<<<<
 *         libpq.PQuntrace(self._pgconn_ptr)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 626, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_87untrace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_untrace, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_untrace, __pyx_t_4) < (0)) __PYX_ERR(1, 626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":629
 *         libpq.PQuntrace(self._pgconn_ptr)
 * 
 *     def encrypt_password(             # <<<<<<<<<<<<<<
 *         self, const char *passwd, const char *user, algorithm = None
 *     ) -> bytes:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bytes_2) < (0)) __PYX_ERR(1, 629, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_89encrypt_password, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_encrypt_password, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_encrypt_password, __pyx_t_2) < (0)) __PYX_ERR(1, 629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":648
 *         return rv
 * 
 *     def change_password(             # <<<<<<<<<<<<<<
 *         self, const char *user, const char *passwd
 *     ) -> None:
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 648, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_91change_password, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_change_password, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_change_password, __pyx_t_4) < (0)) __PYX_ERR(1, 648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":660
 *             )
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = libpq.PQmakeEmptyPGresult(
 *             self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PGresult) < (0)) __PYX_ERR(1, 660, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_93make_empty_result, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_make_empty_result, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_make_empty_result, __pyx_t_2) < (0)) __PYX_ERR(1, 660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":678
 *         return status
 * 
 *     def enter_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enter pipeline mode.
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 678, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_95enter_pipeline_mode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_enter_pipeline_mode, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_enter_pipeline_mode, __pyx_t_4) < (0)) __PYX_ERR(1, 678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":688
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
 *     def exit_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Exit pipeline mode.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 688, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_97exit_pipeline_mode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_exit_pipeline_mode, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_exit_pipeline_mode, __pyx_t_2) < (0)) __PYX_ERR(1, 688, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":698
 *             raise e.OperationalError(self.get_error_message())
 * 
 *     def pipeline_sync(self) -> None:             # <<<<<<<<<<<<<<
 *         """Mark a synchronization point in a pipeline.
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 698, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_99pipeline_sync, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_pipeline_sync, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_pipeline_sync, __pyx_t_4) < (0)) __PYX_ERR(1, 698, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":711
 *             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_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(1, 711, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_101send_flush_request, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn_send_flush_request, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGconn, __pyx_mstate_global->__pyx_n_u_send_flush_request, __pyx_t_2) < (0)) __PYX_ERR(1, 711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_103__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_6PGconn_105__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGconn___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgresult.pyx":10
 * from cpython.mem cimport PyMem_Free, PyMem_Malloc
 * 
 * from psycopg.pq.misc import PGresAttDesc             # <<<<<<<<<<<<<<
 * from psycopg.pq._enums import ExecStatus
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_PGresAttDesc};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq_misc, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_PGresAttDesc};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(3, 10, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgresult.pyx":11
 * 
 * from psycopg.pq.misc import PGresAttDesc
 * from psycopg.pq._enums import ExecStatus             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ExecStatus};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq__enums, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 11, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ExecStatus};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 11, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(3, 11, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(3, 33, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_7clear, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_clear, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_clear, __pyx_t_4) < (0)) __PYX_ERR(3, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgresult.pyx":53
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_encoding, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(3, 53, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(3, 53, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_9get_error_message, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_get_error_message, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_t_2) < (0)) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgresult.pyx":56
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def error_field(self, int fieldcode) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef char * rv = libpq.PQresultErrorField(self._pgresult_ptr, fieldcode)
 *         if rv is not NULL:
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_bytes_None) < (0)) __PYX_ERR(3, 56, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_11error_field, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_error_field, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_error_field, __pyx_t_4) < (0)) __PYX_ERR(3, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgresult.pyx":71
 *         return libpq.PQnfields(self._pgresult_ptr)
 * 
 *     def fname(self, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef char *rv = libpq.PQfname(self._pgresult_ptr, column_number)
 *         if rv is not NULL:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_bytes_None) < (0)) __PYX_ERR(3, 71, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_13fname, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_fname, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_fname, __pyx_t_2) < (0)) __PYX_ERR(3, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgresult.pyx":78
 *             return None
 * 
 *     def ftable(self, int column_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQftable(self._pgresult_ptr, column_number)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 78, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_15ftable, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_ftable, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_ftable, __pyx_t_4) < (0)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgresult.pyx":81
 *         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_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 81, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_17ftablecol, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_ftablecol, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_ftablecol, __pyx_t_2) < (0)) __PYX_ERR(3, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgresult.pyx":84
 *         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_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 84, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_19fformat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_fformat, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_fformat, __pyx_t_4) < (0)) __PYX_ERR(3, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgresult.pyx":87
 *         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_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 87, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_21ftype, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_ftype, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_ftype, __pyx_t_2) < (0)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgresult.pyx":90
 *         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_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 90, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_23fmod, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_fmod, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_fmod, __pyx_t_4) < (0)) __PYX_ERR(3, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgresult.pyx":93
 *         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_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 93, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_25fsize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_fsize, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_fsize, __pyx_t_2) < (0)) __PYX_ERR(3, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgresult.pyx":100
 *         return libpq.PQbinaryTuples(self._pgresult_ptr)
 * 
 *     def get_value(self, int row_number, int column_number) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef int crow = row_number
 *         cdef int ccol = column_number
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_bytes_None) < (0)) __PYX_ERR(3, 100, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_27get_value, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_get_value, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_get_value, __pyx_t_4) < (0)) __PYX_ERR(3, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgresult.pyx":119
 *         return libpq.PQnparams(self._pgresult_ptr)
 * 
 *     def param_type(self, int param_number) -> int:             # <<<<<<<<<<<<<<
 *         return libpq.PQparamtype(self._pgresult_ptr, param_number)
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(3, 119, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_29param_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_param_type, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_param_type, __pyx_t_2) < (0)) __PYX_ERR(3, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgresult.pyx":142
 *         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_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_descriptions, __pyx_mstate_global->__pyx_kp_u_list_PGresAttDesc) < (0)) __PYX_ERR(3, 142, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_31set_attributes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult_set_attributes, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGresult, __pyx_mstate_global->__pyx_n_u_set_attributes, __pyx_t_4) < (0)) __PYX_ERR(3, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_33__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGresult_35__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGresult___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":21
 *         self.finish()
 * 
 *     def start(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a non-blocking manner.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 21, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_12PGcancelConn_5start, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_start, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_start, __pyx_t_2) < (0)) __PYX_ERR(4, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":32
 *             )
 * 
 *     def blocking(self) -> None:             # <<<<<<<<<<<<<<
 *         """Requests that the server abandons processing of the current command
 *         in a blocking manner.
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 32, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_12PGcancelConn_7blocking, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_blocking, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_blocking, __pyx_t_4) < (0)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":43
 *             )
 * 
 *     def poll(self) -> int:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         return libpq.PQcancelPoll(self.pgcancelconn_ptr)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(4, 43, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_12PGcancelConn_9poll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_poll, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_poll, __pyx_t_2) < (0)) __PYX_ERR(4, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":62
 *         return libpq.PQcancelErrorMessage(self.pgcancelconn_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_encoding, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(4, 62, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(4, 62, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_12PGcancelConn_11get_error_message, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_get_error_message, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_get_error_message, __pyx_t_4) < (0)) __PYX_ERR(4, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":65
 *         return _clean_error_message(self.error_message, encoding)
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         self._ensure_pgcancelconn()
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 65, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_12PGcancelConn_13reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_reset, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_2) < (0)) __PYX_ERR(4, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":69
 *         libpq.PQcancelReset(self.pgcancelconn_ptr)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is not NULL:
 *             libpq.PQcancelFinish(self.pgcancelconn_ptr)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 69, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_12PGcancelConn_15finish, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn_finish, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_finish, __pyx_t_4) < (0)) __PYX_ERR(4, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":74
 *             self.pgcancelconn_ptr = NULL
 * 
 *     def _ensure_pgcancelconn(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancelconn_ptr is NULL:
 *             raise e.OperationalError("the cancel connection is closed")
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 74, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_12PGcancelConn_17_ensure_pgcancelconn, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn__ensure_pgcancelcon, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancelConn, __pyx_mstate_global->__pyx_n_u_ensure_pgcancelconn, __pyx_t_2) < (0)) __PYX_ERR(4, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_12PGcancelConn_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_12PGcancelConn_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancelConn___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":92
 *         self.free()
 * 
 *     def free(self) -> None:             # <<<<<<<<<<<<<<
 *         if self.pgcancel_ptr is not NULL:
 *             libpq.PQfreeCancel(self.pgcancel_ptr)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 92, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGcancel_5free, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancel_free, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancel, __pyx_mstate_global->__pyx_n_u_free, __pyx_t_4) < (0)) __PYX_ERR(4, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgcancel.pyx":97
 *             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_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(4, 97, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGcancel_7cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancel_cancel, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_PGcancel, __pyx_mstate_global->__pyx_n_u_cancel, __pyx_t_2) < (0)) __PYX_ERR(4, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGcancel_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancel___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PGcancel_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PGcancel___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/conninfo.pyx":7
 * # Copyright (C) 2020 The Psycopg Team
 * 
 * from psycopg.pq.misc import ConninfoOption             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ConninfoOption};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_psycopg_pq_misc, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 7, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ConninfoOption};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 7, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(5, 7, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/conninfo.pyx":10
 * 
 * 
 * class Conninfo:             # <<<<<<<<<<<<<<
 *     @classmethod
 *     def get_defaults(cls) -> list[ConninfoOption]:
*/
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Conninfo, __pyx_mstate_global->__pyx_n_u_Conninfo, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "psycopg_c/pq/conninfo.pyx":11
 * 
 * class Conninfo:
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_defaults(cls) -> list[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts = libpq.PQconndefaults()
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_ConninfoOption) < (0)) __PYX_ERR(5, 11, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Conninfo_1get_defaults, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_mstate_global->__pyx_n_u_Conninfo_get_defaults, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_get_defaults, __pyx_t_4) < (0)) __PYX_ERR(5, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/conninfo.pyx":20
 *         return rv
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def parse(cls, const char *conninfo) -> list[ConninfoOption]:
 *         cdef char *errmsg = NULL
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_ConninfoOption) < (0)) __PYX_ERR(5, 20, __pyx_L1_error)
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Conninfo_3parse, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_mstate_global->__pyx_n_u_Conninfo_parse, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80])); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_parse, __pyx_t_4) < (0)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/conninfo.pyx":36
 *         return rv
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Conninfo_5__repr__, 0, __pyx_mstate_global->__pyx_n_u_Conninfo___repr, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_repr, __pyx_t_4) < (0)) __PYX_ERR(5, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/conninfo.pyx":10
 * 
 * 
 * class Conninfo:             # <<<<<<<<<<<<<<
 *     @classmethod
 *     def get_defaults(cls) -> list[ConninfoOption]:
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Conninfo, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Conninfo, __pyx_t_4) < (0)) __PYX_ERR(5, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/escaping.pyx":15
 *         self.conn = conn
 * 
 *     cpdef escape_literal(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_3escape_literal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping_escape_literal, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_escape_literal, __pyx_t_2) < (0)) __PYX_ERR(6, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/escaping.pyx":37
 *         return rv
 * 
 *     cpdef escape_identifier(self, data):             # <<<<<<<<<<<<<<
 *         cdef char *out
 *         cdef char *ptr
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_5escape_identifier, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping_escape_identifier, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_escape_identifier, __pyx_t_2) < (0)) __PYX_ERR(6, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/escaping.pyx":59
 *         return rv
 * 
 *     cpdef escape_string(self, data):             # <<<<<<<<<<<<<<
 *         cdef int error
 *         cdef size_t len_out
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_7escape_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping_escape_string, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_escape_string, __pyx_t_2) < (0)) __PYX_ERR(6, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/escaping.pyx":90
 *         return rv
 * 
 *     cpdef escape_bytea(self, data):             # <<<<<<<<<<<<<<
 *         cdef size_t len_out
 *         cdef unsigned char *out
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_9escape_bytea, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping_escape_bytea, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_escape_bytea, __pyx_t_2) < (0)) __PYX_ERR(6, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/escaping.pyx":116
 *         return rv
 * 
 *     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_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_11unescape_bytea, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping_unescape_bytea, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[86])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_unescape_bytea, __pyx_t_2) < (0)) __PYX_ERR(6, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[87])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8Escaping_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Escaping___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[88])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9psycopg_c_2pq_Escaping, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PQBuffer_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PQBuffer___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[89])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_8PQBuffer_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PQBuffer___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[90])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_10ViewBuffer_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewBuffer___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[91])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_10ViewBuffer_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewBuffer___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[92])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq.pyx":32
 * 
 * # importing the ssl module sets up Python's libcrypto callbacks
 * import ssl  # no-cython-lint             # <<<<<<<<<<<<<<
 * 
 * # disable libcrypto setup in libpq, so it won't stomp on the callbacks
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_ssl, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ssl, __pyx_t_2) < (0)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq.pyx":36
 * # 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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_Escaping(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x0804127, 0x3908a35, 0x0c1d0e2, b'conn')
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9psycopg_c_2pq_3__pyx_unpickle_Escaping, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Escaping, NULL, __pyx_mstate_global->__pyx_n_u_psycopg_c_pq, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[93])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Escaping, __pyx_t_2) < (0)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq.pyx":1
 * """             # <<<<<<<<<<<<<<
 * libpq Python wrapper using cython bindings.
 * """
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  if (__pyx_m) {
    if (__pyx_mstate->__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);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #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;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */
/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(1, 70, __pyx_L1_error)

  /* Cached unbound methods */
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "psycopg_c/pq/conninfo.pyx":37
 * 
 *     def __repr__(self):
 *         return f"<{type(self).__name__} ({self.keyword.decode('ascii')})>"             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_ascii); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(5, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "(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
*/
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u_self_conn_is_not_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(2, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "psycopg_c/pq/pgconn.pyx":184
 *         return libpq.PQerrorMessage(self._pgconn_ptr)
 * 
 *     def get_error_message(self, encoding: str = "") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u__5); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(1, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "psycopg_c/pq/pgconn.pyx":318
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(1, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "psycopg_c/pq/pgresult.pyx":53
 *         return libpq.PQresultErrorMessage(self._pgresult_ptr)
 * 
 *     def get_error_message(self, encoding: str = "utf-8") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding)
 * 
*/
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u_utf_8); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<5; ++i) {
      #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
      #else
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  {
    const struct { const unsigned int length: 8; } index[] = {{1},{179},{17},{19},{23},{22},{29},{20},{2},{2},{2},{1},{1},{1},{1},{1},{1},{0},{8},{6},{7},{18},{6},{12},{30},{28},{15},{23},{31},{24},{24},{37},{33},{32},{38},{40},{35},{33},{29},{25},{28},{33},{26},{7},{6},{28},{26},{48},{23},{45},{22},{33},{24},{29},{23},{22},{17},{41},{2},{4},{9},{20},{18},{50},{24},{14},{12},{18},{28},{24},{25},{25},{25},{23},{25},{16},{28},{32},{21},{31},{26},{25},{34},{31},{33},{22},{32},{28},{30},{14},{31},{24},{22},{22},{5},{10},{8},{14},{17},{21},{14},{8},{26},{28},{21},{26},{23},{22},{23},{10},{6},{4},{17},{16},{8},{12},{30},{32},{33},{21},{19},{30},{17},{18},{18},{26},{28},{15},{13},{6},{24},{26},{18},{22},{19},{21},{14},{19},{20},{20},{22},{24},{23},{26},{12},{18},{20},{25},{13},{12},{17},{20},{24},{17},{14},{24},{15},{23},{11},{20},{14},{20},{19},{12},{17},{18},{24},{26},{27},{29},{25},{19},{17},{24},{26},{28},{26},{22},{12},{14},{8},{12},{8},{26},{28},{14},{20},{16},{13},{14},{14},{15},{18},{14},{26},{18},{19},{23},{8},{26},{28},{14},{16},{13},{15},{22},{21},{19},{18},{21},{10},{14},{17},{19},{15},{8},{20},{4},{5},{10},{28},{30},{9},{5},{6},{18},{5},{9},{6},{8},{3},{6},{10},{17},{5},{1},{5},{6},{11},{7},{4},{4},{8},{15},{9},{20},{5},{8},{18},{12},{14},{3},{8},{13},{8},{7},{8},{4},{7},{12},{13},{18},{8},{13},{4},{6},{7},{4},{6},{5},{15},{17},{12},{8},{5},{8},{8},{7},{1},{8},{9},{16},{20},{19},{6},{6},{5},{11},{13},{6},{12},{17},{14},{13},{3},{9},{5},{11},{13},{11},{18},{7},{9},{6},{6},{5},{5},{4},{5},{6},{4},{5},{6},{9},{5},{8},{9},{10},{13},{12},{17},{10},{9},{12},{1},{2},{8},{3},{7},{13},{5},{7},{5},{6},{5},{6},{7},{8},{17},{13},{10},{4},{8},{6},{7},{8},{7},{3},{4},{3},{13},{12},{10},{11},{12},{16},{5},{6},{8},{6},{8},{4},{13},{8},{4},{3},{7},{11},{7},{18},{12},{10},{17},{15},{3},{13},{12},{12},{14},{12},{11},{10},{23},{14},{12},{10},{17},{13},{8},{3},{5},{10},{11},{13},{6},{10},{2},{4},{17},{19},{20},{22},{18},{12},{10},{17},{19},{14},{21},{12},{19},{15},{10},{12},{19},{4},{3},{5},{5},{6},{3},{6},{3},{7},{8},{5},{10},{5},{6},{14},{7},{6},{12},{4},{1},{3},{6},{7},{14},{1},{0},{66},{75},{19},{57},{189},{101},{76},{66},{48},{45},{75},{32},{34},{65},{66},{82},{65},{55},{43},{35},{39},{60},{24},{52},{39},{57},{145},{106},{163},{145},{190},{44},{105},{105},{146},{136},{184},{173},{14},{19},{70},{39},{39},{130},{140},{68},{50},{29},{19},{19},{19},{52},{52},{9},{45},{54},{9},{30},{31},{91},{38},{28},{87},{29},{33},{19},{24},{19},{55},{11},{24},{55},{22},{30},{70},{42},{33},{75},{42},{14},{21}};
    #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (4533 bytes) */
const char* const cstring = "BZh91AY&SY\2149\273\312\000\004\022\177\377\377\377\377\377\377\377\377\377\377\377\377\377\277\377\377\377\300@@@@@@@@@@@@\000@\000`\023]\317\267\261\326[\334wa\336\267M\247\234\355\201\254\2664J\364\014(\240\024\320;gU\024\022\214\007\224P\371}\275\200\tB\022h\2312\231\205M\372\251\345\006\324{FQ\344\310\243\315&\324\332S\3654OP\332C\324\365=C\322{I\032\033(z\236\211\200\324\323\324\304z\203\322\tM \004\320\204!\246\242f#B4d\365\003!\240\006M\000\032\000\r\000\006\200\0004\320h\002Q\240\211L\251\221\265\0004y\252\003@\000\003@\000\000\000\000\320\000\000\000\000z\232\002MH\212\"z\200\003@\036\223CA\371(\310\310\3656\240\032\r\000h\320\320\317T\031\014\214\232i\351\242z\217Q\211\352\000555@6\210\310\014\200\036\221\240\017S\323\022\r\003@\323@\001\210\r\r\030\230A\240\0004\000\t\022\010\010\322i\202\003@\243\006\246!\222\000\000\000\000\000\000\003M\000\000\000\320\031\373\\\375\010\303\252\006\245\251\263r\312DCs\304\003g\372\351\207\360\006\314\237\316\000\242\236M\344A\005\260\337\323\\\226\322=\246,\303\247v\336g\202L3\271\233\010\301y\202\226@\234q@\342\263\007\372\354\t\331\206\234\225\265\253oB\265*\253_\374\220<\333\224\342b\300\305\202\006\323L\020\330\306 R)\021\001\022\002\301\202\240(\262\010\202\240L\315d3\254\0145\213L-\013\021; G\223\000\021\230\326\260\010\032\032\033Ci\261\r\244g,EK.\266\351\226\205\245\354E\304\363\342A\212*,C\215\342co0^+\201nm2c\r\302\314\013;M\205F\323\000*\264:\264\307$4\242\304\262\322\001\210\214C\216\340\nm\332$\250\251$\202\204\355N\026\322\320)\250\207\3332\0322Hm&\261B\026\200\220,\327\253\357\235\211\330\263F\362h\206\334\013\033[C[\351\026\211\0137\002\305\333jR\305Q\241\310EF\014\215\260\256\311A\027\263\206\245B\254d2\315k\265\335\335\230\251|\275\"\301!\013\303\013\002\310:fXe\204\3472C*)\343p\246\306\325\341I\226)\322\"2\212\325\021%\230\231\337\323%\321Y\316\333U\027\257\356\357\217\233\337\375\017\315\333Y\342/\307\271\323xiZr;\217\250\3767\201\r~\3649'\361z?hKQ\260\274\256\244\321#\222r\217lB:\022\222\023\007""\215\2619\332\236|\374\214f\326\326`\227\360\326yR\206*I\343\034\312tC\345P\304\025\304z\233\343LVn4*O\374\274\217\361skJ\301\263\354mm\367\326~r'\2027\337\372\3342k!=P\224_\323\305\243\037J\024\032\250\256r,\346\365\255i\033\244F\177c\255\330\334\313N\361\336\355\356\035\316\317'\2157\347\212h\255O\021\355\312\201\332\007o\220\220CW&f\026\324\277WR\342\272{\251\"\265=\331t\214\003\251\035DU^\273f~\366\207\221\252\241BL{\362Z\227\254\313\336\200\024B^x f\301V\3242\214\205\303\265O\203\346\333\t\n\241\306\246\246\245\246d(v\374\032\215\354u\365\214\306\326\344\304}\032\017\250\336Q\300^r\246\275\177B\336\200\271\202\332\3639\266:M\016qnh\261\202\301+|E\276\216\335o\375\310j\322L\264;\275\1770\3159&\255P\275\311\267\023\365x\234\216\316\372\024O\217\2357\013@\312\350b\315623\347\225,\226\241\010\020\200\367h\254\024\202\224T%(: \240\246&\010Qt\245LZl\314'\221R\367\2767\305\204\301\205\326\225*E)\020\222\233\262\002J\325\312A=\014A'G.<\252\321\231$[\014\262\2145t\003\307\316\272\007\0202\006[\345\361n\316|\0135\373\272hi9\302+\304\022Z\021we\032\345\243:,\240P\325TI\016N\373\224\306\337\223\276\333\261\250\003\036W\001\257Q\304\331\350e\231\233[n\326:.sb\2470\"\303\266~\205\004O\337n5t\007{X\362\213}\022\273\325\232\215\271~\367\013\353\207\215L\261\223wo#\305M\341&\030\316C8\362s\335\276\237\"|\377|\330\215\263\231+\332\2615\324*\r\215T\334\375|V\3122\322\242\010R\022D\244\235\236\310e\326\214\215\034\370K\314\234\334\354\332\313\220\352\331\020\036\354\n0\232\032\026\035\206ddd\342\n\242\257\207]UVa0\304\355W\365\314\364A}\276\265>\376\216\314\256t\344\243\207\315O\007\252k\325\212\240I\214\347\022\023\023S\307N\206\2053\345\314{\353B\023\350\246\0316\207lJr\347I\247/~\2241@D'P\3141\243\022\304AL(KXk\222\347K\365\307\246v[\3110\364\374\026j&\214}N+\256b\257\235bYqp\333\371:7\366\032\377\037\346\317\225\307Wv\007\327\3648iW\215l\036\371\272C\023\223\227j\020\251.\344)\272\241\2176S\264\352\223\244\361\255c\001\321\225\037\027\313\246M\255\005F\272\r/\323J\350\247Z""\257\331\302\"\245\347\033\323\020\233\271\033\271;\371\222~\343{?-\3009~\017\t\371\223td\307\004(7\013\230Sr\327(:\245o\004J\204a\322q\020\025R\202\310\"\255:\271\313\203\231\371\271\264\376\227\261\355\254x\0039z\370_\302\276:\311\215N<a\006\201\325+\223\351\352\354kR\205\002\227\356F\030\237Ze\005\026;;\027\tP\220UT\372\364\357\353\2777\265\301\233\351\215\330kc\365\300k\240\312\030\224\270\344\031\324@\327\324\233F\217\031\306\213\207^\323T\272H\217?\211[\311\253\311\312z2\201Lx\340f$\240\315z\3035\246b}\331d\270\317Fi\033\010\203X6 5(\001\343\004\t\004\302%s1IM\262\247\245\262@\241-\2144A\t\225\334\034\230\311\312n\234x\024EU\355+\335*\325$]\322a\300\265\234\232-\304\342\235+\0164\014\354\033\243\346\315\372\311e\014(\024T\005cG\241\242\272kP\203\351T\320x\220/\016\274J\0027\020R\311\313\260z\217?\247\004TQ`z\275\"K2\333y\203\260\007\243F\324\276\337\355\251\202V \264M\006}n\364\222\270\277\032/\r\001+\345g\252 q\000,\032&+-r\320\010\365\250H\341\302y/V\3533g\"\031h\314l\242\245\224\2360\013\034\210\261z\330\316\255\336I\2066\010\3301\263cE\003\235\004\304)\213%M\223OJ\250\231DVr+YN\3363P\217=\360//\220\230\216^\275Vvi\331\267_\024\246\307R\005\227\243s\302\264\356\255\304\344\223\253\262\036R W\332q>\320\312 G\207\2020\216l,'f(\010b&\2261\247\201\360\204\326\304\210Z\t$\227\233\214\310\2569g\303_\003gD\026/\263m\254%\341\212\361\315\356\215\tO\375'[\2517*Y\365g\327\231\345\245K\365 \r-\001\213\304\244P\351t\3070\214\251\023~\353\275\205\2722\230*\254\311R0\312\314&;]\025\t\215\"R\t\232\206\223m\244\273\365\202\267\000q\240\350\353\345\342\303e\312\030\330\332I2\"\0341\270k\207)\311<\364l\007GB\002\"\236\246MQ\323z\023\275a\204\244\300\224D\326\341gP\036!Z7f<\251\252u5\255\252\224\r\031\240\3251buf)\312\321\033D\314V\332M=gf\242R\227\231\226\207\014li\3423)\221\257\235\276jO\271\321Z7b\345\270]\003\221\344\273\236\256\235U\303\346\306%\240i\006\303Y;\272\303\327\027\304'2\244%\210\3213\356\252\252\250\232%K\006\327\002\202\203@\3174:\265UU$\226\007\233L\316""\006\244\3313\336]@D\341\215j,z\265\031\032;\rXXp\3026\267\005\0240\312\322\002\022+\010+\262\224\035\223\216\r\025\016\251>\236\234\000\237\034O\205\036\\\013\246\031\272\233A\357\300\031\371o\236\255\310s[~vR<\036\337\201\312\365I\246&\006\327\223@\341*\327\227\020\345J\346\361\030l#\227y\272 \035\335\216a\303\263\007\202\020\220\335k\300x\362\036\365\323\203\354\033\252J\232z\211\267\350a\254\373l\356<\r`\320\344\237\311:#\272\252P\207\205\302\020\274\037\243\273x\203c4\302f\212\315JK\220Vr\315@\346\200\334\320FF\266&1\200\323\030\231d1\220\301L\332X^\030\355\235\232&\346\355\317\300q\316r\367\034\375g\235\303\327\334^\273O\026\374\033\004\264B6\364$4\215\022\235\217`\2452\371\365\271\316\r7\222\243\325\254D\314Km6\274mu\317*\261\2166W=\342G#\006\230\332M&5\213;\346\203&]\203z_\245aQ4\226\213Z[\213]\332\306\333\3035F\215\001#\306o\027\217q\336\344\322\225\370!\244\334\003H69+K1\352\333\260G\000\313i\325\270\235wi\270\332\026\361,\030\272\3251K+6r\264%s\266S\334YI^\205#\004\024\214\260k.]\357\246\245\007H\214\342%X\345r\244\334nS\211h\\\030\344>\347i/OL\361\253\014\220\2042\320\362\004\006s\317\221\273U\322\\e\316\3202o\004u\340\030\272P\363\213\227y\335S\352\237WA\257\230\316\257\222+\343\245\311\214@\307\235\3048\210;\031\021\266f\236\236_A\230\005m\262\333\242L\265\222\343H\323\275\333\276'2\365\"\321$\333\013\245+-\270\275\300\370\253\010m.\214\277\0070Z\263\326\035\311@\361K2\345\344\305{6\332Fz\221b\333\200%\300\302B\300\324kh\2276\\\\\\\205\267X\203\207{\336n\324\202\252\250c\341\252PJ\313ag\342\260\261\r\266K\322\246Vi\302K\004DE\031\317R\032\016\006Y\016\n\270\344H\211\202I\215\r \223\246\210$\352<6\346Q(\361,]\366+\322JP\244V$\3051\244\2064\245p0m\244\350\220K)\222v*Z\344\222E\211\201a\205\214\020\n4\301\201\246\252uU\330\245\237\213\367\272zg\215\033\226\216\233\003\211 \033\231r\262D\312F\343Q\325\307\202f\246;X\264\0337\355\021Z\033\000\366\2038Zli\332\257\363-(\034\202f\266f\260b\345h\213a\022I6\302\234\2007\303\273\025D\001A@PY\"\213\024\004\323i""\222i\312\001[\204 \226k\333\021\344\001\350\351\233iT\235\241\334\030\256\311\001\224\343+\333y1\260\267\242\364\2169\r\210\335\243\\\371\351>79\270\345/m\320B\244\350\344\346\022\346\300:\020\035{\201o\237\225\212\003\235\245\350^=2\214\257vnrA\241\351\320xp\nl\235\270\360^V\305G\265\201\306T\313\271a\240L\330;,x\211\2416\315\231\375\3147\266l)\220l/\333=9i[\014\267=\262\242\017{ou\242\242\341A\314\311\346\\\002\250\241\035\251s\001\337\027\254\3571\302j%\353\250\021\026\364\323I\370k\277\315R\224\301ywde3\t\236q\322o\2342\261(\\\344;\016\274\320\212)\022\253p\235n\341\254\000a\276\230\332 * a\331\305)U.IC:\231R\312\035\273zw\330\010\342\343i3\276W>\200\016Q\201Z\322\007fWx\216\t\323\235h}\3372\373RZ\234\r\223w\206c~C\016\030@\371x\270\306\374\334]\206\343\022\306\372\035\254B\005\360\260\317d4\211\031\225\362D\244\244!\261\230\314\024\\\021=\344j\016\313%/\nr\311s8\317\245 \357\312\tH\335\350\312\246a!\243t\303\032\214\223,O\316\331\214\356\250\226E.\200Y\343\373Ip\371m\217\n\343\342w\275\356\034<\314\360>\034\213\205\256\321\037\346\312H\320\245\325:dA\334u\005\000;\365I\256X\354>\260\340 I\245CV8ue\342Z\031|`\201|\022\224z\314\206\203\217\n\274\342\003\264\305\307\237\205\003\233\003\241\204\323\351\236\374$\036\226\364\236fA\230oif\254\\\215\000\330\344\n\225\264z{\350\347\276{\352\263a\301\355\022\226x3\322j$N\2270\006\364\222\267K\335\35320\274'\277?n\231T4\304\352\366iM\233\t2\032\n\345\t\301&\022I\212\007_\276Mh\250\231\030N\314\032y\216\025\226\034\322\257Z\240\022\006\354\005QY(\351\254ST\200M\254\201q\243:l_\241\275\332:\205\325{\260\017\266A5\260s\210[s&\r]\322q9GXb\264\254\372\247\270-\370q\323$F\3716\201\010\353\207PR\205F*\276\000\232\003\242eb\224\030\233th\232\321Ja;\036\2509\017\007o\206\0325\3712-\005\244\222I\246\017\322?\240\230\245T\212pejHl\032{\023\013\210'\247l\273\313L\255\325\303\177>h%\255\224\026@F\347BC#\334T\240\265:\307\222u\273\235\355\370\265\226\275\263\264tGNQ\324\355>\372\272\3718\005\277E\333P\303\0000\205^\023\177\304)cI\235~""(A&\244\340N\205\374\231r&\215k\3172\227E\005)\005JD\201M\234\355m\252J\210\227:\027\243\310\001<\367\336\225\254Z\215\234b\330\0130\267s\360\371mU\264\234\347\317\343\370~lG?1b\367\0337\251kMy\320\375!!\313UI\021\2035\211\370\356|\337\200\003\226\0234\221\020D\006!\336M\276f~\376\313bsd\337\367\3202[\207\260\033\377\016\200\"\037\251\204\234:.\363B\2403\200\235\310;\022\250\037\020\350Zj\364\366\371\245X\2639J\261\213}2\325bs\216\217\2554M\201\013\303\347\347@\246\001\300\373\252\270^)\257\255\200\t<\n\240\335\300\363\342R(\244\341\025\t\314=C_U\202*\036L\023)\215}\227\231Lt\307#\222\302Q\301\310ty.F\262\321@\237Jc\223XP\345iiJF\323\\\351j\345\260i\024\345\377,b\370=^\026\206,\207\233\207\336m\3239\263\242\037\027,=\317/%\246\\\354\321\207(\363\323\324\355\037\351\347\372?\017\204q\243q\256\034M\336\333M\346<\031\347^\007\237E\356\323\030\224\2764C\243\334\361xV\335\225MMJ\241\271VB\255\246\037\367?\355\351\033A\302J\242\274\346\314\300\234\303R\376^r\352*lo\216\234\007\230,\200w{\254\205\333\332\215\350x^\332IN\004K\360b!#\010\356\234\234F\236\323\320\274\366ET\277{\276\376\234\021\265H:%\t \216\324\260s?\245g7\322\311\344\322:Ci\032\254\376\272\027K\272N\3316Z\357F\201\022\221A\305^U\017\260\027\355]\013\203\tf\222\245w\341\2756h<t\336\220ef\366\367\2147a\2647\224pSF\0362\207\260f2[Eq\222n\327uq-\003\255\203\333 \010\305D\313+\250\274\247=\216\200j\035k `S\310\023\024+\241\203\237\270=\232\240\225\177\303(\234\375\363V\313p.\351\\+m\005U\311\364\360\\CX\355\317E\255\177\006_O\232*\225\321L\273\345\215\312\374\013\272o\016q\202\301\275\216ul\007\013\260q\220r\34665\335e\016\022\333*\353\r\325\263k\210\354m\2713t\303\2074\216\242\201\264\302\366\nz\223\236\210<\301}\205\327\331;\244\335e\254\251\005\177\260\024\312\230s\254\256\230NC\222@\367\234p\037a-\366i\2721tFz\367\016\344\025\305\237\006\016\271\r\344\234Z\235\222D\033\344 \314\204\264\253\323y\244\302\254\214qN\221\334$\302d?C\324\251\330\314\374\350\321\271\212c\347>\372^\200\372\317|P\036\256\205\306W\021w""@\246\222\304D\354\214;ERm\303\331:\023\344\017\261\216l\320\003\254vfd\r|h\0003\002\032 \032X6\246}\354\350n\321\366>\264G\001\241\252*DH$\310\202!\206\3723\341\341\310\0259\354U\3107\273\003\333\037*\323\330\203\264\303\324\343\345\325\017\262=W\305$\343\246[\254\341\252R\367UY\304`\233\205\210\225x\306&\354\304\334\272\22712IN\345\304\275U\261T\361t[\321/r\245JV\270\231\314\315K\344\251w\254g\023\331\215u6\371\314\326q\tUf\313.]\264\235.\2251\007\217\334YS\3138\3025\217\207\325\252ab.]\242*V\321\206\272y\231Oi\223\274C\300\241\351\r\016[;H\370\303\223\204\245\333s\236w\r\005\204d2Mb4\316q\014,\255&\351\346\304;\245\211\267{\0230\311\246b\305\365\204\027\220CR\302i\314\340\232\201f\225\274^\"\352L\02563\341\336\245\355\323\336\035\246\232%\336\201!\323\t\336]R\005\377\213\271\"\234(HF\034\335\345\000";
    PyObject *data = __Pyx_DecompressString(cstring, 4533, 2);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (4567 bytes) */
const char* const cstring = "x\332\305XKw\333\306\222\266&tB;\264-\306\222\025\337\370\001\372m\307\226\243D\216\355$\223\204\261\344\307\215\037b\344$\2368\016\016\004\202\022b\020 \001P\026\357x2^j\211%\226Xb\211%\227\\j\211%\227\372\t\371\t\363U7\236$\344\344\234\273\230s$\002]\rtWW}\365U\025\346\037\033\266\"\330\033\222-\334\351\333\033\206.\250\226\320T4uM1%[\321\372\202e\233\252l+&=\244\013+\313+\327\026o-\n\222\336\024L\345wE\266-\301\352\255\311\232dY\212%\030-a\255\247j\266\252\013v\277\243X\363\302\203\226\3207z\202\256(M\3016\204\016\236\313\276`o(\272`)6\335\010\027%]7l\311V\r]\304\353\252\276~Qh\252&6Q7\025z\373\256\244Y\312\374\305\225{\246b\3654\373\242\360Zxl\350\312J\303R\364\346]\255gm\374\240t{\212e\013$\262\177`O\325m\333\264\204\226\244jJs\225\246uYy\276\326\267\025\353E\364~^\032\t'&U\335\216e\302s\341\322\345\257/]\376\346+\341k\251\331\024u2\"L\370\311\326\013~\021\244M\354'\255i\212\240\352\226\255HM\201\255\235\335\200\337\033&,\326j\301\276\312V\007'U\232W\205u\303\026d\t{j\202l\350:\235\037\216\301&\202\321Qt\245\031\315\361#}!\310\232a)B\307T:\222\t+'\342\374\253pIG\355\300\263P\277m4\025L[\2756l\214\231N\317\316\274\326\323\232\372E[\2204\315\220\201\001a\345\036-5)\317l\320TZ\022Lm\275\365!Uo\031\223\017(\355\216\335\027b\227N\316\267`!\305\222\245\216\"\222\305$\302X\361S=\375\257\237\203\032\244\021\251\002,\232\226\222<\"\233\n\323\227\331\366\016\236\021\2145\302w\361\003\343\223\320\036 N\017\233L\0202\243w4\206lX\270g\232\212n#\266\014\235\002\254\327\351\030&\034O\312=T\365\336V\023\3470\021\201\223>m\252\026\201J\321\331\257i\342\324*s\257*+\320AV\020(\346\027\302y+\262\204\332\304FjK\005\274\342%\366\236\321\215\254\267:\246\261\211\207\232\321\363\232\n\016\220\264\361e\306\305o]\203\250\004xK\226\330R\344\236M\222\344\234\0105\263_\360@^\316\257D\0108\003\016\220\303u:i\365u9\231k\021;\300D\234\036\222\225H\232\325iB@\274\224\305\260\305\303\255\271.S\224\252\026wESS-\373\371\235\010YO:\364\354\013&c\300\006\005-\301\006/`\235(R\004Q\304y{\262\"\212B""\263\307\310M7\364k0\320\246\ns\212\242\254\352\252\215I\354\311T\320T\234\365K\001\356\265H\017\002\257\324\026\001\373\266\004\n\346#F\271\321\375\246\244\341\244\340\026\233q\356+\303l\302Z\262\331g\272%\307\343\226\2374q\307\352\313Fg]\224\257w\272\327\343\210\231\357\364\267r\023\314\257xyb\242\263\316!_4\201\305\n\304<\374\307'h\314aM*B\334\027\232\222-%j2\207\"CX\0022V\247+\264L\243-\254\030\226\215\365V\033\017\021}Zk\236v$\307\021\013\022\361RH\262\345\212y3\231\236\330-7Cq=>\261w\340\306O\354\201\364x\232K)\2712/Z{<\220Jm\026\036\362FO\177\211EM\343\225\305\202 z\"\236\007\264\326@\200/\263\300\216\347,\374 M\341\325\354\233_\361X\265\214\236)+_3\004N$\244$\026\366\212\221I9\304\266\335\353h,\233^\025\332J\3330\373\233\252\362\352E\317n]\273u\347\311\243G\365\307K\342\223\357\343P\312\207T<\232\247\350\351\230\242\230\010\326\025[\214\223P\"d\004\277\034a4\276\316'\221'\263\202G\024330\212\205\002\244`.\233Z\306\205)\227\216\317D\3648.\346\306M\244\371\304\265\014\326[\205\022=\353.\213n\202,\252\264\3258M,\023\355?\351P}\006\223`q\032#G3\377\304W\262A\366~\362\324c\263\023'\317\317+(\026LE\214\343Z\036_>\206WN\330\002\207Y\0339\021\371\211\345-\261\255X\226\264\256\344f;\206\226;\301<K\2539\t\2244\023\311\336\247z\333\211\346\363\246\232o\231\212\302k\034\376[\270\352\336V\242\031\276\222\230YCF\265\274\016\203E\334\033K).D\362\243\244\345E\021/\304B\0365\371\221\030\231'+\212\315\021\311P\321\001\216T\317E\262\230\221\362{\246\322\374\266Q\202\030\327\232eY1\316\244\"\321D<\003\254\212\331{N[9\311\330\026[HkEK%`a\003J\303\321=A&\361X\"\000\005\213D\316\031\3318\256b9O-\221@\265\304\265\236\325\217Fm\351\245\"\262\n4\377\024UT\210\347\370 \354T\n\031\301b\201\031\2139\340\371mt\"*:b\031?y<\352Mj\235\310\300\356\221(F|r\237\365:\027d}NyA,@UV\236w\000\233)\206\305\330T\301{\314/bTEe'\362ge\"\226\252&\004y\204d\345\343\333\3014<\255\211\224\326\262PaF`i\213\246\306glSB\350\2664i=\336\205I\242\373\236\036\215\230\213\373\331\362,\356A\342k\021\017$3\005L\020""\315\311\232\"\231\311\210\203\022X\322\232\211\254\305\313\266t\214\023\244\003\035PKG\226\372\257\314\310\246bsl(\033ZF\202\0220\031\025\004Ef\206U\210\211$\255 \023\021\031SB\363\254\242\210D(4\276c}j|-\260N:3i\235F\304\341\254\211\302\210\321\343J\3143\r\006\325\025\016\306h\020\343\241\221\226\020?\242\250\270\267\272Z_y\260\322\210\270*^\202%\274\006c\252\225(\026\037\021.\032D8yI\253\207\2002\r\033\315\250\366\023\257\247W\032\033\250L\320\312\343xq(\257R$\263/\013w\262\312\245\202DA\234\366)\201\352.\303\\\227\247m\234\271\277\205\377%\0254\375X\331\262\177PZO\227\237=eO\376\204\222\207\033+\275\2334hnn\302\244\222\266n\230\252\275\321\226,YU%\"\036\221\375\252\006R\201iP\347\244X\344@\372\201g\2012\211\265\010q\262^\353\265\370\267\007\376+vl\224T\364\375\246)F}\206\310J\022K\226i\263(\365\247\251N\346\357\311\260\243\014\234\311Q72\226\372\320\313\320\307\036\221\256\212\244\347\021\311\202\005?\372\272\275a\311\214AU\235\207\360\232$\277\3142[\236\315d\315\222u\316%\330\276\327\326E\275\327^\2032l\2406e\243\335F\035\215K\207\352Y\376\005\203\341(\233Msi4\305\231\210<\332\226\314~\334\370\3442\253\014\316\221\231\035e\336d\021\241\323\367\024\336\350\232c\334:\301\247\\\300\352Y\030\245I\360\340\0274\367\035\330\316\244+\205=\244\206,\212\350\366\2616\334%\3067\343i\272\250:+\310\331\212\276\271\t\005L\263m\2553'd\270)\347\0246\260\2625\351D\241\233\257ose\255\262%\323\037; \253\0002\205A\256\"`\003\236P'\253\202\210#\231rd\332\026\274\250\033\274H`\334\316R\0211'#\314\350iTr\214193&\374\310hQ\024[=\204\210\010\356{h\254\303\002ia\221\253(\262\255\304\004\203\246\365DB\241lE\036\232\242\252\002\356j\273\243\341\027\226\342\265\206\210k\022\2200X\333z\251\364\311o\232\264\246h\034\373\032}\367\321\230Z\364K\336\026\333\022BA\234(Q Rl)\216)2V\017\211P$+$\277,jqU^\211b\\\313D\321\20201:6\032;;\367\t\201\017x\014\245\271 \363]!\373Ya\274\036b\215\026Cc\263\263\376i\247\017\200\362F?\356\353\251R\312\225H\035\r\336\302\316\024\204\035\243\023AB\024\323\033\376""\025 \272\314'\330\267\222\317\003\363\235n<\233\275\243G{m+#h\253\226\014j\313\025`\331\312\013\233\201\251\251\027#{\262\373\rE~\211\210\347\243\330\354t\037\371\231n9\246\350\256\247wT\371%\234\020wt\\\274\311\340Gkv{\222\306=\223~\366\231`\373D\240l\361\0015\270\330\233\025}i)\230\251\001#\305\270\007M\305\356\231:\325C\334\211\346&}\374\230\250\017\013\n\303\242\212\260\270\024\234\254\001\263\305_Z\314M\224{\005u^\276\272(,\367X\322\213 ]P\363\215\025{\030Fa\233I\226bA\342$\202\260,\215\231\220\315p\020\203\275\360\247@\333\276\305<G\261L\223\"\337\205E\201\330\222,\312\245j\023?\010\335|\353\036\025\227\275\016 \246\200\325\222\275qo\202|5\036>Qr\215s,,\202%\267@\030\302\245\225\376\023\366aY\270rU\240\\ \\\301\315J_\264XB\200\370\362>1\312\326\222\025\021\256\210<\307\016\025\226>\t\246F\345\017\335\251\360\370\025\2776*\037s$\247;*_\364\376\010\032As0\277\203\331\367\267?\333\226\235\352\250\362\201S\013\217\236\363\352\243\351\313~\325?\027\316\177;\234\332-\3179\377\362\252^-,}\354/\214\3123\316\003\267\3416\3033\237\006\020-\004\325h\315\335C\207G\225c\216\346\325\274EZ\234\226]\334\356f\027\275\344O\3713\341\265o\006\335h\255S\256L+\217\312\227\303\313\337\014^\357,\214*\323\316\1778\265\335re{\331\231e\252Vf\234\207\336\224\007\355\252N\3259\343\334w\227\323\301\367n\017\013G\203\207\336~\257\021\017\376\351*\336B<x\340\376\210]\212f\036y\263\236\264[>\021\236\270\3467\374f\370\351w\303\363\303\336N}T\206\332\016T\254l/9\357\340&9\206\327\210\224\027<\330\346\230\243C\364\324?\025t\007\225a\235\016}\3239\347H\331c\317\373\222o\207\237-\017\231M\276t\326]hy4<J\376\370\360<\326\273p3x=\304\026G\235[\356\302.\277\204%\3307r\334U\277\236:.\274x\023{\225\006\217wj\177\337s\237\005\013\331\025n\r\246\0063\203\337`\357\242\025\260\235\3774\\\2703\\\310\254\260\030\324\331\253_\016\230\223\016\207\247\230$\361\361\307\000\2054\032{>\332\361lx\366F\036m\353\016\231\300a\207\305Q\317x5\276\324\377\270w\334n\326\326\243\362G\356-o\301[\362\2437\327\234\251t><""\317N\022\376\347\223\035lsd\033\270\202\301\342\245\356\301\315\325\177\2705w\221\326\234v\216\270\231\371\360H\315\233\303\242U\270\321\233!\334L\207\323\264d\351\006a\227\331\035\216K\316\360Q\370\021CH0?\234*\2006\342 8\027~~\177g*Z 5\366\027\203\332`q\360\307N\343\357\033\373\214w=8>@\030@9z\353sg\016j\023f\316\302\026\014\234\327\334\256W\362\036\007\265\002\263\214\246\001P\177)\374\344\273a-2\0130\023\035\212\361Az\250\353~7(\005\217\207\265\2778\024\014\235}\r\253\0043\301o\303\205\202\327\340\372\340ix\373\373\035x\026\346\377\263\262\357@e\373v8\003\250{M`\27604\302\322\025\377\022?\r\036e \366\365A=\213\2057\365\321\342\rp\205\177\032N\257\216co\267<\353\374\002\243@W<\375\347\301}\007\216'\307\205\302l\247\240\030\360Y^\272\342_\010*\330\267|$<B\306^\n/\341\350\330\372\344\251Qy!8\315\275\177#\346\204\010\366\207\302C\002#\251C'\334:\302\233\033\235\305\355\251\360Td\307\273C\251\000\375o\352\2149\347\234\377f\314\331\245G\330\322\227\200\334\317\334\337\375w\374\333\301\035\270\257\372\221\273\340\326\263/\322!+0\302\246\263\352N\345\243\206l\323\003\273\035\365r&\334-#\324\274\317a\335\363\360;\030\"\202\324\222\277\337\377mp#\206\266\345\324&(\305W\230\237\376|w\337\201\303\333\253`\351\013\356\224\213\003\3179]\n)\034\030\n\275\033+\3643izd\333vn\270\207\274U\304\3314\260\023\316\221\245\253\364\324%Nc\357\016\244A7\267'\014:\232\246\220\371\214\246\322\335jc;U\322\235\226\021\277O\375Y\277M\357\274\365\264\357\247\272\315\205s8\326hz\306YvO\021#\356\037<\0336\206\322.<\361\007\347\344\336\340\376\260>l\354N\250G\244stP\037d\214q\311=\203U\363*\302;g\213\366\377\373\316\202w.x\222g\3737\202\303\003%\016\2661\3570\006\tfY\234\276\335;\207\367P\350m\316\332EN\337p5\277\346\337\014\316\004\337\005k\340\201\n\217\247\310x^?\330\037<\0334\006\260\035\366\031M\023\345.\244k\214fr\032\226\367A\251\311\025\335o \270\035,\017\252\273\345C\333?;\337!\207\3069\230\005\023\002kT\276\344W\210\\r\321\237\3321\342O\004\353\325k\2432{a!\\\250\017\253\303+;u\316""\277Q\340\036\331~\345\310\260\017\224|I\257\354\246'>\346\277\n\244`\013\260\234=Mt\302\016\262[\030\341\330\350\333\372\350\300\301\210Y\221\260\311\376g\274j\024\3033\0164\200\017c6\273?\274\273S\304\263)\013r\377\375\310\216=\036Ys\037\216f\211Q\346\310\364'\350E\332\231Q2y\366(0x\331\373\302\177\036\336\372'v\251\374\303\275\346Q\374\034>2\252\234p\037q\254?\366.\003K\007\007\265\321\364y\357\277\374\337\007\007\211\370\211X\356{\017\374_\002\026\213\267\235;NN?\024*\376bx\035\206\314\330\370\337\323\350Xx\214\240\361wU\0323\030\312\231`\211\255\n=\312\373\216]\363\263[\227\031\314\351\265\257\234W`\347\312q\3674\034{2\220\330\276d\355\356n\271\226\270i\326y\341]\205p+0\001,\024\n\373\235\037\023\010;=\367~x\356+D\373\257;\325Xy\347w/\322\375\202\177 \230\rT\"\261\010\254\005\371\245\330~\377\037z\353\244NN\357\335T\357\267\030\231\005\324\214s\2172P\224\327fPHK\256\035\236\305s\310aI\024\240J\"\024\317\360\250\244\312xs\200pa\345\027\n\364U\377`\260G\t\200m\346\257S~?\201bQzK~g\221}\315\377uP\035\234\033H\031\310\036\245\203\214!\364o\203\363\2027\225\202\223j\363\310P\373\375_\302\233\017\321\022\200\330\256P\361\365vl\246E\323\277\243\201c\200\320\022\005\032\024\033\215H\201\335q\005&\360\226z.SS\246M\004\2537NPy\214\274\1778\220\376\"\3463kPaU\211\n+\024\216\360j8}6ZF\036dt\360\236\206\227\321)\274\241:\212\362\225\263\010.\333\357\376\312\210p#X\247l\021\371\361\310v\037\251\352Xx\032\225ZX\242\234\034\001m)\024\230\210\265\2553\350\373\352\356\323\260\006\363\322\213\367\275:?\372\357\356;n\334\235Q\201\211\323T\235c\330\255\214\020=4\3534\234\246;\357O\261\302\037}\236\373\200\025\241\327\007\263\203\365aQ\217z\306;\353\375\214|\365,h\274\231\032\225\246\235C.jS\254\234\034\234U\224\274Y`\360\266\006\265|wx\322\215\033\010\326'^\365\237\014\026\006K\005m\003oo\276 \255i\257\203\333\037;\361\353\344\221G0\3729O\312/~\236\027\014\250\221/z]\277\344\347+dJ\257\373\017o?\005\036J\225\355{\316\202s\327\275\212%J\357\275\331DR]vghq\274@a\202\330\247n\010s]V""\356^\366g\320\341\254\007\317\207\357\r1\227\223\304~8\351>#\003\206WP\242\025\266r\347\275_\374n\246o=t\222\276\026x\363\344\311\257)XY\003\306~N\273\257y\233\362\355\360]\024^1\251=\247\206,<\177#\370i\300\027\245Z`7\372\014\020O\214\246I\177\372\tK\027<)i\351\306J\250\260t\314\211\230\344\017\367g\314UO\021iQ\377\017\017\nD&\254\311\313,\036\277S\t+\214jgb?\204\245ST\352\347\361\312\314\220\266E(\001\202\305\340\217Bd\245m\0219\233\352\272M\037\233\035w\253\321\247\023\225\265tu\236\361\247vK(?(\004\336\037|9|\0316~\030\225\350\303\300-\326\000\302g\257\235\233.\366\2468\3752\320\207\220\301~ai\2164\211t?DD\261\344M\361\256\346\275\240\233\357j\016\014\217\016\227\250\267\303F\t\272\031d?p\256G\330\233\244\027\257Q(d\253\320\314\247\333\317\034\221\205\306\03690\322\221\354\363\277\356:\226\253\302\004\3569Jx\360\t\364\016K\200v\\=\337\002D\036\360|\360\2013\317z\365\337\202\333\203\345a\265\260\361M\333\351\250l\304^Q\003\n.\345\r\326\036\375\347\361\270^.Q\216c:r\307F,R\373?\327\"\213G";
    PyObject *data = __Pyx_DecompressString(cstring, 4567, 1);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #else /* compression: none (11545 bytes) */
const char* const bytes = ".Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.'PGresult' | NonePQsendFlushRequest PQsetResultAttrs failedSequence[bytes] | NoneSequence[bytes | None] | NoneSequence[int] | None [ ()>()?< >add_note at 0x] at 0x available instead bytesbytes | Nonebytes or buffer expected, got cancel connection not openedcancel failed: close prepared failed: connection not in pipeline modeconsuming input failed: couldn't allocate PGconncouldn't allocate connection defaultscouldn't allocate connection infocouldn't allocate empty PGresultcouldn't allocate for escape_bytea of couldn't allocate for unescape_bytea of couldn't allocate on conninfo parsecouldn't create cancelConn objectcouldn't create cancel objectcouldn't reset connectioncouldn't send cancellation: currently only supported on Linuxdescribe prepared failed: disableenableerror in notice receiver: %sescape_identifier failed: escape_identifier failed: no connection providedescape_literal failed: escape_literal failed: no connection providedescape_string failed: executing prepared query failed: executing query failed: failed to enter pipeline modefailed to sync pipelineflush request failed: flushing failed: flushing failed: the connection is closedgcgot isenabledlist[ConninfoOption]list[PGresAttDesc]no default __reduce__ due to non-trivial __cinit__ on the client; version  param_formats param_types param_values but password encryption failed: preparing query failed: psycopg_c/pq/conninfo.pyxpsycopg_c/pq/escaping.pyxpsycopg_c/pq/pgcancel.pyxpsycopg_c/pq/pgconn.pyxpsycopg_c/pq/pgresult.pyxpsycopg_c/pq.pyxreceiving copy data failed:  requires libpq from PostgreSQL self.conn is not Nonesending close prepared failed: sending copy data failed: sending copy end failed: sending describe prepared failed: sending prepared query failed: sending query and params failed: sending query failed: setting chunked ro""ws mode failedsetting nonblocking failed: setting single row mode failed<stringsource>the cancel connection is closedthe connection is closedthe connection is losttuple[int, memoryview]utf-8COMMAND_OKConninfoConninfoOptionConninfo.__repr__Conninfo.get_defaultsConninfo.parseEscapingEscaping.__reduce_cython__Escaping.__setstate_cython__Escaping.escape_byteaEscaping.escape_identifierEscaping.escape_literalEscaping.escape_stringEscaping.unescape_byteaExecStatusFormatNoneNotSupportedErrorOperationalErrorPGcancelPGcancelConnPGcancelConn.__reduce_cython__PGcancelConn.__setstate_cython__PGcancelConn._ensure_pgcancelconnPGcancelConn.blockingPGcancelConn.finishPGcancelConn.get_error_messagePGcancelConn.pollPGcancelConn.resetPGcancelConn.startPGcancel.__reduce_cython__PGcancel.__setstate_cython__PGcancel.cancelPGcancel.freePGconnPGconn.__reduce_cython__PGconn.__setstate_cython__PGconn.cancel_connPGconn.change_passwordPGconn.close_portalPGconn.close_preparedPGconn.connectPGconn.connect_pollPGconn.connect_startPGconn.consume_inputPGconn.describe_portalPGconn.describe_preparedPGconn.encrypt_passwordPGconn.enter_pipeline_modePGconn.exec_PGconn.exec_paramsPGconn.exec_preparedPGconn.exit_pipeline_modePGconn.finishPGconn.flushPGconn.get_cancelPGconn.get_copy_dataPGconn.get_error_messagePGconn.get_resultPGconn.is_busyPGconn.make_empty_resultPGconn.notifiesPGconn.parameter_statusPGconn.pingPGconn.pipeline_syncPGconn.preparePGconn.put_copy_dataPGconn.put_copy_endPGconn.resetPGconn.reset_pollPGconn.reset_startPGconn.send_close_portalPGconn.send_close_preparedPGconn.send_describe_portalPGconn.send_describe_preparedPGconn.send_flush_requestPGconn.send_preparePGconn.send_queryPGconn.send_query_paramsPGconn.send_query_preparedPGconn.set_chunked_rows_modePGconn.set_single_row_modePGconn.set_trace_flagsPGconn.tracePGconn.untracePGnotifyPGresAttDescPGresultPGresult.__reduce_cython__PGresult.__setstate_cython__PGresult.clearPGresult.error_fieldPGresult.fformatPGresult.fmodPGresult.fnamePGresult.""fsizePGresult.ftablePGresult.ftablecolPGresult.ftypePGresult.get_error_messagePGresult.get_valuePGresult.param_typePGresult.set_attributesPQBufferPQBuffer.__reduce_cython__PQBuffer.__setstate_cython__PQcancelCreatePQchangePasswordPQclosePortalPQclosePreparedPQconnectionUsedGSSAPIPQencryptPasswordConnPQenterPipelineModePQexitPipelineModePQfullProtocolVersionPQhostaddrPQpipelineSyncPQsendClosePortalPQsendClosePreparedPQsetTraceFlagsPqFormat__Pyx_PyDict_NextRefTEXTTraceViewBufferViewBuffer.__reduce_cython__ViewBuffer.__setstate_cython__algorithmasciiasync_asyncio.coroutinesattrsatttypmodatypesblockingbufbufferbuffer_ptr__build_version__bytesccalgocancelcancel_conncbufferccolcerrcformatschange_password__class___clean_error_messageclearclengthscline_in_tracebackclose_portalclose_preparedclscnparamscolumn_numbercolumnidcommandcompiledconnconnectconnect_pollconnect_startconnection_summaryconninfoconsume_inputcrowctypescvaluesdatadecodedescrdescribe_portaldescribe_prepareddescriptions__dict___dictdispchardispsize__doc__eencoding_encodingencrypt_password_ensure_pgcancelconnenter_pipeline_modeenvvarerrmsgerrorerror_fielderror_messageerrorsescape_byteaescape_identifierescape_literalescape_stringexcexceptionexec_exec_paramsexec_preparedexec_statusexit_pipeline_modefformatfieldcodefilenofinishflagsflushfmodfnameformatfreefsizeftableftablecolftype__func__getLoggerget_cancelget_copy_dataget_defaultsget_error_messageget_resultget_value__getstate__iid__impl__intis_busy_is_coroutineitemskeywordlabellengthlinuxloggerlogging__main__make_empty_result__metaclass____module__name__name__nbytes__new__notifiesnparamsnumoptsoutparam_formatsparam_numberparam_typeparam_typesparam_valuesparameter_statusparsepasswdpg2pyencpgconnpgresultpingpipeline_syncplatformpollpopprepare__prepare__psycopgpsycopg._encodingspsycopg_c.pqpsycopg.pqpsycopg.pq._enumspsycopg.pq.miscptrput_copy_dataput_copy_end__pyx_capi____pyx_checksum__pyx_result__pyx_state__pyx_type__pyx_unpickle_Escaping__pyx_vtable____qualname__""__reduce____reduce_cython____reduce_ex____repr__resresetreset_pollreset_startresult_formatreturnrow_numberrvselfsend_close_portalsend_close_preparedsend_describe_portalsend_describe_preparedsend_flush_requestsend_preparesend_querysend_query_paramssend_query_preparedset_attributesset_chunked_rows_mode__set_name__set_single_row_modeset_trace_flagssetdefault__setstate____setstate_cython__sizesslstartstatestatusstrstreamsystableid__test__tracetypes_fasttypidtyplenunescape_byteauntraceupdateuse_setstateuservvalvaluesversionversion_prettyxint (PyObject *, char **, Py_ssize_t *)\000_buffer_as_string_and_size\320\0040\260\001\330\010\030\230\001\320\031*\250!\330\010\026\220a\220q\330\010'\240~\260Q\260d\270.\310\001\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\020)\250\021\250$\320.@\300\001\340\010\027\220z\240\021\240!\320\004+\2501\330\010\024\220I\230Q\230d\320\"2\260!\320\0041\260\021\330\010\026\220a\220q\340\r\016\330\014\026\220l\240!\2404\240~\260Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\020(\250\001\250\024\320-?\270q\320\004+\2501\330\010\036\230c\240\021\240!\330\010)\320)?\270|\3101\330\014\020\220\002\220!\340\010\014\210E\220\025\220a\220q\330\014\024\220L\240\001\240\021\330\014\021\220\021\220\"\220H\230E\240\021\330\014\021\220\021\220\"\220K\230u\240A\330\014\021\220\021\220\"\220L\240\005\240Q\330\014\021\220\021\220\"\220J\230e\2401\330\014\021\220\021\220\"\220I\230U\240!\330\014\021\220\021\220\"\220J\230e\2401\330\014\021\220\021\220\"\220M\240\025\240a\340\010\034\320\034-\250Q\250d\3202B\300%\300u\310A\330\010\022\220!\2201\330\010\014\210D\220\003\2201\330\014\022\220!\320\023$\240A\240Q\320\004+\2501\330\010 \240\001\340\010\026\220n\240A\240T\250\036\260q\270\014\300A\330\010\013\2107\220$\220a\330\014\022\220!\320\023$\240A\330\020.\250a\250t\3203E\300Q\330\010\013\210;\220g\230Q\330\014\023\320\023*\250!\330\030%\240Q\320&7\260|\3001\330\014\023\2208\2301\340\014\023\2208\2301\320\0042\260!\330\010\030""\230\001\320\031,\250A\330\010\026\220a\220q\330\010'\320'7\260q\270\004\270N\310!\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\020)\250\021\250$\320.@\300\001\340\010\027\220z\240\021\240!\320\0043\2601\330\010\026\220a\220q\330\010'\320'8\270\001\270\024\270^\3101\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\020,\250A\250T\3201C\3001\340\010\027\220z\240\021\240!\320\0044\260A\330\010'\320';\2701\330\014\020\220\016\320\0364\260A\330\010\013\2104\210q\330\014\022\220+\230Q\230a\330\010\027\220z\240\021\240!\320\0044\260A\330\010\026\220a\220q\330\010#\320#5\260Q\260d\270.\310\001\330\010\013\2103\210g\220Q\330\014\023\2201\340\014\023\2201\320\004\"\240!\330\010\013\2104\210}\230C\230q\330\014\022\220!\320\023$\240A\240Q\330\010\033\2308\2401\240D\250\001\330\010\013\2103\210b\220\001\330\014\022\220!\320\023$\240A\320%8\270\001\270\024\320=O\310q\330\010\017\210q\320\004\030\230\001\330\010\013\2104\210}\230G\2401\330\021\032\230!\2304\230q\330\014\020\220\017\230q\320\004\030\230\001\330\010\013\2104\320\017!\240\027\250\001\330\021 \240\001\240\024\240Q\330\014\020\320\020$\240A\320\0045\260Q\330\010\030\230\001\320\031.\250a\330\010\026\220a\220q\330\010\033\320\033-\250Q\250d\260.\300\001\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0201\260\021\260$\3206H\310\001\320\0045\260Q\330\010\026\220a\220q\330\010'\320':\270!\2704\270~\310Q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\020,\250A\250T\3201C\3001\340\010\027\220z\240\021\240!\320\004\"\240/\260\031\270!\340\010 \240\001\330\010\013\2106\220\027\230\001\330\014\023\320\023#\2401\240A\330\010\022\220-\230q\240\004\240N\260!\330\010\013\2103\210b\220\001\330\014\022\220!\320\023$\240A\330\020+\2501\250D\3200B\300!\330\010\017\210q\320\0047\260q\330\010\030\230\001\320\0310\260\001\330\010\026\220a\220q\330\010\033\320\033/\250q\260\004\260N\300!\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0201\260\021\260$\3206H\310\001""\320\0048\270\001\330\010\026\220a\220q\330\010\033\320\0330\260\001\260\024\260^\3001\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0204\260A\260T\3209K\3101\320\004\032\230!\360\014\000\t\014\2109\320\024%\240Q\240d\250!\330\014\022\220!\320\023$\240A\330\020.\250a\250t\3203E\300Q\320\004*\250(\260!\330\010\013\2109\320\024)\250\021\250$\250n\270A\330\014\022\220!\320\023$\240A\240Q\200A\33045\330\010)\250\037\270\001\270\021\330\010\013\2104\210q\330\014\022\220+\230Q\230a\340\010\025\220Z\230q\240\001\320\004$\240A\360\n\000\t\031\230\001\320\0310\260\001\330\010\033\320\033.\250a\250t\2601\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\020(\250\001\250\024\320-?\270q\320\004*\250&\260\014\270A\330\010\017\320\017#\2401\240D\320(8\270\001\200A\330\035\036\330\0101\260\037\300\001\330\010\013\2105\220\003\2201\330\014\022\220+\230Q\230a\330\010\r\320\r \240\001\240\021\330\r\034\230A\230Q\330\010\017\210q\320\004,\250A\330\010\036\320\0361\260\021\260$\3206F\300a\330\010\013\2103\210g\220Q\330\014\023\2201\340\014\023\2201\200A\340\r\016\330\014\027\220{\240!\2404\240q\330\010\013\2101\330\014\022\220(\230!\2303\230j\250\003\2509\260C\260q\330\021\033\2301\230A\330\014\023\2201\340\014\023\2201\200A\360\n\000\t\014\2104\210v\220S\230\001\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210u\220M\240\023\240A\330\014\022\220!\320\023$\240A\240Q\340\010\"\240!\2406\250\021\250%\250q\260\001\340\010\023\320\023#\2401\240D\250\005\250^\2705\300\001\330\010\013\2104\210s\220!\330\014\022\220!\320\023$\240A\330\020)\250\021\250$\250e\3203E\300Q\360\006\000\t\016\210S\220\002\220&\230\001\230\021\330\r\027\220q\230\001\330\010\017\210q\200A\360\006\000\t\014\2104\210v\220W\230A\330\014\017\210t\2205\230\r\240S\250\001\330\020\026\220a\320\027(\250\001\250\021\360\006\000\t(\320'7\260q\270\006\270a\270q\330\010\013\2104\210s\220!\330\014\022\220+\230Q\330\020:\270!\2703\270a\270q\360\006\000\t\016\210S\220\002\220!\330\r\027\220q\230\001""\330\010\017\210q\200A\360\014\000\t\014\2104\210v\220W\230E\240\024\240T\250\025\250m\2703\270a\330\014\022\220!\320\023$\240A\240Q\340\010\"\240!\2406\250\021\250%\250q\260\001\340\010\013\2104\210v\220W\230A\330\014\027\320\027)\250\021\330\020\024\220E\230\036\320'8\270\005\270X\300Q\300a\340\014\027\220~\240Q\320&7\260u\270H\300A\300Q\340\010\013\2104\210s\220!\330\014\022\220+\230Q\330\0208\270\001\270\023\270A\270Q\360\006\000\t\016\210S\220\002\220(\230\"\230A\330\r\027\220q\230\001\330\010\017\210q\200A\360\n\000\t#\240!\2406\250\021\250%\250q\260\001\340\010\013\2104\210v\220S\230\001\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210u\220M\240\023\240A\330\014\022\220!\320\023$\240A\240Q\340\010\023\320\023&\240a\240t\2505\260\016\270e\3001\330\010\013\2104\210s\220!\330\014\022\220!\320\023$\240A\330\020,\250A\250T\260\025\3206H\310\001\360\006\000\t\016\210S\220\002\220&\230\001\230\021\330\r\027\220q\230\001\330\010\017\210q\200A\360\016\000\t#\240!\2406\250\021\250%\250q\260\001\340\010\013\2104\210v\220W\230A\330\014\017\210t\2205\230\r\240S\250\001\330\020\026\220a\320\027(\250\001\250\021\340\014\026\220h\230l\250!\2507\260\"\260B\260b\270\001\330\014\033\320\033.\250a\330\020\024\220E\230\036\240y\260\005\260X\270Q\270a\340\014\017\210q\330\020\032\230!\2301\330\020\026\220a\320\027(\250\001\330\024,\250A\250T\260\025\3206H\310\001\360\010\000\r\027\220h\230l\250!\2507\260\"\260B\260b\270\001\330\014\033\230?\250!\2509\260E\270\021\340\010\r\210W\220B\220a\330\010\022\220!\2201\330\010\017\210q\320\004\034\230A\330\010(\250\014\260A\260T\270\021\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\240Q\330\010\027\220z\240\021\240!\200A\330,-\330\010\034\230A\330\0101\3201A\300\021\300*\310A\310Q\330\010\013\2105\220\003\2201\330\014\017\210w\220c\230\021\330\020\026\220k\240\021\240!\340\020\026\220a\320\027(\250\001\250\026\250w\260a\260x\270q\330\025\037\230q\240\001\330\020\026\220a\340\010\r\320\r \240\001\240\021\330\r\034\230A\230Q""\330\010\017\210q\200A\330@A\330\t\n\330\010\030\230\001\320\0312\260!\360\006\000\t\"\240\021\330\010\013\2101\330\014\024\220A\330\010\023\320\023)\250\021\250$\250n\270H\300F\310!\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\020.\250a\250t\3203E\300Q\360\006\000\t\016\210U\220!\2201\330\r\027\220q\230\001\330\010\017\210q\200A\360\006\000\027\030\330\025,\250A\330\027.\250a\330\034$\240A\330\t\n\330\010\026\220a\220q\360\016\000\t\023\220(\230)\240:\250[\3208J\310!\330\014\032\230-\240q\360\006\000\016\017\330\014\034\230M\250\021\330\020\024\220N\240)\2505\260\n\270!\330\020%\240Y\250j\270\n\300!\330\010\033\2301\230H\240I\250Z\260q\330\010\013\2109\220C\220q\330\014\022\220!\320\023$\240A\330\020*\250!\2504\320/A\300\021\330\010\027\220z\240\021\240!\200A\360\006\000\027\030\330\025,\250A\330\027.\250a\330\034$\240A\330\t\n\330\010\026\220a\220q\360\016\000\t\023\220(\230)\240:\250[\3208J\310!\330\014\032\230-\240q\360\006\000\016\017\330\014\026\320\026(\250\001\330\020\024\220N\240)\2505\260\n\270!\330\020%\240Y\250j\270\n\300!\330\010\033\2301\230H\240I\250Z\260q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0203\2601\260D\3208J\310!\200A\360\010\000\026-\250A\330\t\n\330\010\026\220a\220q\360\010\000\t#\240!\330\010\013\210<\220w\230a\330\014\031\230\037\250\001\250\035\260a\330\014\026\320\026.\250a\250q\340\010!\240\021\330\010\013\2101\330\014\025\220]\240,\250a\250x\260r\270\021\330\014\020\220\005\220U\230!\2301\330\020\026\220a\220u\230H\320$<\270A\270\\\310\021\360\006\000\016\017\330\014\026\220j\240\001\330\020\024\220N\240&\250\t\260\025\260i\270q\330\010\022\220!\2201\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\020*\250!\2504\320/A\300\021\330\010\027\220z\240\021\240!\200A\360\010\000\026-\250A\330\t\n\330\010\026\220a\220q\360\010\000\t#\240!\330\010\013\210<\220w\230a\330\014\031\230\037\250\001\250\035\260a\330\014\026\320\026.\250a\250q\340\010!\240\021\330\010\013\2101\330\014\025\220]\240,\250a""\250x\260r\270\021\330\014\020\220\005\220U\230!\2301\330\020\026\220a\220u\230H\320$<\270A\270\\\310\021\360\006\000\016\017\330\014\026\220n\240A\330\020\024\220N\240&\250\t\260\025\260i\270q\340\010\022\220!\2201\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0203\2601\260D\3208J\310!\200A\330,-\330\010\024\220G\2301\230A\320\004,\250A\330\010\024\220J\230a\230t\320#3\2601\200A\340\t\n\330\010\030\230\001\320\031-\250Q\360\006\000\t\024\320\023$\240A\240T\250\036\260v\270Q\330\010\020\220\017\230q\240\005\240S\250\n\260!\330\014\022\220!\320\023$\240A\330\020.\250a\250t\3203E\300Q\200A\330./\330\010)\250\034\260Q\260a\330\010\013\2104\210q\330\014\022\220+\230Q\230a\340\010\025\220Z\230q\240\001\320\004\034\230A\330\010-\250\\\270\021\270$\270a\330\010\013\2109\220C\220q\330\014\023\2201\330\010\027\220z\240\021\240!\200A\360\006\000\027\030\330\027.\250a\330\034$\240A\330\t\n\330\010\026\220a\220q\360\016\000\t\023\220(\230)\240:\250[\3208J\310!\330\014\032\230&\240\001\360\006\000\016\017\330\014\026\320\026*\250!\330\020\024\220N\240&\250\005\250Z\3207L\310A\330\020\032\230*\240A\330\010\033\2301\230H\240I\250Z\260q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0201\260\021\260$\3206H\310\001\200A\360\006\000\027\030\330\027.\250a\330\034$\240A\330\t\n\330\010\026\220a\220q\360\016\000\t\023\220(\230)\240:\250[\3208J\310!\330\014\032\230&\240\001\360\006\000\016\017\330\014\026\220o\240Q\330\020\024\220N\240&\250\005\250Q\330\020%\240Q\330\020\032\230*\240A\340\010\033\2301\230H\240I\250Z\260q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\330\0203\2601\260D\3208J\310!\340\010\027\220z\240\021\240!\320\004,\250A\330\010\026\220a\220q\340\r\016\330\014\034\230G\2401\240D\250\016\260a\330\010\013\2109\220C\220q\330\014\022\220!\320\023$\240A\330\020*\250!\2504\320/A\300\021\340\010\027\220z\240\021\240!\320\004$\240A\360\014\000\t\031\230\001\320\031/\250q\330\010\020\320\020#\2401\240D\250\016\260c\270\021\330\014\022\220!""\320\023$\240A\240T\320);\2701\200A\330\010\017\210s\220!\2204\220q\230\005\230\\\250\021\250$\250h\260g\270Q\270a\320\004\034\230A\330\010\017\210y\230\001\230\026\320\0370\260\001\320\004)\250\021\330\010\024\220G\2301\230D\320 0\260\001\320\004*\250!\330\010\024\220H\230A\230T\320!1\260\021\320\004\034\230H\240A\330\010\013\2103\210j\230\003\2301\330\014\022\220!\320\023%\240Q\240a\330\010\021\220\026\220q\230\010\240\001\330\r\025\220Q\220d\230.\250\001\320\004\030\230\001\340\010\034\230I\240Q\240d\250/\270\025\270g\300Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\020\"\240#\240W\250A\250X\260Q\200\001\330\004\020\220\r\230Q\320\004%\240Q\360\014\000\t\031\230\001\320\0310\260\001\330\010\020\320\020$\240A\240T\250\036\260s\270!\330\014\022\220!\320\023$\240A\240Q\320\004\035\230Q\330\010\030\230\001\320\031+\2501\330\010,\250O\2701\270D\300\001\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\240Q\330\010\033\230:\240Q\240a\200\001\330\004\n\210+\220Q\320\004\035\230Q\330\010\013\2109\220M\240\021\240$\240a\330\014\022\220!\320\023$\240A\240Q\320\004%\240Q\330\010\013\2109\320\024'\240q\250\004\250A\330\014\022\220!\320\023$\240A\240Q\200\001\360\010\000\005\016\210T\220\021\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\030\230\001\330\004\007\200q\330\010\017\320\017)\250\024\250Q\250g\260[\300\007\300q\340\010\017\320\017)\250\024\250Q\250g\260[\300\001\320\004*\250!\330\010\035\230X\240Q\240d\320*:\270!\330\010\013\2103\210g\220Q\330\014\023\2201\340\014\023\2201\320\004%\240Z\250q\330\010\030\230\001\320\031,\250A\330\r\035\230Q\230d\240.\260\001\320\004>\270a\330\010\030\230\001\330\010\030\230\001\330\010\037\230|\2501\250D\3200@\300\006\300a\340\010\013\2101\330\014\025\220[\240\001\240\024\320%5\260V\2701\340\014\023\2201\220B\220a\340\014\024\220L\240\001\240\024\320%5\260V\2701\330\020\027\220q\340\020\027\220q\320\004&\240a\330\010\013\2104\320\017!\240\023""\240A\330\014\022\220!\320\023$\240A\240Q\320\004\026\220a\330\010\013\2104\210~\230W\240A\330\021\036\230a\230t\2401\330\014\020\320\020 \240\001\320\004.\250a\330\010\024\220L\240\001\240\024\320%5\260Q\320\004\026\220a\330\010\014\320\014!\240\021\330\010\024\220M\240\021\240$\240a\320\004\036\230a\330\010\017\210y\230\001\230\026\320\0370\260\001\320\004:\270!\330\010\026\220a\220q\330\010\033\320\0332\260!\2604\260~\300Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0204\260A\260T\3209K\3101\200\001\330\004&\240a\240v\250Q\320\004\031\230\021\340\r\016\330\014\026\220i\230q\240\004\240A\330\010\017\210q\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\2208\2308\2401\240A\330\004\007\200|\2207\230!\330\010*\250!\250;\260n\300A\330\004\013\2101\320\004\027\220q\330\010\014\320\014!\240\021\330\r\033\2301\230D\240\001\320\004*\250&\260\007\260q\330\010\017\320\017#\2401\240D\320(8\270\t\300\023\300D\310\001\320\004\037\230q\360\014\000\t\031\230\001\320\031+\2501\330\010\022\220/\240\021\240$\240a\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\240Q\320\004\037\230q\330\010\013\2102\210X\220_\240A\240T\250\021\330\014\022\220!\320\023$\240A\330\020*\250!\2504\320/A\300\021\320\004\027\220q\330\010\013\2104\210\177\230g\240Q\330\021\031\230\021\230$\230a\330\014\020\320\020!\240\021\320\004'\240q\360\n\000\t#\240!\2408\2501\250I\260Q\260a\330\010\022\220.\240\001\240\024\240^\2609\270E\300\021\330\010\013\2103\210b\220\001\330\014\022\220!\320\023$\240A\330\020,\250A\250T\3201C\3001\330\010\017\210q\320\004\027\220q\360\014\000\t\014\2109\220N\240!\2404\240q\330\014\022\220!\320\023$\240A\330\020.\250a\250t\3203E\300Q\320\004\031\230\021\330\r\027\220q\230\004\230A\320\004\027\220q\330\010\026\220a\220q\330\r\025\220Q\220d\230!";
    PyObject *data = NULL;
    CYTHON_UNUSED_VAR(__Pyx_DecompressString);
    #endif
    PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
    Py_ssize_t pos = 0;
    for (int i = 0; i < 440; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 95) PyUnicode_InternInPlace(&string);
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
      stringtab[i] = string;
      pos += bytes_length;
    }
    for (int i = 440; i < 522; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
      stringtab[i] = string;
      pos += bytes_length;
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    Py_XDECREF(data);
    for (Py_ssize_t i = 0; i < 522; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 440;
      for (Py_ssize_t i=0; i<82; ++i) {
        #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
        #else
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
        #endif
      }
    }
    #endif
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
    int32_t const cint_constants_4[] = {8405287L};
    for (int i = 0; i < 1; i++) {
      numbertab[i] = PyLong_FromLong(cint_constants_4[i - 0]);
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_number_tab;
    for (Py_ssize_t i=0; i<1; ++i) {
      #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
      #else
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
typedef struct {
    unsigned int argcount : 3;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 1;
    unsigned int nlocals : 4;
    unsigned int flags : 10;
    unsigned int first_line : 10;
} __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 19};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pyx, __pyx_mstate->__pyx_n_u_version, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 72};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_pgconn};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_connect, __pyx_mstate->__pyx_kp_b_iso88591_A_Qa_4q_Qa_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 80};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_pgconn};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_connect_start, __pyx_mstate->__pyx_kp_b_iso88591_A45_4q_Qa_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 88};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_connect_poll, __pyx_mstate->__pyx_kp_b_iso88591_a_y_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 91};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_finish, __pyx_mstate->__pyx_kp_b_iso88591_4_G1_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 113};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_aq_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 117};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_reset_start, __pyx_mstate->__pyx_kp_b_iso88591_Q_9M_a_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 121};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_reset_poll, __pyx_mstate->__pyx_kp_b_iso88591_A_y_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 124};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_conninfo};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_ping, __pyx_mstate->__pyx_kp_b_iso88591_A_G1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 172};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_parameter_status, __pyx_mstate->__pyx_kp_b_iso88591_4A_aq_5Qd_3gQ_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 184};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_encoding};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_get_error_message, __pyx_mstate->__pyx_kp_b_iso88591_q_1D_8_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 240};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_pgresult};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_exec, __pyx_mstate->__pyx_kp_b_iso88591_A_aq_G1D_a_9Cq_A_4_A_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 251};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_query, __pyx_mstate->__pyx_kp_b_iso88591_1_aq_l_4_Q_4q_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 260};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_param_values, __pyx_mstate->__pyx_n_u_param_types, __pyx_mstate->__pyx_n_u_param_formats, __pyx_mstate->__pyx_n_u_result_format, __pyx_mstate->__pyx_n_u_cnparams, __pyx_mstate->__pyx_n_u_ctypes, __pyx_mstate->__pyx_n_u_cvalues, __pyx_mstate->__pyx_n_u_clengths, __pyx_mstate->__pyx_n_u_cformats, __pyx_mstate->__pyx_n_u_pgresult};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_exec_params, __pyx_mstate->__pyx_kp_b_iso88591_A_A_a_A_aq_8J_q_M_N_5_Yj_1HIZq_9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 289};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_param_values, __pyx_mstate->__pyx_n_u_param_types, __pyx_mstate->__pyx_n_u_param_formats, __pyx_mstate->__pyx_n_u_result_format, __pyx_mstate->__pyx_n_u_cnparams, __pyx_mstate->__pyx_n_u_ctypes, __pyx_mstate->__pyx_n_u_cvalues, __pyx_mstate->__pyx_n_u_clengths, __pyx_mstate->__pyx_n_u_cformats, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_query_params, __pyx_mstate->__pyx_kp_b_iso88591_A_A_a_A_aq_8J_q_N_5_Yj_1HIZq_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 318};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_param_types, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_types_fast, __pyx_mstate->__pyx_n_u_nparams, __pyx_mstate->__pyx_n_u_atypes, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_prepare, __pyx_mstate->__pyx_kp_b_iso88591_A_A_aq_wa_a_aq_1_axr_U_1_auH_A_n, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 350};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_param_values, __pyx_mstate->__pyx_n_u_param_formats, __pyx_mstate->__pyx_n_u_result_format, __pyx_mstate->__pyx_n_u_cnparams, __pyx_mstate->__pyx_n_u_ctypes, __pyx_mstate->__pyx_n_u_cvalues, __pyx_mstate->__pyx_n_u_clengths, __pyx_mstate->__pyx_n_u_cformats, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_query_prepared, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_aq_8J_N_Z7LA_A_1HIZq_4q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 378};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_param_types, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_types_fast, __pyx_mstate->__pyx_n_u_nparams, __pyx_mstate->__pyx_n_u_atypes, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_prepare, __pyx_mstate->__pyx_kp_b_iso88591_A_A_aq_wa_a_aq_1_axr_U_1_auH_A_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 409};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_param_values, __pyx_mstate->__pyx_n_u_param_formats, __pyx_mstate->__pyx_n_u_result_format, __pyx_mstate->__pyx_n_u_cnparams, __pyx_mstate->__pyx_n_u_ctypes, __pyx_mstate->__pyx_n_u_cvalues, __pyx_mstate->__pyx_n_u_clengths, __pyx_mstate->__pyx_n_u_cformats, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_exec_prepared, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_aq_8J_oQ_N_Q_Q_A_1HIZq_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 440};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_describe_prepared, __pyx_mstate->__pyx_kp_b_iso88591_5Q_aq_4_Q_3c_A_AT1C1_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 449};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_describe_prepared, __pyx_mstate->__pyx_kp_b_iso88591_aq_2_4_Q_4q_A_4AT9K1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 457};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_describe_portal, __pyx_mstate->__pyx_kp_b_iso88591_31_aq_8_1_3c_A_AT1C1_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 466};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_describe_portal, __pyx_mstate->__pyx_kp_b_iso88591_8_aq_0_1_4q_A_4AT9K1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 474};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_close_prepared, __pyx_mstate->__pyx_kp_b_iso88591_2_A_aq_7q_N_3c_A_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 484};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_close_prepared, __pyx_mstate->__pyx_kp_b_iso88591_7q_0_aq_q_N_4q_A_1_6H, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 493};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_close_portal, __pyx_mstate->__pyx_kp_b_iso88591_0_aq_Qd_3c_A_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 503};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_close_portal, __pyx_mstate->__pyx_kp_b_iso88591_5Q_a_aq_Qd_4q_A_1_6H, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 512};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pgresult};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_get_result, __pyx_mstate->__pyx_kp_b_iso88591_A_a_9Cq_1_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 518};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_consume_input, __pyx_mstate->__pyx_kp_b_iso88591_q_2X_AT_A_4_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 523};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_is_busy, __pyx_mstate->__pyx_kp_b_iso88591_iq_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 539};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_flush, __pyx_mstate->__pyx_kp_b_iso88591_4_Cq_AQ_81D_3b_A_8_Oq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 547};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_set_single_row_mode, __pyx_mstate->__pyx_kp_b_iso88591_Q_9_q_A_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 551};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_set_chunked_rows_mode, __pyx_mstate->__pyx_kp_b_iso88591_9_nA_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 555};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ptr};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_cancel_conn, __pyx_mstate->__pyx_kp_b_iso88591_Q_1_O1D_4q_AQ_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 562};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ptr};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_get_cancel, __pyx_mstate->__pyx_kp_b_iso88591_A_AT_4q_AQ_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 568};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_notifies, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_1_3j_9Cq_1A_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 579};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_rv, __pyx_mstate->__pyx_n_u_cbuffer, __pyx_mstate->__pyx_n_u_length};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_put_copy_data, __pyx_mstate->__pyx_kp_b_iso88591_q_81IQa_9E_3b_A_AT1C1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 591};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_error, __pyx_mstate->__pyx_n_u_rv, __pyx_mstate->__pyx_n_u_cerr};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_put_copy_end, __pyx_mstate->__pyx_kp_b_iso88591_6_1A_q_N_3b_A_1D0B_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 602};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_async, __pyx_mstate->__pyx_n_u_async, __pyx_mstate->__pyx_n_u_buffer_ptr, __pyx_mstate->__pyx_n_u_nbytes, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_get_copy_data, __pyx_mstate->__pyx_kp_b_iso88591_1_nAT_q_A_7_a_A_at3EQ_gQ_Q_7_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 616};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fileno, __pyx_mstate->__pyx_n_u_stream};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_trace, __pyx_mstate->__pyx_kp_b_iso88591_HA_3j_1_Qa_q_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 622};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flags};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_set_trace_flags, __pyx_mstate->__pyx_kp_b_iso88591_Zq_A_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 626};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_untrace, __pyx_mstate->__pyx_kp_b_iso88591_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 629};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_passwd, __pyx_mstate->__pyx_n_u_user, __pyx_mstate->__pyx_n_u_algorithm, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_calgo, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_encrypt_password, __pyx_mstate->__pyx_kp_b_iso88591_A_A_2_1_A_nHF_4q_A_at3EQ_U_1_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 648};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_user, __pyx_mstate->__pyx_n_u_passwd, __pyx_mstate->__pyx_n_u_res};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_change_password, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_AT_vQ_q_S_A_at3EQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 660};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exec_status, __pyx_mstate->__pyx_n_u_exec_status, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_make_empty_result, __pyx_mstate->__pyx_kp_b_iso88591_4A_1_4A_4q_Qa_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 678};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_enter_pipeline_mode, __pyx_mstate->__pyx_kp_b_iso88591_Q_0_AT_s_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 688};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_exit_pipeline_mode, __pyx_mstate->__pyx_kp_b_iso88591_A_q_1D_c_AT_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 698};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_pipeline_sync, __pyx_mstate->__pyx_kp_b_iso88591_q_1_a_3c_AQ_3c_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 711};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgconn_pyx, __pyx_mstate->__pyx_n_u_send_flush_request, __pyx_mstate->__pyx_kp_b_iso88591_A_0_at1_3c_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 33};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_clear, __pyx_mstate->__pyx_kp_b_iso88591_q_4_gQ_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_encoding};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_get_error_message, __pyx_mstate->__pyx_kp_b_iso88591_A_1D_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 56};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldcode, __pyx_mstate->__pyx_n_u_fieldcode, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_error_field, __pyx_mstate->__pyx_kp_b_iso88591_A_1_6Fa_3gQ_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 71};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_fname, __pyx_mstate->__pyx_kp_b_iso88591_XQd_3gQ_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 78};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_ftable, __pyx_mstate->__pyx_kp_b_iso88591_1_IQd_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 81};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_ftablecol, __pyx_mstate->__pyx_kp_b_iso88591_a_L_5Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 84};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_fformat, __pyx_mstate->__pyx_kp_b_iso88591_A_Jat_31, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 87};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_ftype, __pyx_mstate->__pyx_kp_b_iso88591_HAT_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 90};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_fmod, __pyx_mstate->__pyx_kp_b_iso88591_G1D_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 93};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_column_number};
    __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_fsize, __pyx_mstate->__pyx_kp_b_iso88591_HAT_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 100};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row_number, __pyx_mstate->__pyx_n_u_column_number, __pyx_mstate->__pyx_n_u_crow, __pyx_mstate->__pyx_n_u_ccol, __pyx_mstate->__pyx_n_u_length, __pyx_mstate->__pyx_n_u_v};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_get_value, __pyx_mstate->__pyx_kp_b_iso88591_a_1D0_a_1_5V1_1Ba_L_5V1_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 119};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_param_number, __pyx_mstate->__pyx_n_u_param_number};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_param_type, __pyx_mstate->__pyx_kp_b_iso88591_a_L_5Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 142};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_descriptions, __pyx_mstate->__pyx_n_u_num, __pyx_mstate->__pyx_n_u_attrs, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_descr, __pyx_mstate->__pyx_n_u_res};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgresult_pyx, __pyx_mstate->__pyx_n_u_set_attributes, __pyx_mstate->__pyx_kp_b_iso88591_1_c_1_E_aq_L_HE_KuA_L_Q_Je1_IU, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_kp_b_iso88591_q_9N_4q_A_at3EQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 32};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_blocking, __pyx_mstate->__pyx_kp_b_iso88591_9_Qd_A_at3EQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 43};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_poll, __pyx_mstate->__pyx_kp_b_iso88591_a_M_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 62};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_encoding};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_get_error_message, __pyx_mstate->__pyx_kp_b_iso88591_A_1D_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 65};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 69};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_finish, __pyx_mstate->__pyx_kp_b_iso88591_4_Q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 74};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_ensure_pgcancelconn, __pyx_mstate->__pyx_kp_b_iso88591_a_4_A_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 92};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_free, __pyx_mstate->__pyx_kp_b_iso88591_a_4_WA_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 97};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_res};
    __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_pgcancel_pyx, __pyx_mstate->__pyx_n_u_cancel, __pyx_mstate->__pyx_kp_b_iso88591_IQd_gQ_4q_A_WAXQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[78] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[78])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_opts, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_conninfo_pyx, __pyx_mstate->__pyx_n_u_get_defaults, __pyx_mstate->__pyx_kp_b_iso88591_A_1_5_1_Qa_AQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_conninfo, __pyx_mstate->__pyx_n_u_errmsg, __pyx_mstate->__pyx_n_u_opts, __pyx_mstate->__pyx_n_u_exc, __pyx_mstate->__pyx_n_u_rv};
    __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_conninfo_pyx, __pyx_mstate->__pyx_n_u_parse, __pyx_mstate->__pyx_kp_b_iso88591_A_A_11A_AQ_5_1_wc_k_a_waxq_q_a_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_conninfo_pyx, __pyx_mstate->__pyx_n_u_repr, __pyx_mstate->__pyx_kp_b_iso88591_A_s_4q_hgQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_escaping_pyx, __pyx_mstate->__pyx_n_u_escape_literal, __pyx_mstate->__pyx_kp_b_iso88591_A_4vS_AQ_4uM_A_AQ_6_q_1D_5_4s_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 37};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_escaping_pyx, __pyx_mstate->__pyx_n_u_escape_identifier, __pyx_mstate->__pyx_kp_b_iso88591_A_6_q_4vS_AQ_4uM_A_AQ_at5_e1_4s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 59};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_escaping_pyx, __pyx_mstate->__pyx_n_u_escape_string, __pyx_mstate->__pyx_kp_b_iso88591_A_6_q_4vWA_t5_S_a_hl_7_Bb_a_E_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 90};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_escaping_pyx, __pyx_mstate->__pyx_n_u_escape_bytea, __pyx_mstate->__pyx_kp_b_iso88591_A_4vWE_T_m3a_AQ_6_q_4vWA_E_8_XQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[86] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_psycopg_c_pq_escaping_pyx, __pyx_mstate->__pyx_n_u_unescape_bytea, __pyx_mstate->__pyx_kp_b_iso88591_A_4vWA_t5_S_a_7q_aq_4s_Q_3aq_S_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[86])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[87] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_G1F_a_vWE_Q_q_q_Qg_q_Qg, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[87])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[88] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_avQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[88])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[89] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[89])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[90] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[90])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[91] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[91])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[92] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[92])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[93] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_pyx_unpickle_Escaping, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_881A_7_nA_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[93])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CommonTypesMetaclass.init */
  if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CythonFunctionShared.init */
  if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _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 (used by PyObjectGetAttrStrNoError) */
#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);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    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) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    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);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *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
}
#endif

/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
#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);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    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;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* TupleAndListFromArray (used by fastcall) */
#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
        Py_INCREF(src[i]);
    }
    return res;
}
#elif 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) {
        return __Pyx_NewRef(__pyx_mstate_global->__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 (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    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 (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    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 (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            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));
            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_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    return (equals == Py_EQ);
return_ne:
    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 = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* PyDictVersioning (used by GetModuleGlobalName) */
#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_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyObjectCall (used by PyObjectFastCall) */
#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(" 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 (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall(" 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 (used by PyObjectCallOneArg) */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    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]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
          #if CYTHON_COMPILING_IN_LIMITED_API
            return PyObject_Vectorcall(func, args, _nargs, NULL);
          #else
            vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
            if (f) {
                return f(func, args, _nargs, NULL);
            }
          #endif
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* 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);
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, 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;
    if (max_char > 1114111) max_char = 1114111;
    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);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        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 (ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON || 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
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
        Py_INCREF(values[i]);
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* RaiseException */
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 PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
#elif CYTHON_FAST_THREAD_STATE
        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);
        }
#else
        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);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}

/* 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);
}

/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod0 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        if (likely(cfunc->flag == METH_NOARGS))
            return __Pyx_CallCFunction(cfunc, self, NULL);
        if (likely(cfunc->flag == METH_FASTCALL))
            return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
        if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
            return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
        if (cfunc->flag == METH_VARARGS)
            return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
        return __Pyx__CallUnboundCMethod0(cfunc, self);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *result;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
    result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
    return result;
}

/* py_dict_items (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
}

/* py_dict_values (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
}

/* OwnedDictNext (used by RejectKeywords) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
    PyObject *next = NULL;
    if (!*ppos) {
        if (pvalue) {
            PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
            if (unlikely(!dictview)) goto bad;
            *ppos = PyObject_GetIter(dictview);
            Py_DECREF(dictview);
        } else {
            *ppos = PyObject_GetIter(p);
        }
        if (unlikely(!*ppos)) goto bad;
    }
    next = PyIter_Next(*ppos);
    if (!next) {
        if (PyErr_Occurred()) goto bad;
        return 0;
    }
    if (pkey && pvalue) {
        *pkey = __Pyx_PySequence_ITEM(next, 0);
        if (unlikely(*pkey)) goto bad;
        *pvalue = __Pyx_PySequence_ITEM(next, 1);
        if (unlikely(*pvalue)) goto bad;
        Py_DECREF(next);
    } else if (pkey) {
        *pkey = next;
    } else {
        assert(pvalue);
        *pvalue = next;
    }
    return 1;
  bad:
    Py_XDECREF(next);
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
    PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
#else
    PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
#endif
    if (pkey) *pkey = NULL;
    if (pvalue) *pvalue = NULL;
    return 0;
}
#else // !CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
    int result = PyDict_Next(p, ppos, pkey, pvalue);
    if (likely(result == 1)) {
        if (pkey) Py_INCREF(*pkey);
        if (pvalue) Py_INCREF(*pvalue);
    }
    return result;
}
#endif

/* RejectKeywords */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *pos = NULL;
#else
        Py_ssize_t pos = 0;
#endif
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
#if CYTHON_AVOID_BORROWED_REFS
        Py_XDECREF(pos);
#endif
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* 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
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
    else state = (PyGILState_STATE)0;
    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(0);
    }
    ctx = PyUnicode_FromString(name);
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
    if (nogil)
        PyGILState_Release(state);
}

/* 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))) {
        _PyUnicodeWriter_Init(&writer);
        ret = _PyFloat_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else if (likely(PyLong_CheckExact(obj))) {
        _PyUnicodeWriter_Init(&writer);
        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

/* pybuiltin_invalid (used by pyint_simplify) */
static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *type_name, const char *argname) {
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    if (argname) {
        PyErr_Format(PyExc_TypeError,
            "Argument '%.200s' has incorrect type (expected %.200s, got " __Pyx_FMT_TYPENAME ")",
            argname, type_name, obj_type_name
        );
    } else {
        PyErr_Format(PyExc_TypeError,
            "Expected %.200s, got " __Pyx_FMT_TYPENAME,
            type_name, obj_type_name
        );
    }
    __Pyx_DECREF_TypeName(obj_type_name);
}

/* pyint_simplify */
static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none) {
    PyObject *number = *number_var;
    if (likely((accept_none && number == Py_None) || PyLong_CheckExact(number))) {
        return 0;
    }
    PyObject *int_object;
    if (likely(PyNumber_Check(number))) {
        int_object = PyNumber_Long(number);
        if (unlikely(!int_object)) goto bad;
    } else {
        __Pyx_PyBuiltin_Invalid(number, "int", argname);
        goto bad;
    }
    *number_var = int_object;
    Py_DECREF(number);
    return 0;
bad:
    *number_var = NULL;
    Py_DECREF(number);
    return -1;
}

/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywordsImpl (used by ParseKeywords) */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    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;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos = NULL;
    #else
    Py_ssize_t pos = 0;
    #endif
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (
        #if CYTHON_AVOID_BORROWED_REFS
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL)
        #else
        PyDict_Next(kwds, &pos, &key, NULL)
        #endif
    ) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        #endif
    }
    __Pyx_END_CRITICAL_SECTION();
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(pos);
    #endif
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}

/* ParseKeywords */
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

/* ArgTypeTestFunc (used by ArgTypeTest) */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(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;
}

/* RaiseUnboundLocalError */
static void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* 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_GetFullyQualifiedName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetFullyQualifiedName(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 (used by SaveResetException) */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
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 = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C0000
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
  #else
    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;
  #endif
#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000
    local_value = PyErr_GetRaisedException();
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
#if __PYX_LIMITED_VERSION_HEX > 0x030C0000
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
#else
    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 (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000
    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);
#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    PyErr_SetHandledException(local_value);
    Py_XDECREF(local_value);
    Py_XDECREF(local_type);
    Py_XDECREF(local_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
#endif
}

/* 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);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #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

/* CIntToDigits (used by CIntToPyUnicode) */
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 (used by COrdinalToPyUnicode) */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const 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;
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
    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 = PySequence_Repeat(padding, uoffset - prepend_sign);
                    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 = PyUnicode_Concat(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyUnicode_Concat(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* COrdinalToPyUnicode (used by CIntToPyUnicode) */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
    return value <= 1114111;
}
static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
    Py_ssize_t padding_length = ulength - 1;
    if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
        char chars[256];
        if (value <= 255) {
            memset(chars, padding_char, (size_t) padding_length);
            chars[ulength-1] = (char) value;
            return PyUnicode_DecodeLatin1(chars, ulength, NULL);
        }
        char *cpos = chars + sizeof(chars);
        if (value < 0x800) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xc0 | (value & 0x1f));
        } else if (value < 0x10000) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xe0 | (value & 0x0f));
        } else {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xf0 | (value & 0x07));
        }
        cpos -= padding_length;
        memset(cpos, padding_char, (size_t) padding_length);
        return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
    }
    if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
        const char chars[1] = {(char) value};
        return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
    }
    {
        PyObject *uchar, *padding_uchar, *padding, *result;
        padding_uchar = PyUnicode_FromOrdinal(padding_char);
        if (unlikely(!padding_uchar)) return NULL;
        padding = PySequence_Repeat(padding_uchar, padding_length);
        Py_DECREF(padding_uchar);
        if (unlikely(!padding)) return NULL;
        uchar = PyUnicode_FromOrdinal(value);
        if (unlikely(!uchar)) {
            Py_DECREF(padding);
            return NULL;
        }
        result = PyUnicode_Concat(padding, uchar);
        Py_DECREF(padding);
        Py_DECREF(uchar);
        return result;
    }
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char) {
#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 (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____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);
}

/* 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,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) {
        return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared);
    } else
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE && 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)))) {
        return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) {
            return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared);
        } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            return __Pyx_NewRef(PyList_GET_ITEM(o, n));
        }
    } else
    #if !CYTHON_AVOID_BORROWED_REFS
    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)))) {
            return __Pyx_NewRef(PyTuple_GET_ITEM(o, n));
        }
    } else
    #endif
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_subscript) {
            PyObject *r, *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (is_list || 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 || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
}

/* 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_mstate_global->__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);
    }
}

/* PyObjectVectorCallKwBuilder */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    Py_INCREF(key);
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
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;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_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);
#endif
}

/* AllocateExtensionType */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
    if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
        allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
        return alloc_func(t, 0);
    } else {
        newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (!tp_new) {
            PyObject *new_str = PyUnicode_FromString("__new__");
            if (likely(new_str)) {
                PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
                Py_DECREF(new_str);
                return o;
            } else
                return NULL;
        } else
    #endif
        return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
    }
}

/* CallTypeTraverse */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* FunctionExport */
static int __Pyx_ExportFunction(PyObject *api_dict, const char *name, void (*f)(void), const char *sig) {
    PyObject *cobj;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    tmp.fp = f;
    cobj = PyCapsule_New(tmp.p, sig, 0);
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(api_dict, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    return 0;
bad:
    Py_XDECREF(cobj);
    return -1;
}

/* GetApiDict */
static PyObject *__Pyx_ApiExport_GetApiDict(void) {
    PyObject *d;
    if (__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_capi, &d) == -1)
        return NULL;
    if (!d) {
        d = PyDict_New();
        if (!d)
            goto bad;
        if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_pyx_capi, d) < 0)
            goto bad;
    }
    return d;
bad:
    Py_XDECREF(d);
    return NULL;
}

/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* SetItemOnTypeDict (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* FixUpExtensionType */
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#else
    const PyType_Slot *slot = spec->slots;
    int changed = 0;
#if !CYTHON_COMPILING_IN_LIMITED_API
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
#if !CYTHON_COMPILING_IN_CPYTHON
        const
#endif  // !CYTHON_COMPILING_IN_CPYTHON)
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
                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);
                    type->tp_vectorcall_offset = memb->offset;
                    changed = 1;
                }
#endif  // CYTHON_METH_FASTCALL
#if !CYTHON_COMPILING_IN_PYPY
                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;
                    int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                    Py_DECREF(descr);
                    if (unlikely(set_item_result < 0)) {
                        return -1;
                    }
                    changed = 1;
                }
#endif  // !CYTHON_COMPILING_IN_PYPY
            }
            memb++;
        }
    }
#endif  // !CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_COMPILING_IN_PYPY
    slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_getset)
        slot++;
    if (slot && slot->slot == Py_tp_getset) {
        PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
        while (getset && getset->name) {
            if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
                PyObject *descr = PyDescr_NewGetSet(type, getset);
                if (unlikely(!descr))
                    return -1;
                #if CYTHON_COMPILING_IN_LIMITED_API
                PyObject *pyname = PyUnicode_FromString(getset->name);
                if (unlikely(!pyname)) {
                    Py_DECREF(descr);
                    return -1;
                }
                int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
                Py_DECREF(pyname);
                #else
                CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
                int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                #endif
                Py_DECREF(descr);
                if (unlikely(set_item_result < 0)) {
                    return -1;
                }
                changed = 1;
            }
            ++getset;
        }
    }
#else
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#endif  // !CYTHON_COMPILING_IN_PYPY
    if (changed)
        PyType_Modified(type);
#endif  // PY_VERSION_HEX > 0x030900B1
    return 0;
}

/* PyObjectCallNoArg (used by PyObjectCallMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod (used by PyObjectCallMethod0) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
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))
#else
        #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
#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_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __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;
}
#endif

/* PyObjectCallMethod0 (used by PyType_Ready) */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[1] = {obj};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_CallNoArg;
    return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    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;
#endif
}

/* ValidateBasesTuple (used by PyType_Ready) */
#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;
#if CYTHON_ASSUME_SAFE_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(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);
                }
#if !CYTHON_USE_TYPE_SLOTS
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || 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;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    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 !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 (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__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_mstate_global->__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;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if !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_mstate_global->__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
}

/* 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_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable (used by MergeVTables) */
static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_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 */
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i=0;
    Py_ssize_t size;
    void** base_vtables;
    __Pyx_TypeName tp_base_name = NULL;
    __Pyx_TypeName base_name = NULL;
    void* unknown = (void*)-1;
    PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
    int base_depth = 0;
    {
        PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        while (base) {
            base_depth += 1;
            base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
        }
    }
    base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
#if CYTHON_COMPILING_IN_LIMITED_API
    size = PyTuple_Size(bases);
    if (size < 0) goto other_failure;
#else
    size = PyTuple_GET_SIZE(bases);
#endif
    for (i = 1; i < size; i++) {
        PyObject *basei;
        void* base_vtable;
#if CYTHON_AVOID_BORROWED_REFS
        basei = PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#else
        basei = PyTuple_GET_ITEM(bases, i);
#endif
        base_vtable = __Pyx_GetVtable((PyTypeObject*)basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
            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 = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
            }
        }
    }
    PyErr_Clear();
    PyMem_Free(base_vtables);
    return 0;
bad:
    {
        PyTypeObject* basei = NULL;
        PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base);
#if CYTHON_AVOID_BORROWED_REFS
        basei = (PyTypeObject*)PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#else
        basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
#endif
        base_name = __Pyx_PyType_GetFullyQualifiedName(basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
    }
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
really_bad: // bad has failed!
#endif
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
other_failure:
#endif
    PyMem_Free(base_vtables);
    return -1;
}

/* DelItemOnTypeDict (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_DelItem(tp_dict, k);
    if (likely(!result)) PyType_Modified(tp);
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (likely(reduce_cython)) {
                ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_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_GetFullyQualifiedName((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;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_2_2
#define __PYX_HAVE_RT_ImportType_3_2_2
static PyTypeObject *__Pyx_ImportType_3_2_2(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_2 check_size)
{
    PyObject *result = 0;
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && 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 !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    if (size == 0) {
        return (PyTypeObject *)result;
    }
    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_3_2_2 &&
            ((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_3_2_2 && (size_t)basicsize > size) {
        if (PyErr_WarnFormat(NULL, 0,
                "%.200s.%.200s size changed, may indicate binary incompatibility. "
                "Expected %zd from C header, got %zd from PyObject",
                module_name, class_name, size, basicsize) < 0) {
            goto bad;
        }
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* HasAttr (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* ImportImpl (used by Import) */
static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
    PyObject *imported_module = PyImport_GetModule(qualname);
    if (unlikely(!imported_module)) {
        *module = NULL;
        if (PyErr_Occurred()) {
            return -1;
        }
        return 0;
    }
    *module = imported_module;
    return 1;
}
static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
    PyObject *imported_module;
    PyObject *top_level_package_name;
    Py_ssize_t i;
    int status, module_found;
    Py_ssize_t dot_index;
    module_found = __Pyx__Import_GetModule(qualname, &imported_module);
    if (unlikely(!module_found || module_found == -1)) {
        *module = NULL;
        return module_found;
    }
    if (imported_names) {
        for (i = 0; i < len_imported_names; i++) {
            PyObject *imported_name = imported_names[i];
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
            int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
#else
            int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
            if (unlikely(has_imported_attribute == -1)) goto error;
#endif
            if (!has_imported_attribute) {
                goto not_found;
            }
        }
        *module = imported_module;
        return 1;
    }
    dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
    if (dot_index == -1) {
        *module = imported_module;
        return 1;
    }
    if (unlikely(dot_index == -2)) goto error;
    top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
    if (unlikely(!top_level_package_name)) goto error;
    Py_DECREF(imported_module);
    status = __Pyx__Import_GetModule(top_level_package_name, module);
    Py_DECREF(top_level_package_name);
    return status;
error:
    Py_DECREF(imported_module);
    *module = NULL;
    return -1;
not_found:
    Py_DECREF(imported_module);
    *module = NULL;
    return 0;
}
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *from_list = 0;
    int module_found;
    if (!qualname) {
        qualname = name;
    }
    module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
    if (likely(module_found == 1)) {
        return module;
    } else if (unlikely(module_found == -1)) {
        return NULL;
    }
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (imported_names) {
#if CYTHON_COMPILING_IN_CPYTHON
        from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
        if (unlikely(!from_list))
            goto bad;
#else
        from_list = PyList_New(len_imported_names);
        if (unlikely(!from_list)) goto bad;
        for (Py_ssize_t i=0; i<len_imported_names; ++i) {
            if (PyList_SetItem(from_list, i, __Pyx_NewRef(imported_names[i])) < 0) goto bad;
        }
#endif
    }
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, moddict, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, moddict, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(from_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
    return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
}

/* 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_mstate_global->__pyx_kp_u_);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                CYTHON_COMPILING_IN_GRAAL
        {
            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, "cannot import name %S", name);
    }
    return value;
}

/* dict_setdefault (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
    PyObject* value;
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[] = {d, key, default_value};
    value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
#elif PY_VERSION_HEX >= 0x030d0000
    PyDict_SetDefaultRef(d, key, default_value, &value);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* AddModuleRef (used by FetchSharedCythonModule) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
      PyObject *module_dict = PyImport_GetModuleDict();
      PyObject *m;
      if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
          return NULL;
      }
      if (m != NULL && PyModule_Check(m)) {
          return m;
      }
      Py_XDECREF(m);
      m = PyModule_NewObject(name);
      if (m == NULL)
          return NULL;
      if (PyDict_CheckExact(module_dict)) {
          PyObject *new_m;
          (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
          Py_DECREF(m);
          return new_m;
      } else {
           if (PyObject_SetItem(module_dict, name, m) != 0) {
                Py_DECREF(m);
                return NULL;
            }
            return m;
      }
  }
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *py_name = PyUnicode_FromString(name);
      if (!py_name) return NULL;
      PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
      Py_DECREF(py_name);
      return module;
  }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif

/* FetchSharedCythonModule (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* FetchCommonType (used by CommonTypesMetaclass) */
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
    Py_INCREF((PyObject*)metaclass);
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        Py_SET_TYPE(result, metaclass);
#else
        result->ob_type = metaclass;
#endif
        Py_DECREF(old_tp);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    cached_type = __Pyx_PyType_FromMetaclass(
        metaclass,
        CYTHON_USE_MODULE_STATE ? module : 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;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CommonTypesMetaclass (used by CythonFunctionShared) */
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
    return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
}
#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
    PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
    return NULL;
}
static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
    PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
    return -1;
}
#endif
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
    {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
    {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
    #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
    #endif
    {0, 0}
};
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
    __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
    0,
    0,
    Py_TPFLAGS_IMMUTABLETYPE |
    Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT,
    __pyx_CommonTypesMetaclass_slots
};
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    PyObject *bases = PyTuple_Pack(1, &PyType_Type);
    if (unlikely(!bases)) {
        return -1;
    }
    mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
    Py_DECREF(bases);
    if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
        return -1;
    }
    return 0;
}

/* PyMethodNew (used by CythonFunctionShared) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *result;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    {
        PyObject *args[] = {func, self};
        result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
    }
    #else
    result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
    #endif
    return result;
}
#else
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);
}
#endif

/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
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;
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos;
    #else
    Py_ssize_t pos;
    #endif
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    #if !CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t nkw = PyDict_Size(kw);
    if (unlikely(nkw == -1)) return NULL;
    #else
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    #endif
    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 = 0;
    i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
        keys_are_strings &=
        #if CYTHON_COMPILING_IN_LIMITED_API
            PyType_GetFlags(Py_TYPE(key));
        #else
            Py_TYPE(key)->tp_flags;
        #endif
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
        #else
        PyTuple_SET_ITEM(kwnames, i, key);
        #endif
        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:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(pos);
    #endif
    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)
{
    Py_ssize_t kw_size =
        likely(kw == NULL) ?
        0 :
#if !CYTHON_ASSUME_SAFE_SIZE
        PyDict_Size(kw);
#else
        PyDict_GET_SIZE(kw);
#endif
    if (kw_size == 0) {
        return vc(func, args, nargs, NULL);
    }
#if !CYTHON_ASSUME_SAFE_SIZE
    else if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared (used by CythonFunction) */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
        int result;
        PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
        if (unlikely(!newFunc)) {
            PyErr_Clear(); // It's only an optimization, so don't throw an error
            return 0;
        }
        result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
        Py_DECREF(newFunc);
        return result;
    }
    return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if (PyMethod_Check(func)) {
        func = PyMethod_GET_FUNCTION(func);
    }
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __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_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
    PyObject *result;
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#else
        op->func_name = PyUnicode_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 PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
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;
}
#endif
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 = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    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 PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_defaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    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 PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_kwdefaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    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_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_annotations_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
    int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
    if (is_coroutine) {
        PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore:
        PyErr_Clear();
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    result = __Pyx_CyFunction_get_is_coroutine_value(op);
    if (unlikely(!result))
        return NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    if (op->func_is_coroutine) {
        Py_DECREF(result);
        result = __Pyx_NewRef(op->func_is_coroutine);
    } else {
        op->func_is_coroutine = __Pyx_NewRef(result);
    }
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        py_name, message, size);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        name, message, size);
#endif
}
static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s",
        py_name, message);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s",
        name, message);
#endif
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
#else
    {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
#endif
    {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#endif
#if CYTHON_METH_FASTCALL
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {"__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)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
#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) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_dict = NULL;
#endif
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    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 = 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);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func_dict);
#elif PY_VERSION_HEX < 0x030d0000
    _PyObject_ClearManagedDict((PyObject*)m);
#else
    PyObject_ClearManagedDict((PyObject*)m);
#endif
    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 !CYTHON_COMPILING_IN_LIMITED_API
#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
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    Py_CLEAR(m->defaults);
    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)
{
    {
        int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func_dict);
#else
    {
        int e =
#if PY_VERSION_HEX < 0x030d0000
            _PyObject_VisitManagedDict
#else
            PyObject_VisitManagedDict
#endif
                ((PyObject*)m, visit, arg);
        if (e != 0) return e;
    }
#endif
    __Pyx_VISIT_CONST(m->func_name);
    __Pyx_VISIT_CONST(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    __Pyx_VISIT_CONST(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
    __Pyx_END_CRITICAL_SECTION();
    return repr;
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (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(*)(void))meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes no arguments", size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_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;
            }
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes exactly one argument", size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    __Pyx_CyFunction_raise_type_error(
        (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
        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;
#if CYTHON_ASSUME_SAFE_SIZE
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(argc < 0)) return NULL;
#endif
        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 && CYTHON_VECTORCALL
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)) {
            __Pyx_CyFunction_raise_type_error(
                cyfunc, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            cyfunc, "takes no keyword arguments");
        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;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes no arguments", nargs);
        return NULL;
    }
    return 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;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes exactly one argument", nargs);
        return NULL;
    }
    return 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;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))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;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    #if PY_VERSION_HEX < 0x030e00A6
    size_t nargs_value = (size_t) nargs;
    #else
    Py_ssize_t nargs_value = nargs;
    #endif
    return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
}
#endif
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 CYTHON_METH_FASTCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_METH_FASTCALL
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_DICT |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
static int __pyx_CyFunction_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
    if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
    if (unlikely(!m->defaults))
        return NULL;
    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_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* 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 (__Pyx_TypeCheck(method, &PyMethodDescr_Type))
#endif
    {
#if CYTHON_COMPILING_IN_LIMITED_API
        return PyErr_Format(
            PyExc_SystemError,
            "Cython cannot yet handle classmethod on a MethodDescriptorType (%S) in limited API mode. "
            "This is most likely a classmethod in a cdef class method with binding=False. "
            "Try setting 'binding' to True.",
            method);
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
        PyTypeObject *d_type = GraalPyDescrObject_GetType(method);
        return PyDescr_NewClassMethod(d_type, GraalPyMethodDescrObject_GetMethod(method));
#elif CYTHON_COMPILING_IN_GRAAL
        PyTypeObject *d_type = PyDescrObject_GetType(method);
        return PyDescr_NewClassMethod(d_type, PyMethodDescrObject_GetMethod(method));
#else
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        PyTypeObject *d_type = descr->d_common.d_type;
        return PyDescr_NewClassMethod(d_type, descr->d_method);
#endif
    }
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
#else
    {
        PyObject *func=NULL;
        PyObject *builtins, *classmethod, *classmethod_str, *result=NULL;
        if (__Pyx_TypeCheck(method, __pyx_mstate_global->__Pyx_CachedMethodType)) {
            func = PyObject_GetAttrString(method, "__func__");
            if (!func) goto bad;
        } else {
            func = method;
            Py_INCREF(func);
        }
        builtins = PyEval_GetBuiltins(); // borrowed
        if (unlikely(!builtins)) goto bad;
        classmethod_str = PyUnicode_FromString("classmethod");
        if (unlikely(!classmethod_str)) goto bad;
        classmethod = PyObject_GetItem(builtins, classmethod_str);
        Py_DECREF(classmethod_str);
        if (unlikely(!classmethod)) goto bad;
        result = PyObject_CallFunctionObjArgs(classmethod, func, NULL);
        Py_DECREF(classmethod);
        bad:
        Py_XDECREF(func);
        return result;
    }
#endif
}

/* 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_mstate_global->__pyx_n_u_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 (used by Py3ClassCreate) */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_SIZE
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        tmptype = Py_TYPE(tmp);
        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) {
        metaclass = &PyType_Type;
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* PyObjectCall2Args (used by Py3ClassCreate) */
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 (used by Py3ClassCreate) */
#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);
    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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
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_mstate_global->__pyx_n_u_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, mkw);
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CLineInTraceback (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
#else
PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
    PyObject **dict_ptr = _PyObject_GetDictPtr(o);
    return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
}
#endif
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline = NULL;
    PyObject *ptype, *pvalue, *ptraceback;
    PyObject *cython_runtime_dict;
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
    cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, cython_runtime_dict,
            __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
    }
    if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    Py_XDECREF(cython_runtime_dict);
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache (used by AddTraceback) */
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 __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            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(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
        if (unlikely(!code_object)) goto bad;
        py_py_line = PyLong_FromLong(py_line);
        if (unlikely(!py_py_line)) goto bad;
        if (c_line) {
            py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        } else {
            py_funcname = PyUnicode_FromString(funcname);
        }
        if (unlikely(!py_funcname)) goto bad;
        dict = PyDict_New();
        if (unlikely(!dict)) goto bad;
        {
            PyObject *old_code_object = code_object;
            code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
            Py_DECREF(old_code_object);
        }
        if (unlikely(!code_object)) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#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 (c_line) {
        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;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    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_mstate_global->__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

/* CheckUnpickleChecksum */
static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
    PyObject *pickle_module = PyImport_ImportModule("pickle");
    if (unlikely(!pickle_module)) return;
    PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
    Py_DECREF(pickle_module);
    if (unlikely(!pickle_error)) return;
    if (checksum2 == checksum1) {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
            checksum, checksum1, members);
    } else if (checksum3 == checksum2) {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
            checksum, checksum1, checksum2, members);
    } else {
        PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
            checksum, checksum1, checksum2, checksum3, members);
    }
    Py_DECREF(pickle_error);
}
static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
    int found = 0;
    found |= checksum1 == checksum;
    found |= checksum2 == checksum;
    found |= checksum3 == checksum;
    if (likely(found))
        return 0;
    __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
    return -1;
}

/* 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_PyLong_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 PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyLong_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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))
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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))
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        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_PyLong_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 (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyLong_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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))
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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))
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        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_PyLong_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 PyLong_FromLong((long) value);
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PY_LONG_LONG));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
        } else if (sizeof(PGPing) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(PGPing) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(PGPing),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PGPing));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
        } else if (sizeof(ConnStatusType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(ConnStatusType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(ConnStatusType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ConnStatusType));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
        } else if (sizeof(PGTransactionStatusType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(PGTransactionStatusType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(PGTransactionStatusType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PGTransactionStatusType));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE Oid __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
        Oid val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (Oid) -1;
        val = __Pyx_PyLong_As_Oid(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(Oid, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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))
        } else if ((sizeof(Oid) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Oid, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(Oid, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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))
        } else if ((sizeof(Oid) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(Oid, PY_LONG_LONG, PyLong_AsLongLong(x))
        }
    }
    {
        Oid val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (Oid) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (Oid) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (Oid) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (Oid) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(Oid) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((Oid) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(Oid) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((Oid) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((Oid) 1) << (sizeof(Oid) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (Oid) -1;
        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_PyLong_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 PyLong_FromLong((long) value);
        } else if (sizeof(ExecStatusType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(ExecStatusType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(ExecStatusType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ExecStatusType));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
        } else if (sizeof(PGpipelineStatus) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(PGpipelineStatus) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(PGpipelineStatus),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PGpipelineStatus));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
        } else if (sizeof(Oid) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(Oid) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(Oid),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(Oid));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PostgresPollingStatusType(PostgresPollingStatusType value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const PostgresPollingStatusType neg_one = (PostgresPollingStatusType) -1, const_zero = (PostgresPollingStatusType) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PostgresPollingStatusType) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PostgresPollingStatusType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(PostgresPollingStatusType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PostgresPollingStatusType) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(PostgresPollingStatusType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(PostgresPollingStatusType),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PostgresPollingStatusType));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* PyObjectCallMethod1 */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* UpdateUnpickledDict */
static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
    PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
    if (unlikely(!state_dict)) {
        return -1;
    }
    int non_empty = PyObject_IsTrue(state_dict);
    if (non_empty == 0) {
        Py_DECREF(state_dict);
        return 0;
    } else if (unlikely(non_empty == -1)) {
        return -1;
    }
    PyObject *dict;
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    dict = PyObject_GetAttrString(obj, "__dict__");
    #else
    dict = PyObject_GenericGetDict(obj, NULL);
    #endif
    if (unlikely(!dict)) {
        Py_DECREF(state_dict);
        return -1;
    }
    int result;
    if (likely(PyDict_CheckExact(dict))) {
        result = PyDict_Update(dict, state_dict);
    } else {
        PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
        if (likely(obj_result)) {
            Py_DECREF(obj_result);
            result = 0;
        } else {
            result = -1;
        }
    }
    Py_DECREF(state_dict);
    Py_DECREF(dict);
    return result;
}
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
    Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(state_size == -1)) return -1;
    #endif
    if (state_size <= index) {
        return 0;
    }
    return __Pyx__UpdateUnpickledDict(obj, state, index);
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
static __Pyx_TypeName
__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
{
    PyObject *module = NULL, *name = NULL, *result = NULL;
    #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
    name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_qualname);
    #else
    name = PyType_GetQualName(tp);
    #endif
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
    module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_module);
    if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
    if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
        result = name;
        name = NULL;
        goto done;
    }
    result = PyUnicode_FromFormat("%U.%U", module, name);
    if (unlikely(result == NULL)) goto bad;
  done:
    Py_XDECREF(name);
    Py_XDECREF(module);
    return result;
  bad:
    PyErr_Clear();
    if (name) {
        result = name;
        name = NULL;
    } else {
        result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__15);
    }
    goto done;
}
#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);
}
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);
    }
}
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);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        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

/* GetRuntimeVersion */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
void __Pyx_init_runtime_version(void) {
    if (__Pyx_cached_runtime_version == 0) {
        const char* rt_version = Py_GetVersion();
        unsigned long version = 0;
        unsigned long factor = 0x01000000UL;
        unsigned int digit = 0;
        int i = 0;
        while (factor) {
            while ('0' <= rt_version[i] && rt_version[i] <= '9') {
                digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
                ++i;
            }
            version += factor * digit;
            if (rt_version[i] != '.')
                break;
            digit = 0;
            factor >>= 8;
            ++i;
        }
        __Pyx_cached_runtime_version = version;
    }
}
#endif
static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    return Py_Version & ~0xFFUL;
#else
    return __Pyx_cached_runtime_version;
#endif
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* NewCodeObj */
#if CYTHON_COMPILING_IN_LIMITED_API
    static PyObject* __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 *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
#elif PY_VERSION_HEX >= 0x030B0000
  static 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) {
    PyCodeObject *result;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
    if (likely(result))
        result->_co_firsttraceable = 0;
    #endif
    return result;
  }
#elif !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
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
) {
    PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
    Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
    PyObject *varnames_tuple = PyTuple_New(var_count);
    if (unlikely(!varnames_tuple)) return NULL;
    for (Py_ssize_t i=0; i < var_count; i++) {
        Py_INCREF(varnames[i]);
        if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
    if (!varnames_tuple_dedup) {
        if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
        varnames_tuple_dedup = varnames_tuple;
    }
    #else
    varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
    if (unlikely(!varnames_tuple_dedup)) goto done;
    #endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(varnames_tuple_dedup);
    #endif
    if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
        Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(line_table_length == -1)) goto done;
        #endif
        Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
        code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
        if (unlikely(!code_bytes)) goto done;
        char* c_code_bytes = PyBytes_AsString(code_bytes);
        if (unlikely(!c_code_bytes)) goto done;
        memset(c_code_bytes, 0, (size_t) code_len);
    }
    code_obj = (PyObject*) __Pyx__PyCode_New(
        (int) descr.argcount,
        (int) descr.num_posonly_args,
        (int) descr.num_kwonly_args,
        (int) descr.nlocals,
        0,
        (int) descr.flags,
        code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        varnames_tuple_dedup,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        filename,
        funcname,
        (int) descr.first_line,
        (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
    );
done:
    Py_XDECREF(code_bytes);
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(varnames_tuple_dedup);
    #endif
    Py_DECREF(varnames_tuple);
    return code_obj;
}

/* DecompressString */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
    PyObject *module, *decompress, *compressed_bytes, *decompressed;
    const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
    PyObject *methodname = PyUnicode_FromString("decompress");
    if (unlikely(!methodname)) return NULL;
    #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
    if (algo == 3) {
        PyObject *fromlist = Py_BuildValue("[O]", methodname);
        if (unlikely(!fromlist)) return NULL;
        module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
    } else
    #endif
        module = PyImport_ImportModule(module_name);
    if (unlikely(!module)) goto import_failed;
    decompress = PyObject_GetAttr(module, methodname);
    if (unlikely(!decompress)) goto import_failed;
    {
        #ifdef __cplusplus
            char *memview_bytes = const_cast<char*>(s);
        #else
            #if defined(__clang__)
              #pragma clang diagnostic push
              #pragma clang diagnostic ignored "-Wcast-qual"
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic push
              #pragma GCC diagnostic ignored "-Wcast-qual"
            #endif
            char *memview_bytes = (char*) s;
            #if defined(__clang__)
              #pragma clang diagnostic pop
            #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
              #pragma GCC diagnostic pop
            #endif
        #endif
        #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
        int memview_flags = 0x100;
        #else
        int memview_flags = PyBUF_READ;
        #endif
        compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
    }
    if (unlikely(!compressed_bytes)) {
        Py_DECREF(decompress);
        goto bad;
    }
    decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
    Py_DECREF(compressed_bytes);
    Py_DECREF(decompress);
    Py_DECREF(module);
    Py_DECREF(methodname);
    return decompressed;
import_failed:
    PyErr_Format(PyExc_ImportError,
        "Failed to import '%.20s.decompress' - cannot initialise module strings. "
        "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
        module_name, algo);
bad:
    Py_XDECREF(module);
    Py_DECREF(methodname);
    return NULL;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
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_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#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_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        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_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    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;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  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 (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      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 = PyLong_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);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return __Pyx_NewRef(b ? Py_True: Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


/* MultiPhaseInitModuleState */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
#else
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
#endif
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
#error "Module state with PEP489 requires atomics. Currently that's one of\
 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
#endif
#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#define __Pyx_ModuleStateLookup_Lock()
#define __Pyx_ModuleStateLookup_Unlock()
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(__cplusplus) && __cplusplus >= 201103L
#include <mutex>
static std::mutex __Pyx_ModuleStateLookup_mutex;
#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
#include <threads.h>
static mtx_t __Pyx_ModuleStateLookup_mutex;
static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
    mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
}
#define __Pyx_ModuleStateLookup_Lock()\
  call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
  mtx_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(_WIN32)
#include <Windows.h>  // synchapi.h on its own doesn't work
static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#else
#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
 Requires C standard >= C11, or C++ standard >= C++11,\
 or pthreads, or the Windows 32 API, or Python >= 3.13."
#endif
typedef struct {
    int64_t id;
    PyObject *module;
} __Pyx_InterpreterIdAndModule;
typedef struct {
    char interpreter_id_as_index;
    Py_ssize_t count;
    Py_ssize_t allocated;
    __Pyx_InterpreterIdAndModule table[1];
} __Pyx_ModuleStateLookupData;
#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
#else
static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
#endif
static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
        __Pyx_InterpreterIdAndModule* table,
        Py_ssize_t count,
        int64_t interpreterId) {
    __Pyx_InterpreterIdAndModule* begin = table;
    __Pyx_InterpreterIdAndModule* end = begin + count;
    if (begin->id == interpreterId) {
        return begin;
    }
    while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
        __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
        if (halfway->id == interpreterId) {
            return halfway;
        }
        if (halfway->id < interpreterId) {
            begin = halfway;
        } else {
            end = halfway;
        }
    }
    for (; begin < end; ++begin) {
        if (begin->id >= interpreterId) return begin;
    }
    return begin;
}
static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return NULL;
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
    {
        __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        if (likely(data)) {
            __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
            if (likely(data == new_data)) {
                goto read_finished;
            }
        }
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        __Pyx_ModuleStateLookup_Lock();
        __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
        data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
        __Pyx_ModuleStateLookup_Unlock();
    }
  read_finished:;
#else
    __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_InterpreterIdAndModule* found = NULL;
    if (unlikely(!data)) goto end;
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            found = data->table+interpreter_id;
        }
    } else {
        found = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
    }
  end:
    {
        PyObject *result=NULL;
        if (found && found->id == interpreter_id) {
            result = found->module;
        }
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
#endif
        return result;
    }
}
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
    while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
}
#else
#define __Pyx_ModuleStateLookup_wait_until_no_readers()
#endif
static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
    Py_ssize_t to_allocate = (*old_data)->allocated;
    while (to_allocate <= interpreter_id) {
        if (to_allocate == 0) to_allocate = 1;
        else to_allocate *= 2;
    }
    __Pyx_ModuleStateLookupData *new_data = *old_data;
    if (to_allocate != (*old_data)->allocated) {
         new_data = (__Pyx_ModuleStateLookupData *)realloc(
            *old_data,
            sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
        if (!new_data) {
            PyErr_NoMemory();
            return -1;
        }
        for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
            new_data->table[i].id = i;
            new_data->table[i].module = NULL;
        }
        new_data->allocated = to_allocate;
    }
    new_data->table[interpreter_id].module = module;
    if (new_data->count < interpreter_id+1) {
        new_data->count = interpreter_id+1;
    }
    *old_data = new_data;
    return 0;
}
static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
    __Pyx_InterpreterIdAndModule *read = data->table;
    __Pyx_InterpreterIdAndModule *write = data->table;
    __Pyx_InterpreterIdAndModule *end = read + data->count;
    for (; read<end; ++read) {
        if (read->module) {
            write->id = read->id;
            write->module = read->module;
            ++write;
        }
    }
    data->count = write - data->table;
    for (; write<end; ++write) {
        write->id = 0;
        write->module = NULL;
    }
    data->interpreter_id_as_index = 0;
}
static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    int result = 0;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_ModuleStateLookupData *new_data = old_data;
    if (!new_data) {
        new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
        if (!new_data) {
            result = -1;
            PyErr_NoMemory();
            goto end;
        }
        new_data->allocated = 1;
        new_data->interpreter_id_as_index = 1;
    }
    __Pyx_ModuleStateLookup_wait_until_no_readers();
    if (new_data->interpreter_id_as_index) {
        if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
            result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
            goto end;
        }
        __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
    }
    {
        Py_ssize_t insert_at = 0;
        {
            __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                new_data->table, new_data->count, interpreter_id);
            assert(lower_bound);
            insert_at = lower_bound - new_data->table;
            if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                lower_bound->module = module;
                goto end;  // already in table, nothing more to do
            }
        }
        if (new_data->count+1 >= new_data->allocated) {
            Py_ssize_t to_allocate = (new_data->count+1)*2;
            new_data =
                (__Pyx_ModuleStateLookupData*)realloc(
                    new_data,
                    sizeof(__Pyx_ModuleStateLookupData) +
                    (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
            if (!new_data) {
                result = -1;
                new_data = old_data;
                PyErr_NoMemory();
                goto end;
            }
            new_data->allocated = to_allocate;
        }
        ++new_data->count;
        int64_t last_id = interpreter_id;
        PyObject *last_module = module;
        for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
            int64_t current_id = new_data->table[i].id;
            new_data->table[i].id = last_id;
            last_id = current_id;
            PyObject *current_module = new_data->table[i].module;
            new_data->table[i].module = last_module;
            last_module = current_module;
        }
    }
  end:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
#else
    __Pyx_ModuleStateLookup_data = new_data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return result;
}
static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
#endif
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            data->table[interpreter_id].module = NULL;
        }
        goto done;
    }
    {
        __Pyx_ModuleStateLookup_wait_until_no_readers();
        __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
        if (!lower_bound) goto done;
        if (lower_bound->id != interpreter_id) goto done;
        __Pyx_InterpreterIdAndModule *end = data->table+data->count;
        for (;lower_bound<end-1; ++lower_bound) {
            lower_bound->id = (lower_bound+1)->id;
            lower_bound->module = (lower_bound+1)->module;
        }
    }
    --data->count;
    if (data->count == 0) {
        free(data);
        data = NULL;
    }
  done:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
#else
    __Pyx_ModuleStateLookup_data = data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return 0;
}
#endif

/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
