/* Generated by Cython 3.2.4 */

/* 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_4"
#define CYTHON_HEX_VERSION 0x030204F0
#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

#ifdef CYTHON_FREETHREADING_COMPATIBLE
#if CYTHON_FREETHREADING_COMPATIBLE
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#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",
  "(tree fragment)",
  "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 */
#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 *) noexcept nogil             # <<<<<<<<<<<<<<
 * ctypedef int (*conn_int_f) (const libpq.PGconn *) noexcept nogil
 * ctypedef void *(*conn_f_with_param) (const libpq.PGconn *, const char *) noexcept nogil
*/
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 *) noexcept nogil
 * ctypedef int (*conn_int_f) (const libpq.PGconn *) noexcept nogil             # <<<<<<<<<<<<<<
 * ctypedef void *(*conn_f_with_param) (const libpq.PGconn *, const char *) noexcept nogil
 * ctypedef int (*conn_int_f_with_param) (
*/
typedef int (*__pyx_t_9psycopg_c_2pq_conn_int_f)(PGconn const *);

/* "psycopg_c/pq.pxd":18
 * ctypedef char *(*conn_bytes_f) (const libpq.PGconn *) noexcept nogil
 * ctypedef int (*conn_int_f) (const libpq.PGconn *) noexcept nogil
 * ctypedef void *(*conn_f_with_param) (const libpq.PGconn *, const char *) noexcept nogil             # <<<<<<<<<<<<<<
 * ctypedef int (*conn_int_f_with_param) (
 *     const libpq.PGconn *, const char *
*/
typedef void *(*__pyx_t_9psycopg_c_2pq_conn_f_with_param)(PGconn const *, char const *);

/* "psycopg_c/pq.pxd":19
 * ctypedef int (*conn_int_f) (const libpq.PGconn *) noexcept nogil
 * ctypedef void *(*conn_f_with_param) (const libpq.PGconn *, const char *) noexcept nogil
 * ctypedef int (*conn_int_f_with_param) (             # <<<<<<<<<<<<<<
 *     const libpq.PGconn *, const char *
 * ) noexcept nogil
*/
typedef int (*__pyx_t_9psycopg_c_2pq_conn_int_f_with_param)(PGconn const *, char const *);

/* "psycopg_c/pq/pgconn.pyx":926
 * 
 * 
 * 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":24
 * 
 * 
 * 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":38
 * 
 * 
 * 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":45
 * 
 * 
 * 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":52
 * 
 * 
 * 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":59
 * 
 * 
 * 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":69
 * 
 * 
 * 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":77
 * 
 * 
 * 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":48
 *         )
 * 
 * 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_4
#define __PYX_HAVE_RT_ImportType_proto_3_2_4
#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_4(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_4(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_2_4 {
   __Pyx_ImportType_CheckSize_Error_3_2_4 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_2_4 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_2_4 = 2
};
static PyTypeObject *__Pyx_ImportType_3_2_4(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_4 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 "cython" */

/* 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 "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 void *__pyx_f_9psycopg_c_2pq__call_libpq_with_param(struct __pyx_obj_9psycopg_c_2pq_PGconn *, __pyx_t_9psycopg_c_2pq_conn_f_with_param, char const *); /*proto*/
static int __pyx_f_9psycopg_c_2pq__call_libpq_int(struct __pyx_obj_9psycopg_c_2pq_PGconn *, __pyx_t_9psycopg_c_2pq_conn_int_f); /*proto*/
static int __pyx_f_9psycopg_c_2pq__call_libpq_int_with_param(struct __pyx_obj_9psycopg_c_2pq_PGconn *, __pyx_t_9psycopg_c_2pq_conn_int_f_with_param, char const *); /*proto*/
static PyObject *__pyx_f_9psycopg_c_2pq__call_libpq_bytes(struct __pyx_obj_9psycopg_c_2pq_PGconn *, __pyx_t_9psycopg_c_2pq_conn_bytes_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[4];
  PyObject *__pyx_codeobj_tab[94];
  PyObject *__pyx_string_tab[524];
  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_sending_close_prepared_failed __pyx_string_tab[78]
#define __pyx_kp_u_sending_copy_data_failed __pyx_string_tab[79]
#define __pyx_kp_u_sending_copy_end_failed __pyx_string_tab[80]
#define __pyx_kp_u_sending_describe_prepared_failed __pyx_string_tab[81]
#define __pyx_kp_u_sending_prepared_query_failed __pyx_string_tab[82]
#define __pyx_kp_u_sending_query_and_params_failed __pyx_string_tab[83]
#define __pyx_kp_u_sending_query_failed __pyx_string_tab[84]
#define __pyx_kp_u_setting_chunked_rows_mode_failed __pyx_string_tab[85]
#define __pyx_kp_u_setting_nonblocking_failed __pyx_string_tab[86]
#define __pyx_kp_u_setting_single_row_mode_failed __pyx_string_tab[87]
#define __pyx_kp_u_the_cancel_connection_is_closed __pyx_string_tab[88]
#define __pyx_kp_u_the_connection_is_closed __pyx_string_tab[89]
#define __pyx_kp_u_the_connection_is_lost __pyx_string_tab[90]
#define __pyx_kp_u_tree_fragment __pyx_string_tab[91]
#define __pyx_kp_u_tuple_int_memoryview __pyx_string_tab[92]
#define __pyx_kp_u_utf_8 __pyx_string_tab[93]
#define __pyx_n_u_COMMAND_OK __pyx_string_tab[94]
#define __pyx_n_u_Conninfo __pyx_string_tab[95]
#define __pyx_n_u_ConninfoOption __pyx_string_tab[96]
#define __pyx_n_u_Conninfo___repr __pyx_string_tab[97]
#define __pyx_n_u_Conninfo_get_defaults __pyx_string_tab[98]
#define __pyx_n_u_Conninfo_parse __pyx_string_tab[99]
#define __pyx_n_u_Escaping __pyx_string_tab[100]
#define __pyx_n_u_Escaping___reduce_cython __pyx_string_tab[101]
#define __pyx_n_u_Escaping___setstate_cython __pyx_string_tab[102]
#define __pyx_n_u_Escaping_escape_bytea __pyx_string_tab[103]
#define __pyx_n_u_Escaping_escape_identifier __pyx_string_tab[104]
#define __pyx_n_u_Escaping_escape_literal __pyx_string_tab[105]
#define __pyx_n_u_Escaping_escape_string __pyx_string_tab[106]
#define __pyx_n_u_Escaping_unescape_bytea __pyx_string_tab[107]
#define __pyx_n_u_ExecStatus __pyx_string_tab[108]
#define __pyx_n_u_Format __pyx_string_tab[109]
#define __pyx_n_u_None __pyx_string_tab[110]
#define __pyx_n_u_NotSupportedError __pyx_string_tab[111]
#define __pyx_n_u_OperationalError __pyx_string_tab[112]
#define __pyx_n_u_PGcancel __pyx_string_tab[113]
#define __pyx_n_u_PGcancelConn __pyx_string_tab[114]
#define __pyx_n_u_PGcancelConn___reduce_cython __pyx_string_tab[115]
#define __pyx_n_u_PGcancelConn___setstate_cython __pyx_string_tab[116]
#define __pyx_n_u_PGcancelConn__ensure_pgcancelcon __pyx_string_tab[117]
#define __pyx_n_u_PGcancelConn_blocking __pyx_string_tab[118]
#define __pyx_n_u_PGcancelConn_finish __pyx_string_tab[119]
#define __pyx_n_u_PGcancelConn_get_error_message __pyx_string_tab[120]
#define __pyx_n_u_PGcancelConn_poll __pyx_string_tab[121]
#define __pyx_n_u_PGcancelConn_reset __pyx_string_tab[122]
#define __pyx_n_u_PGcancelConn_start __pyx_string_tab[123]
#define __pyx_n_u_PGcancel___reduce_cython __pyx_string_tab[124]
#define __pyx_n_u_PGcancel___setstate_cython __pyx_string_tab[125]
#define __pyx_n_u_PGcancel_cancel __pyx_string_tab[126]
#define __pyx_n_u_PGcancel_free __pyx_string_tab[127]
#define __pyx_n_u_PGconn __pyx_string_tab[128]
#define __pyx_n_u_PGconn___reduce_cython __pyx_string_tab[129]
#define __pyx_n_u_PGconn___setstate_cython __pyx_string_tab[130]
#define __pyx_n_u_PGconn_cancel_conn __pyx_string_tab[131]
#define __pyx_n_u_PGconn_change_password __pyx_string_tab[132]
#define __pyx_n_u_PGconn_close_portal __pyx_string_tab[133]
#define __pyx_n_u_PGconn_close_prepared __pyx_string_tab[134]
#define __pyx_n_u_PGconn_connect __pyx_string_tab[135]
#define __pyx_n_u_PGconn_connect_poll __pyx_string_tab[136]
#define __pyx_n_u_PGconn_connect_start __pyx_string_tab[137]
#define __pyx_n_u_PGconn_consume_input __pyx_string_tab[138]
#define __pyx_n_u_PGconn_describe_portal __pyx_string_tab[139]
#define __pyx_n_u_PGconn_describe_prepared __pyx_string_tab[140]
#define __pyx_n_u_PGconn_encrypt_password __pyx_string_tab[141]
#define __pyx_n_u_PGconn_enter_pipeline_mode __pyx_string_tab[142]
#define __pyx_n_u_PGconn_exec __pyx_string_tab[143]
#define __pyx_n_u_PGconn_exec_params __pyx_string_tab[144]
#define __pyx_n_u_PGconn_exec_prepared __pyx_string_tab[145]
#define __pyx_n_u_PGconn_exit_pipeline_mode __pyx_string_tab[146]
#define __pyx_n_u_PGconn_finish __pyx_string_tab[147]
#define __pyx_n_u_PGconn_flush __pyx_string_tab[148]
#define __pyx_n_u_PGconn_get_cancel __pyx_string_tab[149]
#define __pyx_n_u_PGconn_get_copy_data __pyx_string_tab[150]
#define __pyx_n_u_PGconn_get_error_message __pyx_string_tab[151]
#define __pyx_n_u_PGconn_get_result __pyx_string_tab[152]
#define __pyx_n_u_PGconn_is_busy __pyx_string_tab[153]
#define __pyx_n_u_PGconn_make_empty_result __pyx_string_tab[154]
#define __pyx_n_u_PGconn_notifies __pyx_string_tab[155]
#define __pyx_n_u_PGconn_parameter_status __pyx_string_tab[156]
#define __pyx_n_u_PGconn_ping __pyx_string_tab[157]
#define __pyx_n_u_PGconn_pipeline_sync __pyx_string_tab[158]
#define __pyx_n_u_PGconn_prepare __pyx_string_tab[159]
#define __pyx_n_u_PGconn_put_copy_data __pyx_string_tab[160]
#define __pyx_n_u_PGconn_put_copy_end __pyx_string_tab[161]
#define __pyx_n_u_PGconn_reset __pyx_string_tab[162]
#define __pyx_n_u_PGconn_reset_poll __pyx_string_tab[163]
#define __pyx_n_u_PGconn_reset_start __pyx_string_tab[164]
#define __pyx_n_u_PGconn_send_close_portal __pyx_string_tab[165]
#define __pyx_n_u_PGconn_send_close_prepared __pyx_string_tab[166]
#define __pyx_n_u_PGconn_send_describe_portal __pyx_string_tab[167]
#define __pyx_n_u_PGconn_send_describe_prepared __pyx_string_tab[168]
#define __pyx_n_u_PGconn_send_flush_request __pyx_string_tab[169]
#define __pyx_n_u_PGconn_send_prepare __pyx_string_tab[170]
#define __pyx_n_u_PGconn_send_query __pyx_string_tab[171]
#define __pyx_n_u_PGconn_send_query_params __pyx_string_tab[172]
#define __pyx_n_u_PGconn_send_query_prepared __pyx_string_tab[173]
#define __pyx_n_u_PGconn_set_chunked_rows_mode __pyx_string_tab[174]
#define __pyx_n_u_PGconn_set_single_row_mode __pyx_string_tab[175]
#define __pyx_n_u_PGconn_set_trace_flags __pyx_string_tab[176]
#define __pyx_n_u_PGconn_trace __pyx_string_tab[177]
#define __pyx_n_u_PGconn_untrace __pyx_string_tab[178]
#define __pyx_n_u_PGnotify __pyx_string_tab[179]
#define __pyx_n_u_PGresAttDesc __pyx_string_tab[180]
#define __pyx_n_u_PGresult __pyx_string_tab[181]
#define __pyx_n_u_PGresult___reduce_cython __pyx_string_tab[182]
#define __pyx_n_u_PGresult___setstate_cython __pyx_string_tab[183]
#define __pyx_n_u_PGresult_clear __pyx_string_tab[184]
#define __pyx_n_u_PGresult_error_field __pyx_string_tab[185]
#define __pyx_n_u_PGresult_fformat __pyx_string_tab[186]
#define __pyx_n_u_PGresult_fmod __pyx_string_tab[187]
#define __pyx_n_u_PGresult_fname __pyx_string_tab[188]
#define __pyx_n_u_PGresult_fsize __pyx_string_tab[189]
#define __pyx_n_u_PGresult_ftable __pyx_string_tab[190]
#define __pyx_n_u_PGresult_ftablecol __pyx_string_tab[191]
#define __pyx_n_u_PGresult_ftype __pyx_string_tab[192]
#define __pyx_n_u_PGresult_get_error_message __pyx_string_tab[193]
#define __pyx_n_u_PGresult_get_value __pyx_string_tab[194]
#define __pyx_n_u_PGresult_param_type __pyx_string_tab[195]
#define __pyx_n_u_PGresult_set_attributes __pyx_string_tab[196]
#define __pyx_n_u_PQBuffer __pyx_string_tab[197]
#define __pyx_n_u_PQBuffer___reduce_cython __pyx_string_tab[198]
#define __pyx_n_u_PQBuffer___setstate_cython __pyx_string_tab[199]
#define __pyx_n_u_PQcancelCreate __pyx_string_tab[200]
#define __pyx_n_u_PQchangePassword __pyx_string_tab[201]
#define __pyx_n_u_PQclosePortal __pyx_string_tab[202]
#define __pyx_n_u_PQclosePrepared __pyx_string_tab[203]
#define __pyx_n_u_PQconnectionUsedGSSAPI __pyx_string_tab[204]
#define __pyx_n_u_PQencryptPasswordConn __pyx_string_tab[205]
#define __pyx_n_u_PQenterPipelineMode __pyx_string_tab[206]
#define __pyx_n_u_PQexitPipelineMode __pyx_string_tab[207]
#define __pyx_n_u_PQfullProtocolVersion __pyx_string_tab[208]
#define __pyx_n_u_PQhostaddr __pyx_string_tab[209]
#define __pyx_n_u_PQpipelineSync __pyx_string_tab[210]
#define __pyx_n_u_PQsendClosePortal __pyx_string_tab[211]
#define __pyx_n_u_PQsendClosePrepared __pyx_string_tab[212]
#define __pyx_n_u_PQsetTraceFlags __pyx_string_tab[213]
#define __pyx_n_u_PqFormat __pyx_string_tab[214]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[215]
#define __pyx_n_u_TEXT __pyx_string_tab[216]
#define __pyx_n_u_Trace __pyx_string_tab[217]
#define __pyx_n_u_ViewBuffer __pyx_string_tab[218]
#define __pyx_n_u_ViewBuffer___reduce_cython __pyx_string_tab[219]
#define __pyx_n_u_ViewBuffer___setstate_cython __pyx_string_tab[220]
#define __pyx_n_u_algorithm __pyx_string_tab[221]
#define __pyx_n_u_ascii __pyx_string_tab[222]
#define __pyx_n_u_async __pyx_string_tab[223]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[224]
#define __pyx_n_u_attrs __pyx_string_tab[225]
#define __pyx_n_u_atttypmod __pyx_string_tab[226]
#define __pyx_n_u_atypes __pyx_string_tab[227]
#define __pyx_n_u_blocking __pyx_string_tab[228]
#define __pyx_n_u_buf __pyx_string_tab[229]
#define __pyx_n_u_buffer __pyx_string_tab[230]
#define __pyx_n_u_buffer_ptr __pyx_string_tab[231]
#define __pyx_n_u_build_version __pyx_string_tab[232]
#define __pyx_n_u_bytes_2 __pyx_string_tab[233]
#define __pyx_n_u_c __pyx_string_tab[234]
#define __pyx_n_u_calgo __pyx_string_tab[235]
#define __pyx_n_u_cancel __pyx_string_tab[236]
#define __pyx_n_u_cancel_conn __pyx_string_tab[237]
#define __pyx_n_u_cbuffer __pyx_string_tab[238]
#define __pyx_n_u_ccol __pyx_string_tab[239]
#define __pyx_n_u_cerr __pyx_string_tab[240]
#define __pyx_n_u_cformats __pyx_string_tab[241]
#define __pyx_n_u_change_password __pyx_string_tab[242]
#define __pyx_n_u_class __pyx_string_tab[243]
#define __pyx_n_u_clean_error_message __pyx_string_tab[244]
#define __pyx_n_u_clear __pyx_string_tab[245]
#define __pyx_n_u_clengths __pyx_string_tab[246]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[247]
#define __pyx_n_u_close_portal __pyx_string_tab[248]
#define __pyx_n_u_close_prepared __pyx_string_tab[249]
#define __pyx_n_u_cls __pyx_string_tab[250]
#define __pyx_n_u_cnparams __pyx_string_tab[251]
#define __pyx_n_u_column_number __pyx_string_tab[252]
#define __pyx_n_u_columnid __pyx_string_tab[253]
#define __pyx_n_u_command __pyx_string_tab[254]
#define __pyx_n_u_compiled __pyx_string_tab[255]
#define __pyx_n_u_conn __pyx_string_tab[256]
#define __pyx_n_u_connect __pyx_string_tab[257]
#define __pyx_n_u_connect_poll __pyx_string_tab[258]
#define __pyx_n_u_connect_start __pyx_string_tab[259]
#define __pyx_n_u_connection_summary __pyx_string_tab[260]
#define __pyx_n_u_conninfo __pyx_string_tab[261]
#define __pyx_n_u_consume_input __pyx_string_tab[262]
#define __pyx_n_u_crow __pyx_string_tab[263]
#define __pyx_n_u_ctypes __pyx_string_tab[264]
#define __pyx_n_u_cvalues __pyx_string_tab[265]
#define __pyx_n_u_data __pyx_string_tab[266]
#define __pyx_n_u_decode __pyx_string_tab[267]
#define __pyx_n_u_descr __pyx_string_tab[268]
#define __pyx_n_u_describe_portal __pyx_string_tab[269]
#define __pyx_n_u_describe_prepared __pyx_string_tab[270]
#define __pyx_n_u_descriptions __pyx_string_tab[271]
#define __pyx_n_u_dict __pyx_string_tab[272]
#define __pyx_n_u_dict_2 __pyx_string_tab[273]
#define __pyx_n_u_dispchar __pyx_string_tab[274]
#define __pyx_n_u_dispsize __pyx_string_tab[275]
#define __pyx_n_u_doc __pyx_string_tab[276]
#define __pyx_n_u_e __pyx_string_tab[277]
#define __pyx_n_u_encoding __pyx_string_tab[278]
#define __pyx_n_u_encoding_2 __pyx_string_tab[279]
#define __pyx_n_u_encrypt_password __pyx_string_tab[280]
#define __pyx_n_u_ensure_pgcancelconn __pyx_string_tab[281]
#define __pyx_n_u_enter_pipeline_mode __pyx_string_tab[282]
#define __pyx_n_u_envvar __pyx_string_tab[283]
#define __pyx_n_u_errmsg __pyx_string_tab[284]
#define __pyx_n_u_error __pyx_string_tab[285]
#define __pyx_n_u_error_field __pyx_string_tab[286]
#define __pyx_n_u_error_message __pyx_string_tab[287]
#define __pyx_n_u_errors __pyx_string_tab[288]
#define __pyx_n_u_escape_bytea __pyx_string_tab[289]
#define __pyx_n_u_escape_identifier __pyx_string_tab[290]
#define __pyx_n_u_escape_literal __pyx_string_tab[291]
#define __pyx_n_u_escape_string __pyx_string_tab[292]
#define __pyx_n_u_exc __pyx_string_tab[293]
#define __pyx_n_u_exception __pyx_string_tab[294]
#define __pyx_n_u_exec __pyx_string_tab[295]
#define __pyx_n_u_exec_params __pyx_string_tab[296]
#define __pyx_n_u_exec_prepared __pyx_string_tab[297]
#define __pyx_n_u_exec_status __pyx_string_tab[298]
#define __pyx_n_u_exit_pipeline_mode __pyx_string_tab[299]
#define __pyx_n_u_f __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_pgconn_ptr __pyx_string_tab[360]
#define __pyx_n_u_pgresult __pyx_string_tab[361]
#define __pyx_n_u_ping __pyx_string_tab[362]
#define __pyx_n_u_pipeline_sync __pyx_string_tab[363]
#define __pyx_n_u_platform __pyx_string_tab[364]
#define __pyx_n_u_poll __pyx_string_tab[365]
#define __pyx_n_u_pop __pyx_string_tab[366]
#define __pyx_n_u_prepare __pyx_string_tab[367]
#define __pyx_n_u_prepare_2 __pyx_string_tab[368]
#define __pyx_n_u_psycopg __pyx_string_tab[369]
#define __pyx_n_u_psycopg__encodings __pyx_string_tab[370]
#define __pyx_n_u_psycopg_c_pq __pyx_string_tab[371]
#define __pyx_n_u_psycopg_pq __pyx_string_tab[372]
#define __pyx_n_u_psycopg_pq__enums __pyx_string_tab[373]
#define __pyx_n_u_psycopg_pq_misc __pyx_string_tab[374]
#define __pyx_n_u_ptr __pyx_string_tab[375]
#define __pyx_n_u_put_copy_data __pyx_string_tab[376]
#define __pyx_n_u_put_copy_end __pyx_string_tab[377]
#define __pyx_n_u_pyx_capi __pyx_string_tab[378]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[379]
#define __pyx_n_u_pyx_result __pyx_string_tab[380]
#define __pyx_n_u_pyx_state __pyx_string_tab[381]
#define __pyx_n_u_pyx_type __pyx_string_tab[382]
#define __pyx_n_u_pyx_unpickle_Escaping __pyx_string_tab[383]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[384]
#define __pyx_n_u_qualname __pyx_string_tab[385]
#define __pyx_n_u_reduce __pyx_string_tab[386]
#define __pyx_n_u_reduce_cython __pyx_string_tab[387]
#define __pyx_n_u_reduce_ex __pyx_string_tab[388]
#define __pyx_n_u_repr __pyx_string_tab[389]
#define __pyx_n_u_res __pyx_string_tab[390]
#define __pyx_n_u_reset __pyx_string_tab[391]
#define __pyx_n_u_reset_poll __pyx_string_tab[392]
#define __pyx_n_u_reset_start __pyx_string_tab[393]
#define __pyx_n_u_result_format __pyx_string_tab[394]
#define __pyx_n_u_return __pyx_string_tab[395]
#define __pyx_n_u_row_number __pyx_string_tab[396]
#define __pyx_n_u_rv __pyx_string_tab[397]
#define __pyx_n_u_s __pyx_string_tab[398]
#define __pyx_n_u_self __pyx_string_tab[399]
#define __pyx_n_u_send_close_portal __pyx_string_tab[400]
#define __pyx_n_u_send_close_prepared __pyx_string_tab[401]
#define __pyx_n_u_send_describe_portal __pyx_string_tab[402]
#define __pyx_n_u_send_describe_prepared __pyx_string_tab[403]
#define __pyx_n_u_send_flush_request __pyx_string_tab[404]
#define __pyx_n_u_send_prepare __pyx_string_tab[405]
#define __pyx_n_u_send_query __pyx_string_tab[406]
#define __pyx_n_u_send_query_params __pyx_string_tab[407]
#define __pyx_n_u_send_query_prepared __pyx_string_tab[408]
#define __pyx_n_u_set_attributes __pyx_string_tab[409]
#define __pyx_n_u_set_chunked_rows_mode __pyx_string_tab[410]
#define __pyx_n_u_set_name __pyx_string_tab[411]
#define __pyx_n_u_set_single_row_mode __pyx_string_tab[412]
#define __pyx_n_u_set_trace_flags __pyx_string_tab[413]
#define __pyx_n_u_setdefault __pyx_string_tab[414]
#define __pyx_n_u_setstate __pyx_string_tab[415]
#define __pyx_n_u_setstate_cython __pyx_string_tab[416]
#define __pyx_n_u_size __pyx_string_tab[417]
#define __pyx_n_u_ssl __pyx_string_tab[418]
#define __pyx_n_u_start __pyx_string_tab[419]
#define __pyx_n_u_state __pyx_string_tab[420]
#define __pyx_n_u_status __pyx_string_tab[421]
#define __pyx_n_u_str __pyx_string_tab[422]
#define __pyx_n_u_stream __pyx_string_tab[423]
#define __pyx_n_u_sys __pyx_string_tab[424]
#define __pyx_n_u_tableid __pyx_string_tab[425]
#define __pyx_n_u_test __pyx_string_tab[426]
#define __pyx_n_u_trace __pyx_string_tab[427]
#define __pyx_n_u_types_fast __pyx_string_tab[428]
#define __pyx_n_u_typid __pyx_string_tab[429]
#define __pyx_n_u_typlen __pyx_string_tab[430]
#define __pyx_n_u_unescape_bytea __pyx_string_tab[431]
#define __pyx_n_u_untrace __pyx_string_tab[432]
#define __pyx_n_u_update __pyx_string_tab[433]
#define __pyx_n_u_use_setstate __pyx_string_tab[434]
#define __pyx_n_u_user __pyx_string_tab[435]
#define __pyx_n_u_v __pyx_string_tab[436]
#define __pyx_n_u_val __pyx_string_tab[437]
#define __pyx_n_u_values __pyx_string_tab[438]
#define __pyx_n_u_version __pyx_string_tab[439]
#define __pyx_n_u_version_pretty __pyx_string_tab[440]
#define __pyx_n_u_x __pyx_string_tab[441]
#define __pyx_kp_b__5 __pyx_string_tab[442]
#define __pyx_kp_b_int_PyObject_char_Py_ssize_t__bu __pyx_string_tab[443]
#define __pyx_kp_b_iso88591_0_Gq_4q_A_4AT9K1 __pyx_string_tab[444]
#define __pyx_kp_b_iso88591_0_Q_3d_q_Q_c_AQ_3c_A_z __pyx_string_tab[445]
#define __pyx_kp_b_iso88591_1_IQd_2 __pyx_string_tab[446]
#define __pyx_kp_b_iso88591_1_Q_1L_7_a_A_at3EQ_gQ_Q_7_1_81 __pyx_string_tab[447]
#define __pyx_kp_b_iso88591_1_WA_3d_q_a_1_c_AQ_4q_A_q __pyx_string_tab[448]
#define __pyx_kp_b_iso88591_1_c_1_E_aq_L_HE_KuA_L_Q_Je1_IU __pyx_string_tab[449]
#define __pyx_kp_b_iso88591_2_A_Q_3d_q_q_c_AQ_3c_A_z __pyx_string_tab[450]
#define __pyx_kp_b_iso88591_31_44J_Q_3c_A_AT1C1_z __pyx_string_tab[451]
#define __pyx_kp_b_iso88591_4A_Q_N_8_4q_Qa_z __pyx_string_tab[452]
#define __pyx_kp_b_iso88591_4A_n_B_a_3gQ_1_1 __pyx_string_tab[453]
#define __pyx_kp_b_iso88591_4_Q_A __pyx_string_tab[454]
#define __pyx_kp_b_iso88591_5Q_44J_q_3c_A_AT1C1_z __pyx_string_tab[455]
#define __pyx_kp_b_iso88591_5Q_a_Q_3d_q_A_c_AQ_4q_A_1_6H __pyx_string_tab[456]
#define __pyx_kp_b_iso88591_6_1A_Q_m1D_a_3b_A_1D0B_q __pyx_string_tab[457]
#define __pyx_kp_b_iso88591_7q_0_Q_3d_q_a_1_c_AQ_4q_A_1_6H __pyx_string_tab[458]
#define __pyx_kp_b_iso88591_8_0_EQ_4q_A_4AT9K1 __pyx_string_tab[459]
#define __pyx_kp_b_iso88591_9_Qd_A_at3EQ __pyx_string_tab[460]
#define __pyx_kp_b_iso88591_A45_4q_Qa_Zq __pyx_string_tab[461]
#define __pyx_kp_b_iso88591_A_0_Q_a_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_4vS_AQ_4uM_A_AQ_6_q_1D_5_4s_A __pyx_string_tab[466]
#define __pyx_kp_b_iso88591_A_4vWA_t5_S_a_7q_aq_4s_Q_3aq_S_q __pyx_string_tab[467]
#define __pyx_kp_b_iso88591_A_4vWE_T_m3a_AQ_6_q_4vWA_E_8_XQa __pyx_string_tab[468]
#define __pyx_kp_b_iso88591_A_6_q_4vS_AQ_4uM_A_AQ_at5_e1_4s __pyx_string_tab[469]
#define __pyx_kp_b_iso88591_A_6_q_4vWA_t5_S_a_hl_7_Bb_a_E_y __pyx_string_tab[470]
#define __pyx_kp_b_iso88591_A_A_11A_AQ_5_1_wc_k_a_waxq_q_a_A __pyx_string_tab[471]
#define __pyx_kp_b_iso88591_A_A_2_1_A_Q_Qd_a_4q_A_at3EQ_U_1 __pyx_string_tab[472]
#define __pyx_kp_b_iso88591_A_A_a_A_8J_q_WA_3d_q_A_j_Ja_1HIZ __pyx_string_tab[473]
#define __pyx_kp_b_iso88591_A_A_a_A_8J_q_WA_3d_q_Q_j_Ja_1HIZ __pyx_string_tab[474]
#define __pyx_kp_b_iso88591_A_A_wa_a_aq_1_axr_U_1_auH_A_WA_3 __pyx_string_tab[475]
#define __pyx_kp_b_iso88591_A_A_wa_a_aq_1_axr_U_1_auH_A_WA_3_2 __pyx_string_tab[476]
#define __pyx_kp_b_iso88591_A_G1A __pyx_string_tab[477]
#define __pyx_kp_b_iso88591_A_Jat_31 __pyx_string_tab[478]
#define __pyx_kp_b_iso88591_A_Q_1D_4q_AQ_z __pyx_string_tab[479]
#define __pyx_kp_b_iso88591_A_Q_L_Q_9Cq_1_z __pyx_string_tab[480]
#define __pyx_kp_b_iso88591_A_Q_Q_6_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_WA_3d_q_q_A_c_AQ_9Cq_A_4_A_z __pyx_string_tab[483]
#define __pyx_kp_b_iso88591_A_WA_4q_1_3j_9Cq_1A_1_1 __pyx_string_tab[484]
#define __pyx_kp_b_iso88591_A_a_A_8J_WA_3d_q_a_e_5J_j_1HIZq __pyx_string_tab[485]
#define __pyx_kp_b_iso88591_A_a_A_8J_WA_3d_q_e1_j_1HIZq_c_AQ __pyx_string_tab[486]
#define __pyx_kp_b_iso88591_A_av_6a __pyx_string_tab[487]
#define __pyx_kp_b_iso88591_A_q_Q_a_3c_AT_1 __pyx_string_tab[488]
#define __pyx_kp_b_iso88591_A_s_4q_hgQa __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_Q_nA __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_Q_4q_3c_AQ __pyx_string_tab[495]
#define __pyx_kp_b_iso88591_Q_1D __pyx_string_tab[496]
#define __pyx_kp_b_iso88591_Q_1_Q_at1_4q_AQ_Qa __pyx_string_tab[497]
#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[498]
#define __pyx_kp_b_iso88591_Q_3d_q_4q_c_AQ_3b_A_8_Oq_q __pyx_string_tab[499]
#define __pyx_kp_b_iso88591_Q_Q_1D_a_4q_AQ __pyx_string_tab[500]
#define __pyx_kp_b_iso88591_Q_Q_a_4q_AQ __pyx_string_tab[501]
#define __pyx_kp_b_iso88591_Q_Q_m1D_4q_AQ __pyx_string_tab[502]
#define __pyx_kp_b_iso88591_Q_t_q_at1_O1 __pyx_string_tab[503]
#define __pyx_kp_b_iso88591_T_G1F_a_vWE_Q_q_t6_q_Qg_q_Qg __pyx_string_tab[504]
#define __pyx_kp_b_iso88591_WA_iq_A_q __pyx_string_tab[505]
#define __pyx_kp_b_iso88591_XQd_3gQ_1_1 __pyx_string_tab[506]
#define __pyx_kp_b_iso88591_Zq_A_Q_Q_nA __pyx_string_tab[507]
#define __pyx_kp_b_iso88591_a_1D0_a_1_5V1_1Ba_L_5V1_q_q __pyx_string_tab[508]
#define __pyx_kp_b_iso88591_a_4_A_AQ __pyx_string_tab[509]
#define __pyx_kp_b_iso88591_a_4_WA_at1 __pyx_string_tab[510]
#define __pyx_kp_b_iso88591_a_L_5Q __pyx_string_tab[511]
#define __pyx_kp_b_iso88591_a_M_a __pyx_string_tab[512]
#define __pyx_kp_b_iso88591_a_av_6a __pyx_string_tab[513]
#define __pyx_kp_b_iso88591_avQ __pyx_string_tab[514]
#define __pyx_kp_b_iso88591_q_0_kQR_881A_7_nA_1 __pyx_string_tab[515]
#define __pyx_kp_b_iso88591_q_1D __pyx_string_tab[516]
#define __pyx_kp_b_iso88591_q_1D_8_D __pyx_string_tab[517]
#define __pyx_kp_b_iso88591_q_1_Q_oQd_3c_AQ_3c_AQ __pyx_string_tab[518]
#define __pyx_kp_b_iso88591_q_4_gQ_a __pyx_string_tab[519]
#define __pyx_kp_b_iso88591_q_81IQa_Q_nAT_y_Q_3b_A_AT1C1_q __pyx_string_tab[520]
#define __pyx_kp_b_iso88591_q_9N_4q_A_at3EQ __pyx_string_tab[521]
#define __pyx_kp_b_iso88591_q_Q_3d_q_Qa_c_AQ __pyx_string_tab[522]
#define __pyx_kp_b_iso88591_q_Q_oQd_2S_A_4_A __pyx_string_tab[523]
#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<4; ++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<524; ++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<4; ++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<524; ++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":40
 * 
 * 
 * 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":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)}"
*/
  __pyx_t_1 = (PG_VERSION_NUM < __pyx_v_pgversion);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":42
 * 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, 42, __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, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":43
 *     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, 43, __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, 43, __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, 43, __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, 43, __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, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "psycopg_c/pq/pgconn.pyx":44
 *         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, 44, __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, 44, __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, 44, __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, 44, __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":43
 *     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, 43, __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, 42, __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, 42, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":40
 * 
 * 
 * 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":49
 * 
 * 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":51
 *     @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, 51, __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":52
 *     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":54
 *         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":56
 *         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":49
 * 
 * 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":58
 *         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":59
 * 
 *     def __cinit__(self):
 *         self._pgconn_ptr = NULL             # <<<<<<<<<<<<<<
 *         self._procpid = getpid()
 * 
*/
  __pyx_v_self->_pgconn_ptr = NULL;

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

  /* "psycopg_c/pq/pgconn.pyx":58
 *         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":62
 *         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":65
 *         # 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":66
 *         # 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, 66, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "psycopg_c/pq/pgconn.pyx":65
 *         # 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":62
 *         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":68
 *             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":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_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __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, 69, __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, 69, __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, 69, __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, 69, __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, 69, __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, 69, __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":70
 *     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, 70, __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, 70, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_info = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "psycopg_c/pq/pgconn.pyx":71
 *         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, 71, __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, 71, __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, 71, __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, 71, __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":68
 *             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":73
 *         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, 74, __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":75
 *     @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":76
 *     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":77
 *         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, 77, __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, 77, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":76
 *     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":79
 *             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, 79, __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":73
 *         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":81
 *         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, 82, __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":83
 *     @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":84
 *     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":85
 *         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, 85, __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, 85, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":84
 *     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":87
 *             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, 87, __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":81
 *         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":89
 *         return PGconn._from_ptr(pgconn)
 * 
 *     def connect_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_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":90
 * 
 *     def connect_poll(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)             # <<<<<<<<<<<<<<
 * 
 *     def finish(self) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f)PQconnectPoll)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 90, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_2, NULL, 0) < (0)) __PYX_ERR(1, 90, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":89
 *         return PGconn._from_ptr(pgconn)
 * 
 *     def connect_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_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":92
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr is not NULL:
*/

/* 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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("finish", 0);

  /* "psycopg_c/pq/pgconn.pyx":93
 * 
 *     def finish(self) -> None:
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if self._pgconn_ptr is not NULL:
 *                 libpq.PQfinish(self._pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

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

          /* "psycopg_c/pq/pgconn.pyx":95
 *         with cython.critical_section(self):
 *             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":96
 *             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":94
 *     def finish(self) -> None:
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr is not NULL:             # <<<<<<<<<<<<<<
 *                 libpq.PQfinish(self._pgconn_ptr)
 *                 self._pgconn_ptr = NULL
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":93
 * 
 *     def finish(self) -> None:
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if self._pgconn_ptr is not NULL:
 *                 libpq.PQfinish(self._pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":92
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr is not NULL:
*/

  /* 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":98
 *                 self._pgconn_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgconn_ptr(self) -> int | None:
 *         cdef long long ptr = -1
*/

/* 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) {
  PY_LONG_LONG __pyx_v_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":100
 *     @property
 *     def pgconn_ptr(self) -> int | None:
 *         cdef long long ptr = -1             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr:
*/
  __pyx_v_ptr = -1LL;

  /* "psycopg_c/pq/pgconn.pyx":101
 *     def pgconn_ptr(self) -> int | None:
 *         cdef long long ptr = -1
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if self._pgconn_ptr:
 *                 ptr = <long long><void *>self._pgconn_ptr
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":102
 *         cdef long long ptr = -1
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr:             # <<<<<<<<<<<<<<
 *                 ptr = <long long><void *>self._pgconn_ptr
 *         return ptr if ptr != -1 else None
*/
        __pyx_t_2 = (__pyx_v_self->_pgconn_ptr != 0);
        if (__pyx_t_2) {

          /* "psycopg_c/pq/pgconn.pyx":103
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr:
 *                 ptr = <long long><void *>self._pgconn_ptr             # <<<<<<<<<<<<<<
 *         return ptr if ptr != -1 else None
 * 
*/
          __pyx_v_ptr = ((PY_LONG_LONG)((void *)__pyx_v_self->_pgconn_ptr));

          /* "psycopg_c/pq/pgconn.pyx":102
 *         cdef long long ptr = -1
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr:             # <<<<<<<<<<<<<<
 *                 ptr = <long long><void *>self._pgconn_ptr
 *         return ptr if ptr != -1 else None
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":101
 *     def pgconn_ptr(self) -> int | None:
 *         cdef long long ptr = -1
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if self._pgconn_ptr:
 *                 ptr = <long long><void *>self._pgconn_ptr
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":104
 *             if self._pgconn_ptr:
 *                 ptr = <long long><void *>self._pgconn_ptr
 *         return ptr if ptr != -1 else None             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__pyx_v_ptr != -1LL);
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyLong_From_PY_LONG_LONG(__pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":98
 *                 self._pgconn_ptr = NULL
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def pgconn_ptr(self) -> int | None:
 *         cdef long long ptr = -1
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __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":106
 *         return ptr if ptr != -1 else None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def info(self) -> list[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts
*/

/* 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;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":110
 *         cdef libpq.PQconninfoOption *opts
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 opts = libpq.PQconninfo(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":111
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 opts = libpq.PQconninfo(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":112
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 opts = libpq.PQconninfo(pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_opts = PQconninfo(__pyx_v_pgconn_ptr);

          /* "psycopg_c/pq/pgconn.pyx":111
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 opts = libpq.PQconninfo(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":110
 *         cdef libpq.PQconninfoOption *opts
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 opts = libpq.PQconninfo(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":113
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 opts = libpq.PQconninfo(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if opts is NULL:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":114
 *                 opts = libpq.PQconninfo(pgconn_ptr)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if opts is NULL:
 *             raise MemoryError("couldn't allocate connection info")
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 114, __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, 114, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 114, __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, 114, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":113
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 opts = libpq.PQconninfo(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if opts is NULL:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":115
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if opts is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate connection info")
 *         rv = _options_from_array(opts)
*/
  __pyx_t_3 = (__pyx_v_opts == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":116
 *             raise e.OperationalError("the connection is closed")
 *         if opts is NULL:
 *             raise MemoryError("couldn't allocate connection info")             # <<<<<<<<<<<<<<
 *         rv = _options_from_array(opts)
 *         libpq.PQconninfoFree(opts)
*/
    __pyx_t_6 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_couldn_t_allocate_connection_inf};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 116, __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, 116, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":115
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if opts is NULL:             # <<<<<<<<<<<<<<
 *             raise MemoryError("couldn't allocate connection info")
 *         rv = _options_from_array(opts)
*/
  }

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

  /* "psycopg_c/pq/pgconn.pyx":118
 *             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":119
 *         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":106
 *         return ptr if ptr != -1 else None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def info(self) -> list[ConninfoOption]:
 *         cdef libpq.PQconninfoOption *opts
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_c.pq.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":121
 *         return rv
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
*/

/* 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) {
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);

  /* "psycopg_c/pq/pgconn.pyx":123
 *     def reset(self) -> None:
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 libpq.PQreset(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":124
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 libpq.PQreset(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":125
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 libpq.PQreset(pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          PQreset(__pyx_v_pgconn_ptr);

          /* "psycopg_c/pq/pgconn.pyx":124
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 libpq.PQreset(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":123
 *     def reset(self) -> None:
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 libpq.PQreset(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":126
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 libpq.PQreset(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":127
 *                 libpq.PQreset(pgconn_ptr)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 * 
 *     def reset_start(self) -> None:
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 127, __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, 127, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 127, __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, 127, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":126
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 libpq.PQreset(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 * 
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":121
 *         return rv
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(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_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":129
 *             raise e.OperationalError("the connection is closed")
 * 
 *     def reset_start(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/

/* 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) {
  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("reset_start", 0);

  /* "psycopg_c/pq/pgconn.pyx":131
 *     def reset_start(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQresetStart(self._pgconn_ptr)
 *         if not rv:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":132
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQresetStart(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError("couldn't reset connection")
*/
        __pyx_v_rv = PQresetStart(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":131
 *     def reset_start(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQresetStart(self._pgconn_ptr)
 *         if not rv:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":133
 *         with cython.critical_section(self):
 *             rv = libpq.PQresetStart(self._pgconn_ptr)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't reset connection")
 * 
*/
  __pyx_t_2 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":134
 *             rv = libpq.PQresetStart(self._pgconn_ptr)
 *         if not rv:
 *             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, 134, __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, 134, __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_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, 134, __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, 134, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":133
 *         with cython.critical_section(self):
 *             rv = libpq.PQresetStart(self._pgconn_ptr)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't reset connection")
 * 
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":129
 *             raise e.OperationalError("the connection is closed")
 * 
 *     def reset_start(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(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_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":136
 *             raise e.OperationalError("couldn't reset connection")
 * 
 *     def reset_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_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":137
 * 
 *     def reset_poll(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQresetPoll)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f)PQresetPoll)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 137, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_2, NULL, 0) < (0)) __PYX_ERR(1, 137, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":136
 *             raise e.OperationalError("couldn't reset connection")
 * 
 *     def reset_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_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":139
 *         return _call_libpq_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, 140, __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":141
 *     @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, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(1, 141, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":139
 *         return _call_libpq_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":143
 *         return libpq.PQping(conninfo)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def db(self) -> bytes:
 *         return _call_libpq_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
  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":145
 *     @property
 *     def db(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQdb)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_bytes(__pyx_v_self, PQdb); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 145, __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":143
 *         return libpq.PQping(conninfo)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def db(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQdb)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":147
 *         return _call_libpq_bytes(self, libpq.PQdb)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def user(self) -> bytes:
 *         return _call_libpq_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
  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":149
 *     @property
 *     def user(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQuser)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_bytes(__pyx_v_self, PQuser); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 149, __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":147
 *         return _call_libpq_bytes(self, libpq.PQdb)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def user(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQuser)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":151
 *         return _call_libpq_bytes(self, libpq.PQuser)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def password(self) -> bytes:
 *         return _call_libpq_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
  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":153
 *     @property
 *     def password(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQpass)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_bytes(__pyx_v_self, PQpass); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 153, __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":151
 *         return _call_libpq_bytes(self, libpq.PQuser)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def password(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQpass)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":155
 *         return _call_libpq_bytes(self, libpq.PQpass)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def host(self) -> bytes:
 *         return _call_libpq_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
  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":157
 *     @property
 *     def host(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQhost)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_bytes(__pyx_v_self, PQhost); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __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":155
 *         return _call_libpq_bytes(self, libpq.PQpass)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def host(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQhost)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":159
 *         return _call_libpq_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;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":161
 *     @property
 *     def hostaddr(self) -> bytes:
 *         _check_supported("PQhostaddr", 120000)             # <<<<<<<<<<<<<<
 *         cdef char *rv = NULL
 *         cdef libpq.PGconn *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, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":162
 *     def hostaddr(self) -> bytes:
 *         _check_supported("PQhostaddr", 120000)
 *         cdef char *rv = NULL             # <<<<<<<<<<<<<<
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
*/
  __pyx_v_rv = NULL;

  /* "psycopg_c/pq/pgconn.pyx":164
 *         cdef char *rv = NULL
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":165
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":166
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQhostaddr(pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQhostaddr(__pyx_v_pgconn_ptr);

          /* "psycopg_c/pq/pgconn.pyx":165
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":164
 *         cdef char *rv = NULL
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":167
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         assert rv is not NULL
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":168
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         assert rv is not NULL
 *         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, 168, __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, 168, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 168, __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, 168, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":167
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQhostaddr(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         assert rv is not NULL
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":169
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         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, 169, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(1, 169, __pyx_L1_error)
  #endif

  /* "psycopg_c/pq/pgconn.pyx":170
 *             raise e.OperationalError("the connection is closed")
 *         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, 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":159
 *         return _call_libpq_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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":172
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def port(self) -> bytes:
 *         return _call_libpq_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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":176
 *         return _call_libpq_bytes(self, libpq.PQport)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def tty(self) -> bytes:
 *         return _call_libpq_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
  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":178
 *     @property
 *     def tty(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQtty)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_bytes(__pyx_v_self, PQtty); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 178, __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":176
 *         return _call_libpq_bytes(self, libpq.PQport)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def tty(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQtty)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":180
 *         return _call_libpq_bytes(self, libpq.PQtty)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def options(self) -> bytes:
 *         return _call_libpq_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
  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 options(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQoptions)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_bytes(__pyx_v_self, PQoptions); 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 _call_libpq_bytes(self, libpq.PQtty)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def options(self) -> bytes:
 *         return _call_libpq_bytes(self, libpq.PQoptions)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":184
 *         return _call_libpq_bytes(self, libpq.PQoptions)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         cdef libpq.ConnStatusType rv
*/

/* 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) {
  ConnStatusType __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("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":187
 *     def status(self) -> int:
 *         cdef libpq.ConnStatusType rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQstatus(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":188
 *         cdef libpq.ConnStatusType rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQstatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
        __pyx_v_rv = PQstatus(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":187
 *     def status(self) -> int:
 *         cdef libpq.ConnStatusType rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQstatus(self._pgconn_ptr)
 *         return rv
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":189
 *         with cython.critical_section(self):
 *             rv = libpq.PQstatus(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_ConnStatusType(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 189, __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":184
 *         return _call_libpq_bytes(self, libpq.PQoptions)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def status(self) -> int:
 *         cdef libpq.ConnStatusType rv
*/

  /* 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":191
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def transaction_status(self) -> int:
 *         cdef libpq.PGTransactionStatusType rv
*/

/* 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) {
  PGTransactionStatusType __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("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":194
 *     def transaction_status(self) -> int:
 *         cdef libpq.PGTransactionStatusType rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQtransactionStatus(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":195
 *         cdef libpq.PGTransactionStatusType rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQtransactionStatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
        __pyx_v_rv = PQtransactionStatus(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":194
 *     def transaction_status(self) -> int:
 *         cdef libpq.PGTransactionStatusType rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQtransactionStatus(self._pgconn_ptr)
 *         return rv
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":196
 *         with cython.critical_section(self):
 *             rv = libpq.PQtransactionStatus(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_PGTransactionStatusType(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __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":191
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def transaction_status(self) -> int:
 *         cdef libpq.PGTransactionStatusType rv
*/

  /* 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":198
 *         return rv
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef const char *rv = <const char *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQparameterStatus, 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, 198, __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
  void *__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":199
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:
 *         cdef const char *rv = <const char *>_call_libpq_with_param(             # <<<<<<<<<<<<<<
 *             self, <conn_f_with_param>libpq.PQparameterStatus, name)
 *         if rv is not NULL:
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_with_param(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_f_with_param)PQparameterStatus), __pyx_v_name); if (unlikely(__pyx_t_1 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 199, __pyx_L1_error)
  __pyx_v_rv = ((char const *)__pyx_t_1);

  /* "psycopg_c/pq/pgconn.pyx":201
 *         cdef const char *rv = <const char *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQparameterStatus, 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":202
 *             self, <conn_f_with_param>libpq.PQparameterStatus, 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, 202, __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":201
 *         cdef const char *rv = <const char *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQparameterStatus, name)
 *         if rv is not NULL:             # <<<<<<<<<<<<<<
 *             return rv
 *         else:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":204
 *             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":198
 *         return rv
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef const char *rv = <const char *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQparameterStatus, 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":206
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         cdef char *rv
*/

/* 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) {
  char *__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("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":209
 *     def error_message(self) -> bytes:
 *         cdef char *rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQerrorMessage(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":210
 *         cdef char *rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQerrorMessage(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
        __pyx_v_rv = PQerrorMessage(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":209
 *     def error_message(self) -> bytes:
 *         cdef char *rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQerrorMessage(self._pgconn_ptr)
 *         return rv
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":211
 *         with cython.critical_section(self):
 *             rv = libpq.PQerrorMessage(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def get_error_message(self, encoding: str = "") -> str:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 211, __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":206
 *             return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def error_message(self) -> bytes:
 *         cdef char *rv
*/

  /* 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":213
 *         return rv
 * 
 *     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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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, 213, __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":214
 * 
 *     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, 214, __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, 214, __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, 214, __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, 214, __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, 214, __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, 214, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":213
 *         return rv
 * 
 *     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":216
 *         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;
  int __pyx_v_status;
  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("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":220
 *         cdef const char *pgenc
 *         cdef int status
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             status = libpq.PQstatus(self._pgconn_ptr)
 *             if status == libpq.CONNECTION_OK:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":221
 *         cdef int status
 *         with cython.critical_section(self):
 *             status = libpq.PQstatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *             if status == libpq.CONNECTION_OK:
 *                 pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
*/
        __pyx_v_status = PQstatus(__pyx_v_self->_pgconn_ptr);

        /* "psycopg_c/pq/pgconn.pyx":222
 *         with cython.critical_section(self):
 *             status = libpq.PQstatus(self._pgconn_ptr)
 *             if status == libpq.CONNECTION_OK:             # <<<<<<<<<<<<<<
 *                 pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *                 if pgenc is NULL:
*/
        __pyx_t_2 = (__pyx_v_status == CONNECTION_OK);
        if (__pyx_t_2) {

          /* "psycopg_c/pq/pgconn.pyx":223
 *             status = libpq.PQstatus(self._pgconn_ptr)
 *             if status == 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":224
 *             if status == libpq.CONNECTION_OK:
 *                 pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *                 if pgenc is NULL:             # <<<<<<<<<<<<<<
 *                     pgenc = b"UTF8"
 *         if status == libpq.CONNECTION_OK:
*/
          __pyx_t_2 = (__pyx_v_pgenc == NULL);
          if (__pyx_t_2) {

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

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

          /* "psycopg_c/pq/pgconn.pyx":222
 *         with cython.critical_section(self):
 *             status = libpq.PQstatus(self._pgconn_ptr)
 *             if status == libpq.CONNECTION_OK:             # <<<<<<<<<<<<<<
 *                 pgenc = libpq.PQparameterStatus(self._pgconn_ptr, b"client_encoding")
 *                 if pgenc is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":220
 *         cdef const char *pgenc
 *         cdef int status
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             status = libpq.PQstatus(self._pgconn_ptr)
 *             if status == libpq.CONNECTION_OK:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":226
 *                 if pgenc is NULL:
 *                     pgenc = b"UTF8"
 *         if status == libpq.CONNECTION_OK:             # <<<<<<<<<<<<<<
 *             return pg2pyenc(pgenc)
 *         else:
*/
  __pyx_t_2 = (__pyx_v_status == CONNECTION_OK);
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":227
 *                     pgenc = b"UTF8"
 *         if status == libpq.CONNECTION_OK:
 *             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, 227, __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, 227, __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_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_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_1)) __PYX_ERR(1, 227, __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":226
 *                 if pgenc is NULL:
 *                     pgenc = b"UTF8"
 *         if status == libpq.CONNECTION_OK:             # <<<<<<<<<<<<<<
 *             return pg2pyenc(pgenc)
 *         else:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":229
 *             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":216
 *         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_1);
  __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":231
 *             return "utf-8"
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def protocol_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>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":233
 *     @property
 *     def protocol_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQprotocolVersion)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f)PQprotocolVersion)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 233, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __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":231
 *             return "utf-8"
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def protocol_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>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":235
 *         return _call_libpq_int(self, <conn_int_f>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) {
  int __pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":237
 *     @property
 *     def full_protocol_version(self) -> int:
 *         _check_supported("PQfullProtocolVersion", 180000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *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, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":240
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":241
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":242
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQfullProtocolVersion(__pyx_v_pgconn_ptr);

          /* "psycopg_c/pq/pgconn.pyx":241
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":240
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":243
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         return rv
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":244
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         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, 244, __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, 244, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 244, __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, 244, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":243
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQfullProtocolVersion(pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         return rv
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":245
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         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, 245, __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":235
 *         return _call_libpq_int(self, <conn_int_f>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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":247
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def server_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>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":249
 *     @property
 *     def server_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQserverVersion)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f)PQserverVersion)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 249, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __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":247
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def server_version(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>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":251
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQserverVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def socket(self) -> int:
 *         cdef int rv = _call_libpq_int(self, <conn_int_f>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":253
 *     @property
 *     def socket(self) -> int:
 *         cdef int rv = _call_libpq_int(self, <conn_int_f>libpq.PQsocket)             # <<<<<<<<<<<<<<
 *         if rv == -1:
 *             raise e.OperationalError("the connection is lost")
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f)PQsocket)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 253, __pyx_L1_error)
  __pyx_v_rv = __pyx_t_1;

  /* "psycopg_c/pq/pgconn.pyx":254
 *     def socket(self) -> int:
 *         cdef int rv = _call_libpq_int(self, <conn_int_f>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":255
 *         cdef int rv = _call_libpq_int(self, <conn_int_f>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, 255, __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, 255, __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, 255, __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, 255, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":256
 *         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, 256, __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":251
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQserverVersion)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def socket(self) -> int:
 *         cdef int rv = _call_libpq_int(self, <conn_int_f>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":258
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def backend_pid(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>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":260
 *     @property
 *     def backend_pid(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQbackendPID)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_int(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f)PQbackendPID)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 260, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 260, __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":258
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def backend_pid(self) -> int:
 *         return _call_libpq_int(self, <conn_int_f>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":262
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQbackendPID)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def needs_password(self) -> bool:
 *         cdef int rv
*/

/* 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) {
  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("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":265
 *     def needs_password(self) -> bool:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionNeedsPassword(self._pgconn_ptr)
 *         return bool(rv)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":266
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionNeedsPassword(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return bool(rv)
 * 
*/
        __pyx_v_rv = PQconnectionNeedsPassword(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":265
 *     def needs_password(self) -> bool:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionNeedsPassword(self._pgconn_ptr)
 *         return bool(rv)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":267
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionNeedsPassword(self._pgconn_ptr)
 *         return bool(rv)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!(__pyx_v_rv != 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 267, __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":262
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQbackendPID)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def needs_password(self) -> bool:
 *         cdef int rv
*/

  /* 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":269
 *         return bool(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def used_password(self) -> bool:
 *         cdef int rv
*/

/* 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) {
  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("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":272
 *     def used_password(self) -> bool:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionUsedPassword(self._pgconn_ptr)
 *         return bool(rv)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":273
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionUsedPassword(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return bool(rv)
 * 
*/
        __pyx_v_rv = PQconnectionUsedPassword(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":272
 *     def used_password(self) -> bool:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionUsedPassword(self._pgconn_ptr)
 *         return bool(rv)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":274
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionUsedPassword(self._pgconn_ptr)
 *         return bool(rv)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!(__pyx_v_rv != 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 274, __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":269
 *         return bool(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def used_password(self) -> bool:
 *         cdef int rv
*/

  /* 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":276
 *         return bool(rv)
 * 
 *     @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) {
  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("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":278
 *     @property
 *     def used_gssapi(self) -> bool:
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __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, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":280
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionUsedGSSAPI(self._pgconn_ptr)
 *         return bool(rv)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":281
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionUsedGSSAPI(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return bool(rv)
 * 
*/
        __pyx_v_rv = PQconnectionUsedGSSAPI(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":280
 *         _check_supported("PQconnectionUsedGSSAPI", 160000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconnectionUsedGSSAPI(self._pgconn_ptr)
 *         return bool(rv)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":282
 *         with cython.critical_section(self):
 *             rv = libpq.PQconnectionUsedGSSAPI(self._pgconn_ptr)
 *         return bool(rv)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!(__pyx_v_rv != 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 282, __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":276
 *         return bool(rv)
 * 
 *     @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":284
 *         return bool(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ssl_in_use(self) -> bool:
 *         return bool(_call_libpq_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":286
 *     @property
 *     def ssl_in_use(self) -> bool:
 *         return bool(_call_libpq_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_libpq_int(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f)PQsslInUse)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 286, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong((!(!(__pyx_t_1 != 0)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 286, __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":284
 *         return bool(rv)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ssl_in_use(self) -> bool:
 *         return bool(_call_libpq_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":288
 *         return bool(_call_libpq_int(self, <conn_int_f>libpq.PQsslInUse))
 * 
 *     def exec_(self, const char *command) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         cdef libpq.PGconn *pgconn_ptr
*/

/* 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, 288, __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;
  PGconn *__pyx_v_pgconn_ptr;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_", 0);

  /* "psycopg_c/pq/pgconn.pyx":291
 *         cdef libpq.PGresult *pgresult
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_c/pq/pgconn.pyx":292
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
*/
              __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
              __pyx_v_pgconn_ptr = __pyx_t_2;
              __pyx_t_3 = (__pyx_t_2 != NULL);
              if (__pyx_t_3) {

                /* "psycopg_c/pq/pgconn.pyx":293
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
                __pyx_v_pgresult = PQexec(__pyx_v_pgconn_ptr, __pyx_v_command);

                /* "psycopg_c/pq/pgconn.pyx":292
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
*/
              }
            }

            /* "psycopg_c/pq/pgconn.pyx":291
 *         cdef libpq.PGresult *pgresult
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":294
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":295
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if pgresult is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 295, __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, 295, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 295, __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, 295, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":294
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexec(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":296
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  __pyx_t_3 = (__pyx_v_pgresult == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":297
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"executing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(pgresult)
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 297, __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, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

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

    /* "psycopg_c/pq/pgconn.pyx":296
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":299
 *             raise e.OperationalError(
 *                 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_1 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_pgresult)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 299, __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":288
 *         return bool(_call_libpq_int(self, <conn_int_f>libpq.PQsslInUse))
 * 
 *     def exec_(self, const char *command) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         cdef libpq.PGconn *pgconn_ptr
*/

  /* 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_8);
  __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":301
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query(self, const char *command) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/

/* 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, 301, __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;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query", 0);

  /* "psycopg_c/pq/pgconn.pyx":304
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_c/pq/pgconn.pyx":305
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
*/
              __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
              __pyx_v_pgconn_ptr = __pyx_t_2;
              __pyx_t_3 = (__pyx_t_2 != NULL);
              if (__pyx_t_3) {

                /* "psycopg_c/pq/pgconn.pyx":306
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
                __pyx_v_rv = PQsendQuery(__pyx_v_pgconn_ptr, __pyx_v_command);

                /* "psycopg_c/pq/pgconn.pyx":305
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
*/
              }
            }

            /* "psycopg_c/pq/pgconn.pyx":304
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":307
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":308
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 308, __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, 308, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 308, __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, 308, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":307
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQuery(pgconn_ptr, command)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":309
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query failed: {self.get_error_message()}")
*/
  __pyx_t_3 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":310
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending query failed: {self.get_error_message()}")
 * 
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 310, __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, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

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

    /* "psycopg_c/pq/pgconn.pyx":309
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":301
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query(self, const char *command) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __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":313
 *                 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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":317
 *         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":318
 *         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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 313, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "psycopg_c/pq/pgconn.pyx":317
 *         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":318
 *         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, 315, __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, 319, __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, 313, __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":313
 *                 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;
  PGconn *__pyx_v_pgconn_ptr;
  PGresult *__pyx_v_pgresult;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Oid *__pyx_t_3;
  char *const *__pyx_t_4;
  int *__pyx_t_5;
  int *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PGconn *__pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_params", 0);

  /* "psycopg_c/pq/pgconn.pyx":326
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, param_types, param_formats)
 * 
*/
  __pyx_t_1 = __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, 326, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1.f0;
  __pyx_t_3 = __pyx_t_1.f1;
  __pyx_t_4 = __pyx_t_1.f2;
  __pyx_t_5 = __pyx_t_1.f3;
  __pyx_t_6 = __pyx_t_1.f4;
  __pyx_v_cnparams = __pyx_t_2;
  __pyx_v_ctypes = __pyx_t_3;
  __pyx_v_cvalues = __pyx_t_4;
  __pyx_v_clengths = __pyx_t_5;
  __pyx_v_cformats = __pyx_t_6;

  /* "psycopg_c/pq/pgconn.pyx":331
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexecParams(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_7);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_c/pq/pgconn.pyx":332
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 pgresult = libpq.PQexecParams(
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;
              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_9 = (__pyx_t_8 != NULL);
              if (__pyx_t_9) {

                /* "psycopg_c/pq/pgconn.pyx":333
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexecParams(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
*/
                __pyx_v_pgresult = PQexecParams(__pyx_v_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":332
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 pgresult = libpq.PQexecParams(
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
*/
              }
            }

            /* "psycopg_c/pq/pgconn.pyx":331
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 pgresult = libpq.PQexecParams(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":336
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
  __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, 336, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":337
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
*/
  __pyx_t_9 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_9)) {

    /* "psycopg_c/pq/pgconn.pyx":338
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if pgresult is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 338, __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, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_13 = 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_13 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 338, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":337
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":339
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  __pyx_t_9 = (__pyx_v_pgresult == NULL);
  if (unlikely(__pyx_t_9)) {

    /* "psycopg_c/pq/pgconn.pyx":340
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"executing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(pgresult)
*/
    __pyx_t_12 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 340, __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(1, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

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

    /* "psycopg_c/pq/pgconn.pyx":339
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing query failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":342
 *             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_7 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_pgresult)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_7);
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":313
 *                 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_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __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":344
 *         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, 344, __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, 344, __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, 344, __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, 344, __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, 344, __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, 344, __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, 344, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":348
 *         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":349
 *         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, 344, __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, 344, __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, 344, __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, 344, __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, 344, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 344, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "psycopg_c/pq/pgconn.pyx":348
 *         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":349
 *         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, 346, __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, 350, __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, 344, __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":344
 *         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;
  PGconn *__pyx_v_pgconn_ptr;
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Oid *__pyx_t_3;
  char *const *__pyx_t_4;
  int *__pyx_t_5;
  int *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PGconn *__pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query_params", 0);

  /* "psycopg_c/pq/pgconn.pyx":357
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, param_types, param_formats)
 * 
*/
  __pyx_t_1 = __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, 357, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1.f0;
  __pyx_t_3 = __pyx_t_1.f1;
  __pyx_t_4 = __pyx_t_1.f2;
  __pyx_t_5 = __pyx_t_1.f3;
  __pyx_t_6 = __pyx_t_1.f4;
  __pyx_v_cnparams = __pyx_t_2;
  __pyx_v_ctypes = __pyx_t_3;
  __pyx_v_cvalues = __pyx_t_4;
  __pyx_v_clengths = __pyx_t_5;
  __pyx_v_cformats = __pyx_t_6;

  /* "psycopg_c/pq/pgconn.pyx":362
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryParams(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_7);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_c/pq/pgconn.pyx":363
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQueryParams(
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;
              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_9 = (__pyx_t_8 != NULL);
              if (__pyx_t_9) {

                /* "psycopg_c/pq/pgconn.pyx":364
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryParams(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
*/
                __pyx_v_rv = PQsendQueryParams(__pyx_v_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":363
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQueryParams(
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
*/
              }
            }

            /* "psycopg_c/pq/pgconn.pyx":362
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryParams(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":367
 *                     pgconn_ptr, command, <int>cnparams, ctypes,
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
  __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, 367, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":368
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_9 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_9)) {

    /* "psycopg_c/pq/pgconn.pyx":369
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 369, __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, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_13 = 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_13 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 369, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":368
 *                     <const char *const *>cvalues, clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":370
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"
*/
  __pyx_t_9 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_9)) {

    /* "psycopg_c/pq/pgconn.pyx":371
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending query and params failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_12 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 371, __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(1, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

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

    /* "psycopg_c/pq/pgconn.pyx":370
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":344
 *         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_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __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":375
 *             )
 * 
 *     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, 375, __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, 375, __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, 375, __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, 375, __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, 375, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":379
 *         const char *name,
 *         const char *command,
 *         param_types: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         cdef int i
*/
      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, 375, __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, 375, __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, 375, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 375, __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, 377, __pyx_L3_error)
    __pyx_v_command = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 378, __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, 375, __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":375
 *             )
 * 
 *     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;
  PGconn *__pyx_v_pgconn_ptr;
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6;
  Oid __pyx_t_7;
  PGconn *__pyx_t_8;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_prepare", 0);

  /* "psycopg_c/pq/pgconn.pyx":383
 *         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":384
 *         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_1 = (__pyx_v_param_types != Py_None);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":385
 *         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 = PySequence_Fast(__pyx_v_param_types, ((char *)"'param_types' is not a sequence")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_types_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_c/pq/pgconn.pyx":386
 *         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":384
 *         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":388
 *             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":389
 * 
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
*/
  __pyx_t_1 = (__pyx_v_nparams != 0);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":390
 *         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":391
 *         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_3 = __pyx_v_nparams;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "psycopg_c/pq/pgconn.pyx":392
 *             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.PGconn *pgconn_ptr
*/
      if (unlikely(!__pyx_v_types_fast)) { __Pyx_RaiseUnboundLocalError("types_fast"); __PYX_ERR(1, 392, __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, 392, __pyx_L1_error)
      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_7;
    }

    /* "psycopg_c/pq/pgconn.pyx":389
 * 
 *         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":396
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendPrepare(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_c/pq/pgconn.pyx":397
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendPrepare(
 *                     pgconn_ptr, name, command, <int>nparams, atypes
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;
              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_1 = (__pyx_t_8 != NULL);
              if (__pyx_t_1) {

                /* "psycopg_c/pq/pgconn.pyx":398
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendPrepare(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, name, command, <int>nparams, atypes
 *                 )
*/
                __pyx_v_rv = PQsendPrepare(__pyx_v_pgconn_ptr, __pyx_v_name, __pyx_v_command, ((int)__pyx_v_nparams), __pyx_v_atypes);

                /* "psycopg_c/pq/pgconn.pyx":397
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendPrepare(
 *                     pgconn_ptr, name, command, <int>nparams, atypes
*/
              }
            }

            /* "psycopg_c/pq/pgconn.pyx":396
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendPrepare(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L12;
              }
              __pyx_L12:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":401
 *                     pgconn_ptr, name, command, <int>nparams, atypes
 *                 )
 *         PyMem_Free(atypes)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
  PyMem_Free(__pyx_v_atypes);

  /* "psycopg_c/pq/pgconn.pyx":402
 *                 )
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_1 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":403
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 403, __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(1, 403, __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_the_connection_is_closed};
      __pyx_t_2 = __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_2)) __PYX_ERR(1, 403, __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, 403, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":402
 *                 )
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":404
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"
*/
  __pyx_t_1 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":405
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending query and params failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_11 = 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 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_12 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, 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_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __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_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_12 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
      assert(__pyx_t_11);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
      __pyx_t_12 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9};
      __pyx_t_2 = __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_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 405, __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, 405, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":404
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending query and params failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":375
 *             )
 * 
 *     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_2);
  __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.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":409
 *             )
 * 
 *     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, 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, "send_query_prepared", 0) < (0)) __PYX_ERR(1, 409, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":413
 *         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, 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__8;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("send_query_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.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":409
 *             )
 * 
 *     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;
  PGconn *__pyx_v_pgconn_ptr;
  int __pyx_v_rv;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Oid *__pyx_t_3;
  char *const *__pyx_t_4;
  int *__pyx_t_5;
  int *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PGconn *__pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_query_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":421
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, None, param_formats)
 * 
*/
  __pyx_t_1 = __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, 421, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1.f0;
  __pyx_t_3 = __pyx_t_1.f1;
  __pyx_t_4 = __pyx_t_1.f2;
  __pyx_t_5 = __pyx_t_1.f3;
  __pyx_t_6 = __pyx_t_1.f4;
  __pyx_v_cnparams = __pyx_t_2;
  __pyx_v_ctypes = __pyx_t_3;
  __pyx_v_cvalues = __pyx_t_4;
  __pyx_v_clengths = __pyx_t_5;
  __pyx_v_cformats = __pyx_t_6;

  /* "psycopg_c/pq/pgconn.pyx":426
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryPrepared(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_7);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_c/pq/pgconn.pyx":427
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQueryPrepared(
 *                     pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;
              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_9 = (__pyx_t_8 != NULL);
              if (__pyx_t_9) {

                /* "psycopg_c/pq/pgconn.pyx":428
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryPrepared(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
 *                     clengths, cformats, result_format)
*/
                __pyx_v_rv = PQsendQueryPrepared(__pyx_v_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 int rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendQueryPrepared(
 *                     pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
*/
              }
            }

            /* "psycopg_c/pq/pgconn.pyx":426
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendQueryPrepared(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":431
 *                     pgconn_ptr, name, <int>cnparams, <const char *const *>cvalues,
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
  __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, 431, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":432
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_9 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_9)) {

    /* "psycopg_c/pq/pgconn.pyx":433
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 433, __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, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_13 = 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_13 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 433, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":432
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":434
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending prepared query failed: {self.get_error_message()}"
*/
  __pyx_t_9 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_9)) {

    /* "psycopg_c/pq/pgconn.pyx":435
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending prepared query failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_12 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 435, __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(1, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

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

    /* "psycopg_c/pq/pgconn.pyx":434
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending prepared query failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":409
 *             )
 * 
 *     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_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __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":439
 *             )
 * 
 *     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, 439, __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, 439, __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, 439, __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, 439, __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, 439, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":443
 *         const char *name,
 *         const char *command,
 *         param_types: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         cdef int i
*/
      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, 439, __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, 439, __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, 439, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 439, __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, 441, __pyx_L3_error)
    __pyx_v_command = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_command) && PyErr_Occurred())) __PYX_ERR(1, 442, __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, 439, __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":439
 *             )
 * 
 *     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;
  PGconn *__pyx_v_pgconn_ptr;
  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;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6;
  Oid __pyx_t_7;
  PGconn *__pyx_t_8;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prepare", 0);

  /* "psycopg_c/pq/pgconn.pyx":447
 *         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":448
 *         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_1 = (__pyx_v_param_types != Py_None);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":449
 *         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 = PySequence_Fast(__pyx_v_param_types, ((char *)"'param_types' is not a sequence")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_types_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_c/pq/pgconn.pyx":450
 *         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":448
 *         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":452
 *             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":453
 * 
 *         cdef libpq.Oid *atypes = NULL
 *         if nparams:             # <<<<<<<<<<<<<<
 *             atypes = <libpq.Oid *>PyMem_Malloc(nparams * sizeof(libpq.Oid))
 *             for i in range(nparams):
*/
  __pyx_t_1 = (__pyx_v_nparams != 0);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":454
 *         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":455
 *         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_3 = __pyx_v_nparams;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "psycopg_c/pq/pgconn.pyx":456
 *             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.PGconn *pgconn_ptr
*/
      if (unlikely(!__pyx_v_types_fast)) { __Pyx_RaiseUnboundLocalError("types_fast"); __PYX_ERR(1, 456, __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, 456, __pyx_L1_error)
      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_7;
    }

    /* "psycopg_c/pq/pgconn.pyx":453
 * 
 *         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":460
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQprepare(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_c/pq/pgconn.pyx":461
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQprepare(
 *                     pgconn_ptr, name, command, <int>nparams, atypes)
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;
              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_1 = (__pyx_t_8 != NULL);
              if (__pyx_t_1) {

                /* "psycopg_c/pq/pgconn.pyx":462
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQprepare(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)
*/
                __pyx_v_rv = PQprepare(__pyx_v_pgconn_ptr, __pyx_v_name, __pyx_v_command, ((int)__pyx_v_nparams), __pyx_v_atypes);

                /* "psycopg_c/pq/pgconn.pyx":461
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQprepare(
 *                     pgconn_ptr, name, command, <int>nparams, atypes)
*/
              }
            }

            /* "psycopg_c/pq/pgconn.pyx":460
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQprepare(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L12;
              }
              __pyx_L12:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L9;
        }
        __pyx_L9:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

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

  /* "psycopg_c/pq/pgconn.pyx":465
 *                     pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  __pyx_t_1 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":466
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 466, __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(1, 466, __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_the_connection_is_closed};
      __pyx_t_2 = __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_2)) __PYX_ERR(1, 466, __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, 466, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":465
 *                     pgconn_ptr, name, command, <int>nparams, atypes)
 *         PyMem_Free(atypes)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":467
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"preparing query failed: {self.get_error_message()}")
*/
  __pyx_t_1 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "psycopg_c/pq/pgconn.pyx":468
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"preparing query failed: {self.get_error_message()}")
 *         return PGresult._from_ptr(rv)
*/
    __pyx_t_11 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 468, __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, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "psycopg_c/pq/pgconn.pyx":469
 *         if rv is NULL:
 *             raise e.OperationalError(
 *                 f"preparing 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_12 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, 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_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __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_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_12 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
      assert(__pyx_t_11);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
      __pyx_t_12 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9};
      __pyx_t_2 = __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_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 468, __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, 468, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":467
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"preparing query failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":470
 *             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_2 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 470, __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":439
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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.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":472
 *         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, 472, __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, 472, __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, 472, __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, 472, __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, 472, __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, 472, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":476
 *         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, 472, __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, 472, __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, 472, __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, 472, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 472, __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, 474, __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, 477, __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, 472, __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":472
 *         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;
  PGconn *__pyx_v_pgconn_ptr;
  PGresult *__pyx_v_rv;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_ctuple_9512b6__Py_ssize_t__and_Oid__ptr__and_char__ptrconst____etc __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Oid *__pyx_t_3;
  char *const *__pyx_t_4;
  int *__pyx_t_5;
  int *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PGconn *__pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("exec_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":484
 *         cdef int *clengths
 *         cdef int *cformats
 *         cnparams, ctypes, cvalues, clengths, cformats = _query_params_args(             # <<<<<<<<<<<<<<
 *             param_values, None, param_formats)
 * 
*/
  __pyx_t_1 = __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, 484, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1.f0;
  __pyx_t_3 = __pyx_t_1.f1;
  __pyx_t_4 = __pyx_t_1.f2;
  __pyx_t_5 = __pyx_t_1.f3;
  __pyx_t_6 = __pyx_t_1.f4;
  __pyx_v_cnparams = __pyx_t_2;
  __pyx_v_ctypes = __pyx_t_3;
  __pyx_v_cvalues = __pyx_t_4;
  __pyx_v_clengths = __pyx_t_5;
  __pyx_v_cformats = __pyx_t_6;

  /* "psycopg_c/pq/pgconn.pyx":489
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQexecPrepared(
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_7);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_c/pq/pgconn.pyx":490
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQexecPrepared(
 *                     pgconn_ptr, name, <int>cnparams,
*/
              __pyx_t_8 = __pyx_v_self->_pgconn_ptr;
              __pyx_v_pgconn_ptr = __pyx_t_8;
              __pyx_t_9 = (__pyx_t_8 != NULL);
              if (__pyx_t_9) {

                /* "psycopg_c/pq/pgconn.pyx":491
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQexecPrepared(             # <<<<<<<<<<<<<<
 *                     pgconn_ptr, name, <int>cnparams,
 *                     <const char *const *>cvalues,
*/
                __pyx_v_rv = PQexecPrepared(__pyx_v_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":490
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQexecPrepared(
 *                     pgconn_ptr, name, <int>cnparams,
*/
              }
            }

            /* "psycopg_c/pq/pgconn.pyx":489
 *         cdef libpq.PGconn *pgconn_ptr
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQexecPrepared(
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":495
 *                     <const char *const *>cvalues,
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
  __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, 495, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":496
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  __pyx_t_9 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_9)) {

    /* "psycopg_c/pq/pgconn.pyx":497
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 497, __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, 497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_13 = 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_13 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_the_connection_is_closed};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 497, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(1, 497, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":496
 *                     clengths, cformats, result_format)
 *         _clear_query_params(ctypes, cvalues, clengths, cformats)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":498
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing prepared query failed: {self.get_error_message()}"
*/
  __pyx_t_9 = (__pyx_v_rv == NULL);
  if (unlikely(__pyx_t_9)) {

    /* "psycopg_c/pq/pgconn.pyx":499
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"executing prepared query failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_12 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 499, __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(1, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

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

    /* "psycopg_c/pq/pgconn.pyx":498
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"executing prepared query failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":502
 *                 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_7 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_rv)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGresult *)__pyx_t_7);
  __pyx_t_7 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __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":504
 *         return PGresult._from_ptr(rv)
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, 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, 504, __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
  void *__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":505
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(             # <<<<<<<<<<<<<<
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, name)
 *         if rv is NULL:
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_with_param(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_f_with_param)PQdescribePrepared), __pyx_v_name); if (unlikely(__pyx_t_1 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 505, __pyx_L1_error)
  __pyx_v_rv = ((PGresult *)__pyx_t_1);

  /* "psycopg_c/pq/pgconn.pyx":507
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, 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":508
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, 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, 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 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, 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_describe_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_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, 508, __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, 508, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":511
 *                 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, 511, __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":504
 *         return PGresult._from_ptr(rv)
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, 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":513
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, 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, 513, __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":514
 * 
 *     def send_describe_prepared(self, const char *name) -> None:
 *         cdef int rv = _call_libpq_int_with_param(             # <<<<<<<<<<<<<<
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, name)
 *         if not rv:
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_int_with_param(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f_with_param)PQsendDescribePrepared), __pyx_v_name); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 514, __pyx_L1_error)
  __pyx_v_rv = __pyx_t_1;

  /* "psycopg_c/pq/pgconn.pyx":516
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, 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":517
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, 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, 517, __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, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":518
 *         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, 518, __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, 518, __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, 518, __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, 517, __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, 517, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":513
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, 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":521
 *             )
 * 
 *     def describe_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePortal, 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, 521, __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
  void *__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":522
 * 
 *     def describe_portal(self, const char *name) -> PGresult:
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(             # <<<<<<<<<<<<<<
 *             self, <conn_f_with_param>libpq.PQdescribePortal, name)
 *         if rv is NULL:
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_with_param(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_f_with_param)PQdescribePortal), __pyx_v_name); if (unlikely(__pyx_t_1 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 522, __pyx_L1_error)
  __pyx_v_rv = ((PGresult *)__pyx_t_1);

  /* "psycopg_c/pq/pgconn.pyx":524
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePortal, 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":525
 *             self, <conn_f_with_param>libpq.PQdescribePortal, 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, 525, __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, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":526
 *         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, 526, __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, 526, __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, 526, __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, 525, __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, 525, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":528
 *                 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, 528, __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":521
 *             )
 * 
 *     def describe_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePortal, 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":530
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, 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, 530, __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":531
 * 
 *     def send_describe_portal(self, const char *name) -> None:
 *         cdef int rv = _call_libpq_int_with_param(             # <<<<<<<<<<<<<<
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, name)
 *         if not rv:
*/
  __pyx_t_1 = __pyx_f_9psycopg_c_2pq__call_libpq_int_with_param(__pyx_v_self, ((__pyx_t_9psycopg_c_2pq_conn_int_f_with_param)PQsendDescribePortal), __pyx_v_name); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 531, __pyx_L1_error)
  __pyx_v_rv = __pyx_t_1;

  /* "psycopg_c/pq/pgconn.pyx":533
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, 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":534
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, 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, 534, __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, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":535
 *         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, 535, __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, 535, __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, 535, __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, 534, __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, 534, __pyx_L1_error)

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

  /* "psycopg_c/pq/pgconn.pyx":530
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, 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":538
 *             )
 * 
 *     def close_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePrepared", 170000)
 *         cdef libpq.PGresult *rv
*/

/* 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, 538, __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;
  PGconn *__pyx_v_pgconn_ptr;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":539
 * 
 *     def close_prepared(self, const char *name) -> PGresult:
 *         _check_supported("PQclosePrepared", 170000)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __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, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":542
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":543
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":544
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQclosePrepared(__pyx_v_pgconn_ptr, __pyx_v_name);

          /* "psycopg_c/pq/pgconn.pyx":543
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":542
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":545
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":546
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 546, __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, 546, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 546, __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, 546, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":545
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":547
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         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":548
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 548, __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, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

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

    /* "psycopg_c/pq/pgconn.pyx":547
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":551
 *                 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, 551, __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":538
 *             )
 * 
 *     def close_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePrepared", 170000)
 *         cdef libpq.PGresult *rv
*/

  /* 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_8);
  __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":553
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePrepared", 170000)
 *         cdef int rv
*/

/* 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, 553, __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;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_close_prepared", 0);

  /* "psycopg_c/pq/pgconn.pyx":554
 * 
 *     def send_close_prepared(self, const char *name) -> None:
 *         _check_supported("PQsendClosePrepared", 170000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __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, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":557
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":558
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":559
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQsendClosePrepared(__pyx_v_pgconn_ptr, __pyx_v_name);

          /* "psycopg_c/pq/pgconn.pyx":558
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":557
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":560
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":561
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 561, __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, 561, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 561, __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, 561, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":560
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePrepared(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":562
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         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":563
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 563, __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, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":564
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, 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_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_close_prepared_failed, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __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_6); __pyx_t_6 = 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, 563, __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, 563, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":562
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"
*/
  }

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

  /* 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_8);
  __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":567
 *             )
 * 
 *     def close_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePortal", 170000)
 *         cdef libpq.PGresult *rv
*/

/* 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, 567, __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;
  PGconn *__pyx_v_pgconn_ptr;
  struct __pyx_obj_9psycopg_c_2pq_PGresult *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close_portal", 0);

  /* "psycopg_c/pq/pgconn.pyx":568
 * 
 *     def close_portal(self, const char *name) -> PGresult:
 *         _check_supported("PQclosePortal", 170000)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __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, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":571
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":572
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":573
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQclosePortal(__pyx_v_pgconn_ptr, __pyx_v_name);

          /* "psycopg_c/pq/pgconn.pyx":572
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":571
 *         cdef libpq.PGresult *rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":574
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":575
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if rv is NULL:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 575, __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, 575, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 575, __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, 575, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":574
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQclosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":576
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         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":577
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 577, __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, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

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

    /* "psycopg_c/pq/pgconn.pyx":576
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if rv is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"close prepared failed: {self.get_error_message()}"
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":580
 *                 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, 580, __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":567
 *             )
 * 
 *     def close_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePortal", 170000)
 *         cdef libpq.PGresult *rv
*/

  /* 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_8);
  __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":582
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePortal", 170000)
 *         cdef int rv
*/

/* 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, 582, __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;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("send_close_portal", 0);

  /* "psycopg_c/pq/pgconn.pyx":583
 * 
 *     def send_close_portal(self, const char *name) -> None:
 *         _check_supported("PQsendClosePortal", 170000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __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, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":586
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":587
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":588
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = PQsendClosePortal(__pyx_v_pgconn_ptr, __pyx_v_name);

          /* "psycopg_c/pq/pgconn.pyx":587
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":586
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":589
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":590
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 590, __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, 590, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 590, __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, 590, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":589
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQsendClosePortal(pgconn_ptr, name)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":591
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         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":592
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:
 *             raise e.OperationalError(             # <<<<<<<<<<<<<<
 *                 f"sending close prepared failed: {self.get_error_message()}"
 *             )
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 592, __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, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":593
 *         if not rv:
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"             # <<<<<<<<<<<<<<
 *             )
 * 
*/
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, 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_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sending_close_prepared_failed, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __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_6); __pyx_t_6 = 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, 592, __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, 592, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":591
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("the connection is closed")
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"sending close prepared failed: {self.get_error_message()}"
*/
  }

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

  /* 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_8);
  __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":596
 *             )
 * 
 *     def get_result(self) -> "PGresult" | None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):
*/

/* 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
  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_result", 0);

  /* "psycopg_c/pq/pgconn.pyx":598
 *     def get_result(self) -> "PGresult" | None:
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":599
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):
 *             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":598
 *     def get_result(self) -> "PGresult" | None:
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":600
 *         with cython.critical_section(self):
 *             pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return PGresult._from_ptr(pgresult)
*/
  __pyx_t_2 = (__pyx_v_pgresult == NULL);
  if (__pyx_t_2) {

    /* "psycopg_c/pq/pgconn.pyx":601
 *             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":600
 *         with cython.critical_section(self):
 *             pgresult = libpq.PQgetResult(self._pgconn_ptr)
 *         if pgresult is NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return PGresult._from_ptr(pgresult)
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":602
 *         if pgresult is NULL:
 *             return None
 *         return PGresult._from_ptr(pgresult)             # <<<<<<<<<<<<<<
 * 
 *     def consume_input(self) -> None:
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGresult__from_ptr(__pyx_v_pgresult)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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":596
 *             )
 * 
 *     def get_result(self) -> "PGresult" | None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":604
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/

/* 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) {
  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("consume_input", 0);

  /* "psycopg_c/pq/pgconn.pyx":606
 *     def consume_input(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)
 *         if 1 != rv:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":607
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if 1 != rv:
 *             raise e.OperationalError(
*/
        __pyx_v_rv = PQconsumeInput(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":606
 *     def consume_input(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)
 *         if 1 != rv:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":608
 *         with cython.critical_section(self):
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)
 *         if 1 != rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"consuming input failed: {self.get_error_message()}")
*/
  __pyx_t_2 = (1 != __pyx_v_rv);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":609
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)
 *         if 1 != rv:
 *             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, 609, __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, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":610
 *         if 1 != rv:
 *             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, 610, __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, 610, __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, 610, __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, 609, __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, 609, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":608
 *         with cython.critical_section(self):
 *             rv = libpq.PQconsumeInput(self._pgconn_ptr)
 *         if 1 != rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"consuming input failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":604
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(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_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":612
 *                 f"consuming input failed: {self.get_error_message()}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self), 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":614
 *     def is_busy(self) -> int:
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisBusy(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

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

            /* "psycopg_c/pq/pgconn.pyx":614
 *     def is_busy(self) -> int:
 *         cdef int rv
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisBusy(self._pgconn_ptr)
 *         return rv
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":616
 *         with cython.critical_section(self), 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, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_1, NULL, 0) < (0)) __PYX_ERR(1, 616, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":612
 *                 f"consuming input failed: {self.get_error_message()}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self), 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":618
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nonblocking(self) -> int:
 *         cdef int rv
*/

/* 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) {
  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("__get__", 0);

  /* "psycopg_c/pq/pgconn.pyx":621
 *     def nonblocking(self) -> int:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisnonblocking(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

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

      /* "psycopg_c/pq/pgconn.pyx":621
 *     def nonblocking(self) -> int:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQisnonblocking(self._pgconn_ptr)
 *         return rv
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":623
 *         with cython.critical_section(self):
 *             rv = libpq.PQisnonblocking(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @nonblocking.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 623, __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":618
 *         return rv
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nonblocking(self) -> int:
 *         cdef int rv
*/

  /* 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":625
 *         return rv
 * 
 *     @nonblocking.setter             # <<<<<<<<<<<<<<
 *     def nonblocking(self, int arg) -> None:
 *         cdef int rv
*/

/* 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, 626, __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_v_rv;
  int __pyx_r;
  __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("__set__", 0);

  /* "psycopg_c/pq/pgconn.pyx":628
 *     def nonblocking(self, int arg) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)
 *         if 0 > rv:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":629
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)             # <<<<<<<<<<<<<<
 *         if 0 > rv:
 *             raise e.OperationalError(
*/
        __pyx_v_rv = PQsetnonblocking(__pyx_v_self->_pgconn_ptr, __pyx_v_arg);
      }

      /* "psycopg_c/pq/pgconn.pyx":628
 *     def nonblocking(self, int arg) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)
 *         if 0 > rv:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":630
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)
 *         if 0 > rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"setting nonblocking failed: {self.get_error_message()}")
*/
  __pyx_t_2 = (0 > __pyx_v_rv);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":631
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)
 *         if 0 > rv:
 *             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, 631, __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, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":632
 *         if 0 > rv:
 *             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, 632, __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, 632, __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, 632, __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, 631, __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, 631, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":630
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetnonblocking(self._pgconn_ptr, arg)
 *         if 0 > rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(
 *                 f"setting nonblocking failed: {self.get_error_message()}")
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":625
 *         return rv
 * 
 *     @nonblocking.setter             # <<<<<<<<<<<<<<
 *     def nonblocking(self, int arg) -> None:
 *         cdef int rv
*/

  /* function exit code */
  __pyx_r = 0;
  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.nonblocking.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":634
 *                 f"setting nonblocking failed: {self.get_error_message()}")
 * 
 *     cpdef int flush(self) except -1:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/

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;
  PGconn *__pyx_v_pgconn_ptr;
  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;
  PGconn *__pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("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, 634, __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, 634, __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, 634, __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":637
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQflush(self._pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":638
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQflush(self._pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        __pyx_t_7 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_7;
        __pyx_t_8 = (__pyx_t_7 != NULL);
        if (__pyx_t_8) {

          /* "psycopg_c/pq/pgconn.pyx":639
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQflush(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")
*/
          __pyx_v_rv = PQflush(__pyx_v_self->_pgconn_ptr);

          /* "psycopg_c/pq/pgconn.pyx":638
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *                 rv = libpq.PQflush(self._pgconn_ptr)
 *         if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":637
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQflush(self._pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":640
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQflush(self._pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("flushing failed: the connection is closed")
 *         if rv < 0:
*/
  __pyx_t_8 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_8)) {

    /* "psycopg_c/pq/pgconn.pyx":641
 *                 rv = libpq.PQflush(self._pgconn_ptr)
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")             # <<<<<<<<<<<<<<
 *         if rv < 0:
 *             raise e.OperationalError(f"flushing failed: {self.get_error_message()}")
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 641, __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, 641, __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, 641, __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, 641, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":640
 *             if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *                 rv = libpq.PQflush(self._pgconn_ptr)
 *         if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("flushing failed: the connection is closed")
 *         if rv < 0:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":642
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"flushing failed: {self.get_error_message()}")
 *         return rv
*/
  __pyx_t_8 = (__pyx_v_rv < 0);
  if (unlikely(__pyx_t_8)) {

    /* "psycopg_c/pq/pgconn.pyx":643
 *             raise e.OperationalError("flushing failed: the connection is closed")
 *         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, 643, __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, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, 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_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __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_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 643, __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, 643, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":642
 *         if pgconn_ptr is NULL:
 *             raise e.OperationalError("flushing failed: the connection is closed")
 *         if rv < 0:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(f"flushing failed: {self.get_error_message()}")
 *         return rv
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":644
 *         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":634
 *                 f"setting nonblocking failed: {self.get_error_message()}")
 * 
 *     cpdef int flush(self) except -1:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_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_9);
  __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, 634, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __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":646
 *         return rv
 * 
 *     def set_single_row_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/

/* 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) {
  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("set_single_row_mode", 0);

  /* "psycopg_c/pq/pgconn.pyx":648
 *     def set_single_row_mode(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)
 *         if not rv:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":649
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError("setting single row mode failed")
*/
        __pyx_v_rv = PQsetSingleRowMode(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":648
 *     def set_single_row_mode(self) -> None:
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)
 *         if not rv:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":650
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting single row mode failed")
 * 
*/
  __pyx_t_2 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":651
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)
 *         if not rv:
 *             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, 651, __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, 651, __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_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, 651, __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, 651, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":650
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetSingleRowMode(self._pgconn_ptr)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting single row mode failed")
 * 
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":646
 *         return rv
 * 
 *     def set_single_row_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(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_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":653
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef int s = size
*/

/* 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, 653, __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) {
  int __pyx_v_rv;
  int __pyx_v_s;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_chunked_rows_mode", 0);

  /* "psycopg_c/pq/pgconn.pyx":655
 *     def set_chunked_rows_mode(self, size: int) -> None:
 *         cdef int rv
 *         cdef int s = size             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
*/
  __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 655, __pyx_L1_error)
  __pyx_v_s = __pyx_t_1;

  /* "psycopg_c/pq/pgconn.pyx":656
 *         cdef int rv
 *         cdef int s = size
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
 *         if not rv:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":657
 *         cdef int s = size
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)             # <<<<<<<<<<<<<<
 *         if not rv:
 *             raise e.OperationalError("setting chunked rows mode failed")
*/
        __pyx_v_rv = PQsetChunkedRowsMode(__pyx_v_self->_pgconn_ptr, __pyx_v_s);
      }

      /* "psycopg_c/pq/pgconn.pyx":656
 *         cdef int rv
 *         cdef int s = size
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
 *         if not rv:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":658
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
*/
  __pyx_t_3 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":659
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
 *         if not rv:
 *             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, 659, __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, 659, __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_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(1, 659, __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, 659, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":658
 *         with cython.critical_section(self):
 *             rv = libpq.PQsetChunkedRowsMode(self._pgconn_ptr, s)
 *         if not rv:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":653
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef int s = size
*/

  /* 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_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":661
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
 *     def cancel_conn(self) -> PGcancelConn:             # <<<<<<<<<<<<<<
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *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":662
 * 
 *     def cancel_conn(self) -> PGcancelConn:
 *         _check_supported("PQcancelCreate", 170000)             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancelConn *ptr
 *         with cython.critical_section(self):
*/
  __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, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":664
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQcancelCreate(self._pgconn_ptr)
 *         if not ptr:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":665
 *         cdef libpq.PGcancelConn *ptr
 *         with cython.critical_section(self):
 *             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":664
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQcancelCreate(self._pgconn_ptr)
 *         if not ptr:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":666
 *         with cython.critical_section(self):
 *             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":667
 *             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, 667, __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, 667, __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, 667, __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, 667, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":666
 *         with cython.critical_section(self):
 *             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":668
 *         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, 668, __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":661
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
 *     def cancel_conn(self) -> PGcancelConn:             # <<<<<<<<<<<<<<
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *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":670
 *         return PGcancelConn._from_ptr(ptr)
 * 
 *     def get_cancel(self) -> PGcancel:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):
*/

/* 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
  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("get_cancel", 0);

  /* "psycopg_c/pq/pgconn.pyx":672
 *     def get_cancel(self) -> PGcancel:
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":673
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):
 *             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":672
 *     def get_cancel(self) -> PGcancel:
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":674
 *         with cython.critical_section(self):
 *             ptr = libpq.PQgetCancel(self._pgconn_ptr)
 *         if not ptr:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("couldn't create cancel object")
 *         return PGcancel._from_ptr(ptr)
*/
  __pyx_t_2 = (!(__pyx_v_ptr != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":675
 *             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, 675, __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, 675, __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_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, 675, __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, 675, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":674
 *         with cython.critical_section(self):
 *             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":676
 *         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_1 = ((PyObject *)__pyx_f_9psycopg_c_2pq_8PGcancel__from_ptr(__pyx_v_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9psycopg_c_2pq_PGcancel *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":670
 *         return PGcancelConn._from_ptr(ptr)
 * 
 *     def get_cancel(self) -> PGcancel:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):
*/

  /* 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.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":678
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), 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, 678, __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, 678, __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":680
 *     cpdef object notifies(self):
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {
        {
            PyThreadState * _save;
            _save = PyEval_SaveThread();
            __Pyx_FastGIL_Remember();
            /*try:*/ {

              /* "psycopg_c/pq/pgconn.pyx":681
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), 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":680
 *     cpdef object notifies(self):
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), nogil:             # <<<<<<<<<<<<<<
 *             ptr = libpq.PQnotifies(self._pgconn_ptr)
 *         if ptr:
*/
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_FastGIL_Forget();
                PyEval_RestoreThread(_save);
                goto __pyx_L8;
              }
              __pyx_L8:;
            }
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":682
 *         with cython.critical_section(self), 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":683
 *             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, 683, __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, 683, __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, 683, __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, 683, __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, 683, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_ret = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "psycopg_c/pq/pgconn.pyx":684
 *         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":685
 *             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":682
 *         with cython.critical_section(self), 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":687
 *             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":678
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), 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, 678, __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":689
 *             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;
  PyObject *__pyx_t_2 = NULL;
  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("put_copy_data", 0);

  /* "psycopg_c/pq/pgconn.pyx":694
 *         cdef Py_ssize_t length
 * 
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
*/
  __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, 694, __pyx_L1_error)

  /* "psycopg_c/pq/pgconn.pyx":695
 * 
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":696
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)
 *         with cython.critical_section(self):
 *             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":695
 * 
 *         _buffer_as_string_and_size(buffer, &cbuffer, &length)
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQputCopyData(self._pgconn_ptr, cbuffer, <int>length)
 *         if rv < 0:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":697
 *         with cython.critical_section(self):
 *             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_3 = (__pyx_v_rv < 0);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":698
 *             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, 698, __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, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":699
 *         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, 699, __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, 699, __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, 699, __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_2 = __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_2)) __PYX_ERR(1, 698, __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, 698, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":697
 *         with cython.critical_section(self):
 *             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":700
 *             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_2 = __Pyx_PyLong_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_2, NULL, 0) < (0)) __PYX_ERR(1, 700, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":689
 *             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_2);
  __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":702
 *         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, 702, __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, 702, __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, 702, __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, 702, __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, 702, __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, 702, __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":704
 *     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":705
 *         cdef int rv
 *         cdef const char *cerr = NULL
 *         if error is not None:             # <<<<<<<<<<<<<<
 *             cerr = PyBytes_AsString(error)
 * 
*/
  __pyx_t_1 = (__pyx_v_error != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":706
 *         cdef const char *cerr = NULL
 *         if error is not None:
 *             cerr = PyBytes_AsString(error)             # <<<<<<<<<<<<<<
 * 
 *         with cython.critical_section(self):
*/
    __pyx_t_2 = PyBytes_AsString(__pyx_v_error); if (unlikely(__pyx_t_2 == ((void *)NULL))) __PYX_ERR(1, 706, __pyx_L1_error)
    __pyx_v_cerr = __pyx_t_2;

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

  /* "psycopg_c/pq/pgconn.pyx":708
 *             cerr = PyBytes_AsString(error)
 * 
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_3);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":709
 * 
 *         with cython.critical_section(self):
 *             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":708
 *             cerr = PyBytes_AsString(error)
 * 
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQputCopyEnd(self._pgconn_ptr, cerr)
 *         if rv < 0:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":710
 *         with cython.critical_section(self):
 *             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":711
 *             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, 711, __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, 711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":712
 *         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, 712, __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, 712, __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, 712, __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, 711, __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, 711, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":710
 *         with cython.critical_section(self):
 *             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":713
 *             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, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyInt_FromNumber(&__pyx_t_3, NULL, 0) < (0)) __PYX_ERR(1, 713, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":702
 *         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":715
 *         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, 715, __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
  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("get_copy_data", 0);

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

  /* "psycopg_c/pq/pgconn.pyx":719
 *         cdef int nbytes
 * 
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 *         if nbytes == -2:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":720
 * 
 *         with cython.critical_section(self):
 *             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":719
 *         cdef int nbytes
 * 
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             nbytes = libpq.PQgetCopyData(self._pgconn_ptr, &buffer_ptr, async_)
 *         if nbytes == -2:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":721
 *         with cython.critical_section(self):
 *             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_2 = (__pyx_v_nbytes == -2L);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":722
 *             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, 722, __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, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":723
 *         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, 723, __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, 723, __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, 723, __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, 722, __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, 722, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":721
 *         with cython.critical_section(self):
 *             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":724
 *             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_2 = (__pyx_v_buffer_ptr != NULL);
  if (__pyx_t_2) {

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

    /* "psycopg_c/pq/pgconn.pyx":725
 *                 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_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_data = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

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

    /* "psycopg_c/pq/pgconn.pyx":724
 *             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":729
 *             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_1 = __Pyx_PyLong_From_int(__pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1) != (0)) __PYX_ERR(1, 729, __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, 729, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "psycopg_c/pq/pgconn.pyx":715
 *         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_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.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":731
 *             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, 731, __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":732
 * 
 *     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, 732, __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, 732, __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, 732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":733
 *     def trace(self, fileno: int) -> None:
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")             # <<<<<<<<<<<<<<
 *         stream = fdopen(fileno, b"w")
 *         with cython.critical_section(self):
*/
    __pyx_t_1 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 733, __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, 733, __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, 733, __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, 733, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":732
 * 
 *     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":734
 *         if sys.platform != "linux":
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             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, 734, __pyx_L1_error)
  __pyx_v_stream = fdopen(__pyx_t_7, __pyx_k_w);

  /* "psycopg_c/pq/pgconn.pyx":735
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQtrace(self._pgconn_ptr, stream)
 * 
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":736
 *         stream = fdopen(fileno, b"w")
 *         with cython.critical_section(self):
 *             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":735
 *             raise e.NotSupportedError("currently only supported on Linux")
 *         stream = fdopen(fileno, b"w")
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQtrace(self._pgconn_ptr, stream)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":731
 *             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":738
 *             libpq.PQtrace(self._pgconn_ptr, stream)
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsetTraceFlags", 140000)
 *         cdef int f = 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) {
  int __pyx_v_f;
  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":739
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:
 *         _check_supported("PQsetTraceFlags", 140000)             # <<<<<<<<<<<<<<
 *         cdef int f = flags
 *         with cython.critical_section(self):
*/
  __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, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

  /* "psycopg_c/pq/pgconn.pyx":741
 *         _check_supported("PQsetTraceFlags", 140000)
 *         cdef int f = flags
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)
 * 
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":742
 *         cdef int f = flags
 *         with cython.critical_section(self):
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)             # <<<<<<<<<<<<<<
 * 
 *     def untrace(self) -> None:
*/
        PQsetTraceFlags(__pyx_v_self->_pgconn_ptr, __pyx_v_f);
      }

      /* "psycopg_c/pq/pgconn.pyx":741
 *         _check_supported("PQsetTraceFlags", 140000)
 *         cdef int f = flags
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":738
 *             libpq.PQtrace(self._pgconn_ptr, stream)
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsetTraceFlags", 140000)
 *         cdef int f = 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":744
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)
 * 
 *     def untrace(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             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
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("untrace", 0);

  /* "psycopg_c/pq/pgconn.pyx":745
 * 
 *     def untrace(self) -> None:
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQuntrace(self._pgconn_ptr)
 * 
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

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

      /* "psycopg_c/pq/pgconn.pyx":745
 * 
 *     def untrace(self) -> None:
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             libpq.PQuntrace(self._pgconn_ptr)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":744
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)
 * 
 *     def untrace(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             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":748
 *             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, 748, __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, 748, __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, 748, __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, 748, __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, 748, __pyx_L3_error)

      /* "psycopg_c/pq/pgconn.pyx":749
 * 
 *     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, 748, __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, 748, __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, 748, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 748, __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, 749, __pyx_L3_error)
    __pyx_v_user = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_user) && PyErr_Occurred())) __PYX_ERR(1, 749, __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, 748, __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":748
 *             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":751
 *         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, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

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

  /* "psycopg_c/pq/pgconn.pyx":755
 *         cdef char *out
 *         cdef const char *calgo = NULL
 *         if algorithm:             # <<<<<<<<<<<<<<
 *             calgo = algorithm
 *         with cython.critical_section(self):
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_algorithm); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 755, __pyx_L1_error)
  if (__pyx_t_2) {

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

    /* "psycopg_c/pq/pgconn.pyx":755
 *         cdef char *out
 *         cdef const char *calgo = NULL
 *         if algorithm:             # <<<<<<<<<<<<<<
 *             calgo = algorithm
 *         with cython.critical_section(self):
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":757
 *         if algorithm:
 *             calgo = algorithm
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":758
 *             calgo = algorithm
 *         with cython.critical_section(self):
 *             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":757
 *         if algorithm:
 *             calgo = algorithm
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             out = libpq.PQencryptPasswordConn(self._pgconn_ptr, passwd, user, calgo)
 *         if not out:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":759
 *         with cython.critical_section(self):
 *             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":760
 *             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, 760, __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, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "psycopg_c/pq/pgconn.pyx":761
 *         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, 761, __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, 761, __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, 761, __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, 760, __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, 760, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":759
 *         with cython.critical_section(self):
 *             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":764
 *             )
 * 
 *         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, 764, __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, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

  /* "psycopg_c/pq/pgconn.pyx":766
 *         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":748
 *             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":768
 *         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, 768, __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, 768, __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, 768, __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, 768, __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, 768, __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, 768, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 768, __pyx_L3_error)
    }
    __pyx_v_user = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_user) && PyErr_Occurred())) __PYX_ERR(1, 769, __pyx_L3_error)
    __pyx_v_passwd = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_passwd) && PyErr_Occurred())) __PYX_ERR(1, 769, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("change_password", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 768, __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":771
 *         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, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":774
 * 
 *         cdef libpq.PGresult *res
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":775
 *         cdef libpq.PGresult *res
 *         with cython.critical_section(self):
 *             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":774
 * 
 *         cdef libpq.PGresult *res
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             res = libpq.PQchangePassword(self._pgconn_ptr, user, passwd)
 *         if libpq.PQresultStatus(res) != ExecStatus.COMMAND_OK:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":776
 *         with cython.critical_section(self):
 *             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, 776, __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, 776, __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, 776, __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, 776, __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, 776, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "psycopg_c/pq/pgconn.pyx":777
 *             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, 777, __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, 777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "psycopg_c/pq/pgconn.pyx":778
 *         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, 778, __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, 778, __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, 778, __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, 777, __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, 777, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":776
 *         with cython.critical_section(self):
 *             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":768
 *         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":781
 *             )
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):
*/

/* 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, 781, __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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  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":783
 *     def make_empty_result(self, int exec_status) -> PGresult:
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQmakeEmptyPGresult(
 *                 self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":784
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):
 *             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":783
 *     def make_empty_result(self, int exec_status) -> PGresult:
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQmakeEmptyPGresult(
 *                 self._pgconn_ptr, <libpq.ExecStatusType>exec_status)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":786
 *             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_2 = (!(__pyx_v_rv != 0));
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":787
 *                 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_1 = __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_1)) __PYX_ERR(1, 787, __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, 787, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":786
 *             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":788
 *         if not rv:
 *             raise MemoryError("couldn't allocate empty PGresult")
 *         return PGresult._from_ptr(rv)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __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, 788, __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":781
 *             )
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":790
 *         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) {
  PGpipelineStatus __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/pgconn.pyx":796
 *         For libpq < 14.0, always return 0 (PQ_PIPELINE_OFF).
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef libpq.PGpipelineStatus rv
*/
  __pyx_t_1 = (PG_VERSION_NUM < 0x222E0);
  if (__pyx_t_1) {

    /* "psycopg_c/pq/pgconn.pyx":797
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:
 *             return libpq.PQ_PIPELINE_OFF             # <<<<<<<<<<<<<<
 *         cdef libpq.PGpipelineStatus rv
 *         with cython.critical_section(self):
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyLong_From_PGpipelineStatus(PQ_PIPELINE_OFF); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 797, __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":796
 *         For libpq < 14.0, always return 0 (PQ_PIPELINE_OFF).
 *         """
 *         if libpq.PG_VERSION_NUM < 140000:             # <<<<<<<<<<<<<<
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef libpq.PGpipelineStatus rv
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":799
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef libpq.PGpipelineStatus rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQpipelineStatus(self._pgconn_ptr)
 *         return rv
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_2);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":800
 *         cdef libpq.PGpipelineStatus rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQpipelineStatus(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         return rv
 * 
*/
        __pyx_v_rv = PQpipelineStatus(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":799
 *             return libpq.PQ_PIPELINE_OFF
 *         cdef libpq.PGpipelineStatus rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQpipelineStatus(self._pgconn_ptr)
 *         return rv
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":801
 *         with cython.critical_section(self):
 *             rv = libpq.PQpipelineStatus(self._pgconn_ptr)
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def enter_pipeline_mode(self) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_PGpipelineStatus(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 801, __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":790
 *         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":803
 *         return rv
 * 
 *     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) {
  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("enter_pipeline_mode", 0);

  /* "psycopg_c/pq/pgconn.pyx":809
 *             mode.
 *         """
 *         _check_supported("PQenterPipelineMode", 140000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __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, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":811
 *         _check_supported("PQenterPipelineMode", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)
 *         if rv != 1:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":812
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv != 1:
 *             raise e.OperationalError("failed to enter pipeline mode")
*/
        __pyx_v_rv = PQenterPipelineMode(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":811
 *         _check_supported("PQenterPipelineMode", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)
 *         if rv != 1:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":813
 *         with cython.critical_section(self):
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
*/
  __pyx_t_2 = (__pyx_v_rv != 1);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":814
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)
 *         if rv != 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, 814, __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, 814, __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, 814, __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, 814, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":813
 *         with cython.critical_section(self):
 *             rv = libpq.PQenterPipelineMode(self._pgconn_ptr)
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError("failed to enter pipeline mode")
 * 
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":803
 *         return rv
 * 
 *     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":816
 *             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) {
  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("exit_pipeline_mode", 0);

  /* "psycopg_c/pq/pgconn.pyx":822
 *             mode.
 *         """
 *         _check_supported("PQexitPipelineMode", 140000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __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, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":824
 *         _check_supported("PQexitPipelineMode", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)
 *         if rv != 1:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":825
 *         cdef int rv
 *         with cython.critical_section(self):
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)             # <<<<<<<<<<<<<<
 *         if rv != 1:
 *             raise e.OperationalError(self.get_error_message())
*/
        __pyx_v_rv = PQexitPipelineMode(__pyx_v_self->_pgconn_ptr);
      }

      /* "psycopg_c/pq/pgconn.pyx":824
 *         _check_supported("PQexitPipelineMode", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)
 *         if rv != 1:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":826
 *         with cython.critical_section(self):
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(self.get_error_message())
 * 
*/
  __pyx_t_2 = (__pyx_v_rv != 1);
  if (unlikely(__pyx_t_2)) {

    /* "psycopg_c/pq/pgconn.pyx":827
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)
 *         if rv != 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, 827, __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, 827, __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, 827, __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, 827, __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, 827, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":826
 *         with cython.critical_section(self):
 *             rv = libpq.PQexitPipelineMode(self._pgconn_ptr)
 *         if rv != 1:             # <<<<<<<<<<<<<<
 *             raise e.OperationalError(self.get_error_message())
 * 
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":816
 *             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":829
 *             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":835
 *             or if sync failed.
 *         """
 *         _check_supported("PQpipelineSync", 140000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __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, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":837
 *         _check_supported("PQpipelineSync", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":838
 *         cdef int rv
 *         with cython.critical_section(self):
 *             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":837
 *         _check_supported("PQpipelineSync", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQpipelineSync(self._pgconn_ptr)
 *         if rv == 0:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":839
 *         with cython.critical_section(self):
 *             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":840
 *             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, 840, __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, 840, __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, 840, __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, 840, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":839
 *         with cython.critical_section(self):
 *             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":841
 *         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":842
 *             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, 842, __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, 842, __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, 842, __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, 842, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":841
 *         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":829
 *             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":844
 *             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":849
 *         :raises ~e.OperationalError: if the flush request failed.
 *         """
 *         _check_supported("PQsendFlushRequest ", 140000)             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __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, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "psycopg_c/pq/pgconn.pyx":851
 *         _check_supported("PQsendFlushRequest ", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":852
 *         cdef int rv
 *         with cython.critical_section(self):
 *             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":851
 *         _check_supported("PQsendFlushRequest ", 140000)
 *         cdef int rv
 *         with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *             rv = libpq.PQsendFlushRequest(self._pgconn_ptr)
 *         if rv == 0:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":853
 *         with cython.critical_section(self):
 *             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":854
 *             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, 854, __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, 854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "psycopg_c/pq/pgconn.pyx":855
 *         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, 855, __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, 855, __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, 855, __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, 854, __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, 854, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":853
 *         with cython.critical_section(self):
 *             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":844
 *             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":27
 *     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":28
 *     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":858
 * 
 * 
 * cdef void *_call_libpq_with_param(             # <<<<<<<<<<<<<<
 *     PGconn self,
 *     conn_f_with_param func,
*/

static void *__pyx_f_9psycopg_c_2pq__call_libpq_with_param(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, __pyx_t_9psycopg_c_2pq_conn_f_with_param __pyx_v_func, char const *__pyx_v_param) {
  void *__pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  void *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_libpq_with_param", 0);

  /* "psycopg_c/pq/pgconn.pyx":863
 *     const char *param
 * ):
 *     cdef void *rv = NULL             # <<<<<<<<<<<<<<
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
*/
  __pyx_v_rv = NULL;

  /* "psycopg_c/pq/pgconn.pyx":865
 *     cdef void *rv = NULL
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":866
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":867
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)             # <<<<<<<<<<<<<<
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = __pyx_v_func(__pyx_v_pgconn_ptr, __pyx_v_param);

          /* "psycopg_c/pq/pgconn.pyx":866
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":865
 *     cdef void *rv = NULL
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":868
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":869
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *     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, 869, __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, 869, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 869, __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, 869, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":868
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":870
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
 *     return rv             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":858
 * 
 * 
 * cdef void *_call_libpq_with_param(             # <<<<<<<<<<<<<<
 *     PGconn self,
 *     conn_f_with_param func,
*/

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

/* "psycopg_c/pq/pgconn.pyx":873
 * 
 * 
 * cdef int _call_libpq_int(PGconn self, conn_int_f func):             # <<<<<<<<<<<<<<
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
*/

static int __pyx_f_9psycopg_c_2pq__call_libpq_int(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, __pyx_t_9psycopg_c_2pq_conn_int_f __pyx_v_func) {
  int __pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_libpq_int", 0);

  /* "psycopg_c/pq/pgconn.pyx":876
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":877
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":878
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)             # <<<<<<<<<<<<<<
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = __pyx_v_func(__pyx_v_pgconn_ptr);

          /* "psycopg_c/pq/pgconn.pyx":877
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":876
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":879
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":880
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *     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, 880, __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, 880, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 880, __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, 880, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":879
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":881
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
 *     return rv             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":873
 * 
 * 
 * cdef int _call_libpq_int(PGconn self, conn_int_f func):             # <<<<<<<<<<<<<<
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_c.pq._call_libpq_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":884
 * 
 * 
 * cdef int _call_libpq_int_with_param(             # <<<<<<<<<<<<<<
 *     PGconn self,
 *     conn_int_f_with_param func,
*/

static int __pyx_f_9psycopg_c_2pq__call_libpq_int_with_param(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, __pyx_t_9psycopg_c_2pq_conn_int_f_with_param __pyx_v_func, char const *__pyx_v_param) {
  int __pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_libpq_int_with_param", 0);

  /* "psycopg_c/pq/pgconn.pyx":891
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":892
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":893
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)             # <<<<<<<<<<<<<<
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = __pyx_v_func(__pyx_v_pgconn_ptr, __pyx_v_param);

          /* "psycopg_c/pq/pgconn.pyx":892
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":891
 *     cdef int rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":894
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":895
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *     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, 895, __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, 895, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 895, __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, 895, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":894
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr, param)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     return rv
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":896
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
 *     return rv             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "psycopg_c/pq/pgconn.pyx":884
 * 
 * 
 * cdef int _call_libpq_int_with_param(             # <<<<<<<<<<<<<<
 *     PGconn self,
 *     conn_int_f_with_param func,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_c.pq._call_libpq_int_with_param", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "psycopg_c/pq/pgconn.pyx":899
 * 
 * 
 * cdef bytes _call_libpq_bytes(PGconn self, conn_bytes_f func):             # <<<<<<<<<<<<<<
 *     cdef char *rv
 *     cdef libpq.PGconn *pgconn_ptr
*/

static PyObject *__pyx_f_9psycopg_c_2pq__call_libpq_bytes(struct __pyx_obj_9psycopg_c_2pq_PGconn *__pyx_v_self, __pyx_t_9psycopg_c_2pq_conn_bytes_f __pyx_v_func) {
  char *__pyx_v_rv;
  PGconn *__pyx_v_pgconn_ptr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PGconn *__pyx_t_2;
  int __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_libpq_bytes", 0);

  /* "psycopg_c/pq/pgconn.pyx":902
 *     cdef char *rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
*/
  {
      __Pyx_PyCriticalSection __pyx_cs;
      __pyx_t_1 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
      /*try:*/ {

        /* "psycopg_c/pq/pgconn.pyx":903
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
*/
        __pyx_t_2 = __pyx_v_self->_pgconn_ptr;
        __pyx_v_pgconn_ptr = __pyx_t_2;
        __pyx_t_3 = (__pyx_t_2 != NULL);
        if (__pyx_t_3) {

          /* "psycopg_c/pq/pgconn.pyx":904
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)             # <<<<<<<<<<<<<<
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
*/
          __pyx_v_rv = __pyx_v_func(__pyx_v_pgconn_ptr);

          /* "psycopg_c/pq/pgconn.pyx":903
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:             # <<<<<<<<<<<<<<
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
*/
        }
      }

      /* "psycopg_c/pq/pgconn.pyx":902
 *     cdef char *rv
 *     cdef libpq.PGconn *pgconn_ptr
 *     with cython.critical_section(self):             # <<<<<<<<<<<<<<
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyCriticalSection_End(&__pyx_cs);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "psycopg_c/pq/pgconn.pyx":905
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     if rv is not NULL:
*/
  __pyx_t_3 = (__pyx_v_pgconn_ptr == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "psycopg_c/pq/pgconn.pyx":906
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")             # <<<<<<<<<<<<<<
 *     if rv is not NULL:
 *         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, 906, __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, 906, __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_closed};
      __pyx_t_1 = __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_1)) __PYX_ERR(1, 906, __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, 906, __pyx_L1_error)

    /* "psycopg_c/pq/pgconn.pyx":905
 *         if (pgconn_ptr := self._pgconn_ptr) is not NULL:
 *             rv = func(pgconn_ptr)
 *     if pgconn_ptr is NULL:             # <<<<<<<<<<<<<<
 *         raise e.OperationalError("the connection is closed")
 *     if rv is not NULL:
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":907
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
 *     if rv is not NULL:             # <<<<<<<<<<<<<<
 *         return rv
 *     return b""
*/
  __pyx_t_3 = (__pyx_v_rv != NULL);
  if (__pyx_t_3) {

    /* "psycopg_c/pq/pgconn.pyx":908
 *         raise e.OperationalError("the connection is closed")
 *     if rv is not NULL:
 *         return rv             # <<<<<<<<<<<<<<
 *     return b""
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "psycopg_c/pq/pgconn.pyx":907
 *     if pgconn_ptr is NULL:
 *         raise e.OperationalError("the connection is closed")
 *     if rv is not NULL:             # <<<<<<<<<<<<<<
 *         return rv
 *     return b""
*/
  }

  /* "psycopg_c/pq/pgconn.pyx":909
 *     if rv is not NULL:
 *         return rv
 *     return b""             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __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/pgconn.pyx":899
 * 
 * 
 * cdef bytes _call_libpq_bytes(PGconn self, conn_bytes_f func):             # <<<<<<<<<<<<<<
 *     cdef char *rv
 *     cdef libpq.PGconn *pgconn_ptr
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("psycopg_c.pq._call_libpq_bytes", __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":912
 * 
 * 
 * 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":913
 * 
 * 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, 913, __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":914
 * 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":915
 *     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":914
 * 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":917
 *         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, 917, __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":918
 * 
 *     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":919
 *     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, 919, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "psycopg_c/pq/pgconn.pyx":918
 * 
 *     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":920
 *     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, 920, __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":921
 *         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, 921, __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, 921, __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, 921, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }

        /* "psycopg_c/pq/pgconn.pyx":920
 *     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":918
 * 
 *     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":923
 *         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":912
 * 
 * 
 * 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":926
 * 
 * 
 * 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":937
 *     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":938
 * 
 *     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":939
 *     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, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_values_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_c/pq/pgconn.pyx":940
 *     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":938
 * 
 *     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":942
 *         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":943
 * 
 *     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, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_types_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_c/pq/pgconn.pyx":944
 *     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":945
 *         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":946
 *         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, 946, __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, 946, __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, 946, __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, 946, __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, 945, __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, 945, __pyx_L1_error)

      /* "psycopg_c/pq/pgconn.pyx":944
 *     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":942
 *         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":949
 *             )
 * 
 *     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":950
 * 
 *     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, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_formats_fast = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "psycopg_c/pq/pgconn.pyx":952
 *         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":953
 *             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":954
 *         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, 954, __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, 954, __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, 954, __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, 954, __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, 953, __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, 953, __pyx_L1_error)

      /* "psycopg_c/pq/pgconn.pyx":952
 *         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":949
 *             )
 * 
 *     if param_formats is not None:             # <<<<<<<<<<<<<<
 *         formats_fast = PySequence_Fast(
 *             param_formats, "'param_formats' is not a sequence")
*/
  }

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

  /* "psycopg_c/pq/pgconn.pyx":958
 * 
 *     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":962
 *     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":963
 * 
 *     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":964
 *     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":965
 *         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":966
 *         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, 966, __pyx_L1_error) }
      __pyx_v_obj = PySequence_Fast_GET_ITEM(__pyx_v_values_fast, __pyx_v_i);

      /* "psycopg_c/pq/pgconn.pyx":967
 *         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":970
 *                 # 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, 970, __pyx_L1_error)

        /* "psycopg_c/pq/pgconn.pyx":971
 *                 # 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":972
 *                 _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":967
 *         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":974
 *                 alenghts[i] = <int>length
 *             else:
 *                 aparams[i] = NULL             # <<<<<<<<<<<<<<
 *                 alenghts[i] = 0
 * 
*/
      /*else*/ {
        (__pyx_v_aparams[__pyx_v_i]) = NULL;

        /* "psycopg_c/pq/pgconn.pyx":975
 *             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":962
 *     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":977
 *                 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":978
 * 
 *     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":979
 *     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":980
 *     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":981
 *         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, 981, __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, 981, __pyx_L1_error)
      (__pyx_v_atypes[__pyx_v_i]) = __pyx_t_14;
    }

    /* "psycopg_c/pq/pgconn.pyx":978
 * 
 *     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":983
 *             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":984
 * 
 *     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":985
 *     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":986
 *     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":987
 *         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, 987, __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, 987, __pyx_L1_error)
      (__pyx_v_aformats[__pyx_v_i]) = __pyx_t_12;
    }

    /* "psycopg_c/pq/pgconn.pyx":984
 * 
 *     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":989
 *             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":926
 * 
 * 
 * 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":992
 * 
 * 
 * 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":995
 *     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":996
 * ):
 *     PyMem_Free(ctypes)
 *     PyMem_Free(<char **>cvalues)             # <<<<<<<<<<<<<<
 *     PyMem_Free(clenghst)
 *     PyMem_Free(cformats)
*/
  PyMem_Free(((char **)__pyx_v_cvalues));

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

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

  /* "psycopg_c/pq/pgconn.pyx":992
 * 
 * 
 * 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 = (((PyObject *)__pyx_v_self->conn) != Py_None);
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.conn is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.conn is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Escaping, (type(self), 0x0804127, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_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:26:16: : __weakref__ is unsupported in the Limited API when running on Python <3.9."
#elif defined(_MSC_VER)
#pragma message("psycopg_c/pq.pxd:26: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, 48, __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, 48, __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, 48, __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, 48, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9psycopg_c_2pq_PGconn) < (0)) __PYX_ERR(1, 48, __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, 48, __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, 48, __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_4(__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_4(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); 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, __Pyx_FREETHREADING_COMPATIBLE},
  #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":29
 * 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, 29, __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, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":31
 * 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, 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_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, 31, __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, 31, __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":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
*/
  {
    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, 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_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, 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 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, 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_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, 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 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, 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_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, 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":35
 * 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, 35, __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, 35, __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, 35, __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":73
 *         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, 73, __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, 73, __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, 73, __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, 73, __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, 73, __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, 73, __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, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":81
 *         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, 81, __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, 81, __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, 81, __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, 81, __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, 81, __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, 81, __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, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":89
 *         return PGconn._from_ptr(pgconn)
 * 
 *     def connect_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 89, __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, 89, __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, 89, __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, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":92
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQconnectPoll)
 * 
 *     def finish(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             if self._pgconn_ptr is not NULL:
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 92, __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, 92, __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, 92, __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, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":121
 *         return rv
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGconn *pgconn_ptr
 *         with cython.critical_section(self):
*/
  __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_None) < (0)) __PYX_ERR(1, 121, __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, 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, __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":129
 *             raise e.OperationalError("the connection is closed")
 * 
 *     def reset_start(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 129, __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, 129, __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, 129, __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, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":136
 *             raise e.OperationalError("couldn't reset connection")
 * 
 *     def reset_poll(self) -> int:             # <<<<<<<<<<<<<<
 *         return _call_libpq_int(self, <conn_int_f>libpq.PQresetPoll)
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 136, __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, 136, __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, 136, __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, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":139
 *         return _call_libpq_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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __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, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":198
 *         return rv
 * 
 *     def parameter_status(self, const char *name) -> bytes | None:             # <<<<<<<<<<<<<<
 *         cdef const char *rv = <const char *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQparameterStatus, name)
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 198, __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, 198, __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, 198, __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, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":213
 *         return rv
 * 
 *     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, 213, __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, 213, __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, 213, __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, 213, __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[1]);
  __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, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":288
 *         return bool(_call_libpq_int(self, <conn_int_f>libpq.PQsslInUse))
 * 
 *     def exec_(self, const char *command) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 288, __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, 288, __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, 288, __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, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":301
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def send_query(self, const char *command) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 301, __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, 301, __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, 301, __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, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":319
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         cdef Py_ssize_t cnparams
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 319, __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, 319, __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, 319, __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":318
 *         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, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "psycopg_c/pq/pgconn.pyx":319
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         cdef Py_ssize_t cnparams
*/
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 319, __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, 319, __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, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "psycopg_c/pq/pgconn.pyx":313
 *                 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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __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, 313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":350
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         cdef Py_ssize_t cnparams
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 350, __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, 350, __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, 350, __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":349
 *         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, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "psycopg_c/pq/pgconn.pyx":350
 *         param_types: Sequence[int] | None = None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         cdef Py_ssize_t cnparams
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 350, __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, 350, __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, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "psycopg_c/pq/pgconn.pyx":344
 *         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, 344, __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, 344, __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, 344, __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, 344, __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, 344, __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, 344, __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, 344, __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, 344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":375
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 375, __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, 375, __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, 375, __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, 375, __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[2]);
  __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, 375, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":414
 *         param_values: Sequence[bytes | None] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         cdef Py_ssize_t cnparams
*/
  __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_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 414, __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, 414, __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":413
 *         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, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "psycopg_c/pq/pgconn.pyx":414
 *         param_values: Sequence[bytes | None] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> None:
 *         cdef Py_ssize_t cnparams
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __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_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, 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
 *             )
 * 
 *     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, 409, __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, 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_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_None) < (0)) __PYX_ERR(1, 409, __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, 409, __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, 409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "psycopg_c/pq/pgconn.pyx":439
 *             )
 * 
 *     def prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 439, __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, 439, __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, 439, __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, 439, __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[2]);
  __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, 439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":477
 *         param_values: Sequence[bytes] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         cdef Py_ssize_t cnparams
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PqFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 477, __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, 477, __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, 477, __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":476
 *         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, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "psycopg_c/pq/pgconn.pyx":477
 *         param_values: Sequence[bytes] | None,
 *         param_formats: Sequence[int] | None = None,
 *         int result_format = PqFormat.TEXT,             # <<<<<<<<<<<<<<
 *     ) -> PGresult:
 *         cdef Py_ssize_t cnparams
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_TEXT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 477, __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, 477, __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, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "psycopg_c/pq/pgconn.pyx":472
 *         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, 472, __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, 472, __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, 472, __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, 472, __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, 472, __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, 472, __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, 472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":504
 *         return PGresult._from_ptr(rv)
 * 
 *     def describe_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePrepared, name)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 504, __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, 504, __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, 504, __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, 504, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":513
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePrepared, name)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 513, __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, 513, __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, 513, __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, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":521
 *             )
 * 
 *     def describe_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv = <libpq.PGresult *>_call_libpq_with_param(
 *             self, <conn_f_with_param>libpq.PQdescribePortal, name)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 521, __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, 521, __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, 521, __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, 521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":530
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_describe_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv = _call_libpq_int_with_param(
 *             self, <conn_int_f_with_param>libpq.PQsendDescribePortal, name)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 530, __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, 530, __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, 530, __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, 530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":538
 *             )
 * 
 *     def close_prepared(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePrepared", 170000)
 *         cdef libpq.PGresult *rv
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 538, __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, 538, __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, 538, __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, 538, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":553
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_prepared(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePrepared", 170000)
 *         cdef int rv
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 553, __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, 553, __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, 553, __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, 553, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":567
 *             )
 * 
 *     def close_portal(self, const char *name) -> PGresult:             # <<<<<<<<<<<<<<
 *         _check_supported("PQclosePortal", 170000)
 *         cdef libpq.PGresult *rv
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 567, __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, 567, __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, 567, __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, 567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":582
 *         return PGresult._from_ptr(rv)
 * 
 *     def send_close_portal(self, const char *name) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsendClosePortal", 170000)
 *         cdef int rv
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 582, __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, 582, __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, 582, __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, 582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":596
 *             )
 * 
 *     def get_result(self) -> "PGresult" | None:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *pgresult
 *         with cython.critical_section(self):
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __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, 596, __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, 596, __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, 596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":604
 *         return PGresult._from_ptr(pgresult)
 * 
 *     def consume_input(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 604, __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, 604, __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, 604, __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, 604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":612
 *                 f"consuming input failed: {self.get_error_message()}")
 * 
 *     def is_busy(self) -> int:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self), nogil:
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __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, 612, __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, 612, __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, 612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":634
 *                 f"setting nonblocking failed: {self.get_error_message()}")
 * 
 *     cpdef int flush(self) except -1:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef libpq.PGconn *pgconn_ptr
*/
  __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, 634, __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, 634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":646
 *         return rv
 * 
 *     def set_single_row_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         with cython.critical_section(self):
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 646, __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, 646, __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, 646, __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, 646, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":653
 *             raise e.OperationalError("setting single row mode failed")
 * 
 *     def set_chunked_rows_mode(self, size: int) -> None:             # <<<<<<<<<<<<<<
 *         cdef int rv
 *         cdef int s = size
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __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, 653, __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, 653, __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, 653, __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, 653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":661
 *             raise e.OperationalError("setting chunked rows mode failed")
 * 
 *     def cancel_conn(self) -> PGcancelConn:             # <<<<<<<<<<<<<<
 *         _check_supported("PQcancelCreate", 170000)
 *         cdef libpq.PGcancelConn *ptr
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 661, __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, 661, __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, 661, __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, 661, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":670
 *         return PGcancelConn._from_ptr(ptr)
 * 
 *     def get_cancel(self) -> PGcancel:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGcancel *ptr
 *         with cython.critical_section(self):
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 670, __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, 670, __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, 670, __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, 670, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":678
 *         return PGcancel._from_ptr(ptr)
 * 
 *     cpdef object notifies(self):             # <<<<<<<<<<<<<<
 *         cdef libpq.PGnotify *ptr
 *         with cython.critical_section(self), 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, 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
  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, 678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":689
 *             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, 689, __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, 689, __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, 689, __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, 689, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":702
 *         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, 702, __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, 702, __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, 702, __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, 702, __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[2]);
  __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, 702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":715
 *         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, 715, __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, 715, __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, 715, __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, 715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":731
 *             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, 731, __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, 731, __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, 731, __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, 731, __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, 731, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":738
 *             libpq.PQtrace(self._pgconn_ptr, stream)
 * 
 *     def set_trace_flags(self, flags: Trace) -> None:             # <<<<<<<<<<<<<<
 *         _check_supported("PQsetTraceFlags", 140000)
 *         cdef int f = flags
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 738, __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, 738, __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, 738, __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, 738, __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, 738, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":744
 *             libpq.PQsetTraceFlags(self._pgconn_ptr, f)
 * 
 *     def untrace(self) -> None:             # <<<<<<<<<<<<<<
 *         with cython.critical_section(self):
 *             libpq.PQuntrace(self._pgconn_ptr)
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 744, __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, 744, __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, 744, __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, 744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":748
 *             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, 748, __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, 748, __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, 748, __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[2]);
  __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, 748, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":768
 *         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, 768, __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, 768, __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, 768, __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, 768, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":781
 *             )
 * 
 *     def make_empty_result(self, int exec_status) -> PGresult:             # <<<<<<<<<<<<<<
 *         cdef libpq.PGresult *rv
 *         with cython.critical_section(self):
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 781, __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, 781, __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, 781, __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, 781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":803
 *         return rv
 * 
 *     def enter_pipeline_mode(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enter pipeline mode.
 * 
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 803, __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, 803, __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, 803, __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, 803, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":816
 *             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, 816, __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, 816, __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, 816, __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, 816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "psycopg_c/pq/pgconn.pyx":829
 *             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, 829, __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, 829, __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, 829, __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, 829, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "psycopg_c/pq/pgconn.pyx":844
 *             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, 844, __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, 844, __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, 844, __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, 844, __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[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_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[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_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, 71, __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]);

  /* "psycopg_c/pq/pgconn.pyx":213
 *         return rv
 * 
 *     def get_error_message(self, encoding: str = "") -> str:             # <<<<<<<<<<<<<<
 *         return _clean_error_message(self.error_message, encoding or self._encoding)
 * 
*/
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u__5); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "psycopg_c/pq/pgconn.pyx":375
 *             )
 * 
 *     def send_prepare(             # <<<<<<<<<<<<<<
 *         self,
 *         const char *name,
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(1, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "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[3] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u_utf_8); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<4; ++i) {
      #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        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},{31},{26},{25},{34},{31},{33},{22},{32},{28},{30},{31},{24},{22},{15},{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},{1},{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},{10},{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},{1},{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},{53},{109},{19},{108},{90},{189},{110},{67},{53},{45},{34},{67},{99},{87},{99},{53},{43},{39},{65},{24},{52},{39},{145},{106},{163},{145},{190},{105},{110},{167},{177},{204},{215},{14},{19},{49},{44},{75},{39},{101},{61},{161},{171},{19},{60},{29},{19},{19},{57},{52},{9},{55},{19},{59},{9},{95},{50},{41},{40},{37},{97},{28},{38},{38},{87},{29},{33},{19},{24},{19},{11},{55},{22},{30},{75},{33},{80},{42},{53},{52}};
    #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (4528 bytes) */
const char* const cstring = "(\265/\375`h.5\215\000\252\212\020\035G\360\320\266\001\314\300\330\0004\n\330\235\242\321a\215\0217\r\246\220Bc \323?e\035\275)i\264i\2209\335I9/\330p\311\240\314\241?\177<lc\262)\335\245\014\241\243\010\226\366r\217\t\033\005\204c A\326\007\223\001\236\001\340\001<\275s\023)\235\316\273\034\332\352\366\212\272<\232m\267\033\005Y\036\014\364P0.\017\346V\226\327]\220{\340\276\032\323mw>\235\263/\336m\253\266,\247\0322\327\263\316\227\263\371\365\242;\375m\264V|\277Zi\247c\324\304\360ph^t\236\271\355\2626\316\3237]]\rr\215\301\335\277\213av\343\236\271\355\325uz\343\274\312[\346)4\303\306\024\337\234\367\326\230\347M\225\367\006\373t6\261;\317\373@\256k\274\367\307u\254\352(\r\336\027s\252;\375\331\212={y\267\242`\367Z\270[\351\314\355\no\"r\354\3558\316\322\256\2427\356\353\237\327\3728\336\272\226\227\275\ro\353\341\355Q\314;\356\322\014\033\326\330\353\264\326\335\245\234\275\264w,\352\262a\017\206\351\306\253\325\356\350fq\347:S\314\251\354\313\322\030\260\t\272n\233\355@7x`Y\351\300\262B_\320\256s\014\216;\250z\201\257\326\3310\227\355\212\362\335\273\226\242\323\316\361\347\302)x\370\307\205\3304\346\251\034\254;\024\364\207\252t\356\343x\213\310QAa\316\331\020\370\225w\336\250\nK\347\252\273\334m\357\264\266*\264cN5\346\326\243]\247\033\306\232~\035HW7\024\305\261\007v\252s\347\362\247\242\253\216r\314\271\345\256\352\343\224\367\213g\340M7mi\314L\314K\216M\016\325\033\367\233w\347\024\344p\267\033\2532\2077\3123\325\035O\007ih\267<\235\342\336\241@\005@\005F\247\313\024\201\372(\004\037\001\351\014\221\023H>\311\350<\225\031D\277r[\001\260\360\n\346\264P\352\322Bq\300\234\025\332u\206\275\366\346}[\356\334\256j\345 \3468\257+\016s\376\332z\177\035\206+g?\327\013s=7{\372\353\271\230\247\326\313s\213\273<\024G\325\352u^\267\234w5\006=\n,o\343\335\353j\365\301\334g;\326\331\266*\007\3738\254\262\034\210{x\253v\315y\255-\347\312\352L\350oU+\306\273\323wua\230\263xk\333\327K\343\212q\255\267\333\336\266\357\275\340\376\270\247m\253\325\335-o\254j}\272\352\326\247/""\347n\317\265*\235/\347\351,\255-\256\265\336{\357\275\274\326\255\326\335\275\252Z}*\313q\267\273\\m\316\227\333\026O\317\273cqv\305N\013\233\235\025N\321a\030E\3557\327\300@W\210\035\032\235m\353xVt\275\333\337*u\242\247rnr4\035\035\021\033\346*rR9 R\375\353\335z \327\335N#s\275\332\270m1wA\375\261,\276v\367Z{\255\032\177\034w\272\342\036\333\002\371\247\252<\327\217\353\031Vk\255\270r\266V\314\252x\257P\233\343:\017\263,\347\270Uyx\326yu+\336\037\327xc\017\307F'\004\377t\364\327m\347\265^\224M\355\230U\353\366P%pj\r\n\355\304\t\034\232\231\227U\377b\370\340\374\002w\327\302-\352\302y_g\351\032\267X\026\343\335W:\346x\217\212\373t\273G\177\0011k\246\314\026eG9\243\362M\274M\311/i\215#\343\216\r\251B\031r\272J[z\224*\177\245T\362mH\022\242#\202x\231\260\003\035\360,<\\a\211\017\371\010:@\006>p\310M\231\016\3225\246X\020O\342\311(\246\211\"_\310\353\204/\022\0163\204\311Oy\3157\000\241 \037D\306|@f\243\323\304\301\312\207p\340k%\211\2140\266\330Q\301\007\000\0029D\227w\021\216\204\312\007\243L\314\251\3418\215\233h\372\030\200H\037\000H9N~AV\376\270\310\013@\007F\023~\315\030\nU\244\201\261\246\025\212\231\010\241$\264P* a\304\023\321\017\005\215\260\360Q\310R\t\303\216(\031\321\017\371&Z:Cc\211x:\360S!\313\226\035L\020._\237VB\250\2349\371(BSH\nH,3i\262\2773\226\034Z~\313)\210D\314\2179\371'\0256\214\013\2766\272\210\276\200\260\346\314\302\321\251\005}f\212\t\202\302\337\306\324\370\322\3407\030\305\2548\"\236P\221\211\330\223\350\320\304\317\227\260\361#\302\223\260\024\226\304\220h\"4\2056\034\tm\200H\243\330)\014\220\005\375\224\036X>\313\365&\256\322\303\313_\311\310\037\321\212.\332\310\242Df\261\314\317\204\231\371C^\210\360SbJ\202S\344\213x\226iS\341\367\321\216(\033\242\204\027BA&\312\254\2241\232B\"%)\234\374\315\247\374Mh\032\235\331(A\364ObI\244\021\226\214b!\363\003\352\243\214\245\221%\274@\025\304\222\277\241\206\024\331`\014\215(\277 \344t\221\003H\224\270\371\n\276@\030B:Sb\004\003\000<r\234\306\026\005?\344\023\214D?\013*\201\341\357\220\032\031""\023rj\"\212\310?\205.\240\230!\n\016FP\204f\207\t\222&\243\276\231q\211*\242oY]\215)b~\200\210\276\251I\r\376B\3703#:S\244~\217\251\241, \212\215\257\023\244OB\321\022\013o#$\211\225+H\231\224\377\302\303\374\360\343\037\220ZD9\225F\027-\277\205w\240\211\242\0342\007\230/H\326\310\342\262\340\273\313\233\274\315\013\307\000\221\213\017\021f\241\010 \222h\007\310@\007\216L\304\311D\223\221\223\203=S'r\305\025\204\303\341\233R\376\212x\022J\000\"\220!\273\341\035\324\270F\017\022\206\210\316\020\216\024\331b\204 \236\260\312\221\022\346&\246\215\332\243\370\222WP\n\211#\222\260\344\005\370\031\332\351\357\2148\321_\303\"y`\370\216\030^j`\371;\242k\204!Y\322B\312\177\335\210\225\262\322\010\343C&&\231\237a\304!1\202V\242\0210\3168\211154\2224\272\304\001\226\204A\221\004:\016\204!\026VR\343K\314\204o\360\023\306D\037\302\357\336\2324\021\241I\023[b\251\362\206\374\306,z\224\202`l@\371#\374\027\252\010;J\345&a.b\214p\3444\212\271,\351\340\201W\340}\302\r\036\343\013\t\314\217\tiB\014\251\021D\2445\244\213\361F\034\3413\317\200D\331B*\030Y\312\031\037\"5\235.\361e\346\277\0303\210,\"\rJF\316\004%*l\220G\320\310D\221\231xB\340\343\324>\304\036\214\300HK\372\214$\261\036\237T\220\026\324b\226L-\373\243\363\305\345\264!\210\220\005\020\310(V*mH\014\036<\200\221\351\314\374)f\313T\331\202\354 A\221\301g@R\221 \310\023\362\002\347yb\006F\310\314\304\245\001Rf\354\021 \234\370\225R+EJS3G\224\237\215\260\204\024\204\323\250cX\262(\226\014\r\215\210$IA\322\030\203` `\340\200T:!\327\330\017\223\263\3720*\322R\024FbD!\211\214T 2\"\242$)HA\322\030\223\213\326J1\211\265\207\"\371g\363\272\017\000\216\256F\363\243u\007\030\2476\002\364\351\006\214\363,6\357\274A\360AO\367\330YI\226\266A\272Z((\374\233\330\262\340\210\252\300T\321[\251Q\207\235\365]\025\253\255\372d?U\274\363mv?\244\266.4+\330\274\261\244\327<w\323\332\202tG}\353+x/\227I=\207\254l\220\276\356\247yU;\005\322ozO(\352\\\303\347\356\312\006\364l\254\300\2123\033\370\032\254\360oU\032\245L\227\271\371j\200\226\267\237""\t\n\325{\001agMi\032\205\2306\\bE\354\313\016~\364<\021\033\373@<\316t\373\251=a\225U\207u\377\3207@\2739\332\000N;\357c'\345\267\315\017\345\220 pF\325\210k\341Ceat\014\026\016s.J\002#O\201\255\340B\363\317\303\366/T\210\340\032\036\375 \311jshV\356\2658\253c\343\347\300\376\004\021\302\344\242\001\2603\230\013\336\213(\301\344\014'\214\325\343\260\266\260?\346\0010\240\302\240\2263\245\311\235i\242i\376\017\335\306F\346\200A\321\014\241*$A\305\001\266\312\203)\225f\350dy\311\210\t\340\232\222\354P\2309\327fx6\304\200\361\234\362\\\310\024\351~c[\251\337z\003\245d\026\027\036\317\363\307C\013\312 \366}\352\335\210\n\222\243}ni\r/\2510a\3015\255\016'7U\357k\240)?\236\342\315\037=x:\001\234\242!\2523y\323&\363\376\366\350\355uz\341:\234\3338\010hG{\242H\321\005F\273'\277\004OB8x\006\000\t\021\360\314B\276J\237h*\030\210\333\363\366\262\326T-\251f\35507\323\361{=\233\332(\017\330\227\341>/5f\360\346W*[\247\253\210u\314`8#\2714Ha\320fr\214\375fo\034p~\271\001\346f\2225j\202Q\256\364s\325\006\355\270\037wS\r\376V6s\337\002\n\352Z\345\336W\367\271\352\216\23224\211\336\235\227\2268\374\237\3512\340\221\217\306C\000\323<\"\rj\001\234\327\232PC\321\300\200\232gP\305$o\035\203|%|{\024}\264\237lBE\243\232\200B\027\022YX\214\225<]R\277\220\252\322\374f\3427@j\362\342J\250\020k\371\022B$\211\310\3346 \014\341i\342G}\322e\231\306\031\005`\234\304U\240\372\301\332da\352\244\023\363\"\272\003\030\032\300\365\"\375\007\001u\201\366R\376\200\276\232m\226Q}\240\262>\001\326\2034\311\277\202\033u\226\304\334\213\303k\370\361\023\005\267\257N\250ZAI\rZI\241\305B}W\r\230\362-u}\007\215\354x\003\261\005\232bv\010\262\223W\250\026\007\t\204\255\010\345\336\262\227T\253\035\013\027\255}\025\014\300\t+\327\301\027\032]\236g\315\002D\260\255\260\310\250\211\371s.w*\024\324b~\314\213\272xD]\2026b\033\327v\006\020\304L\273;\271\326\006\324\361\216\374\202,]\010\315\223\271^\330a.B\t\340\006\270zW\242</\2024TM\006\004$\205\337V\316by\013\027\t&b\307\314\n\306\371U\205\243a\027A]B\213\245\200""\021\261\022\031s\014\330\271\036T*\344\347\232\233\231To\"\003y^p\323\310\201\007o\007\r\023\337\371\215\t=\316x_\3664)\232\242\3549*wA\205u\200\256\203\210\353b1\232\374\307\240\341\241\215\351\205\274\032\367\210\204\250DO\277\274\001;p\270XR\351{\204Y\364\250$\323\245\301\256\273\023\206\025\241\020M\247\366\271\211\00684\274\3551\rl[\016\301\274r\027D\016\034W\0328\206\233\354\230\021\256\005\371\305L\214\270\232\276\352l\323\007\204\325\321 $U[\367(\036M(m\330\337bceBg( Vf\313v\262\003|=U\230P\202m\340\357E\036v\023\247\023\203\355\253\213\336\016MOB^?\320\377z^\271\244A\r\240\241\357\221\033\270\377\363?\224\243>\367d\201\252z\2223\321\364\373Y\\j\366\216i\365\022\017\260\221\026?URRk\367\000&x\367\265\1773\254\245?\315\355\001\002\244$?QP\250\033\236.\227\014k\352\336\254\200A\243wL\361\006\"l\364j\303r3*\273,y\205c\301\262m\336T\227\322\366\371\377J9\321eV6\371\240|\230\034Ox\306J(\356\226:\200\240}X\337\3671\342I5S\231vk5\217\302/\210'\322x\360\214.\276\025J\343\217\371\006\004\303\341\010&\351\361\246\r\233\336\007d\376\261\203;\2441\210\351\2040\320\320\207\204\2508(\"\033\274hQ:9Ur\250>\3039R\226P\201\031\342\017h\377/\274[14H\027\342\257[\276\212}jyQ0R\2441\031\036\313Rqd\325&\365JW$\234\307\372\000\350\353\225f\017\334z0[\210\311\373\230\333<\264O\333i\301\345\255\"\275\375\221\001*S\350/\336\005\200\313d\277!\372\311\341\037\344\213I\215\023\n\351O\2730,\361\222\354\247\222\376\332j\237\" \366~\210C\3644\010\361Ho\352e3\240>\262\256d\223i\366\320\230m\247\273\342\010\t\016\374y\314\251\260\242\006\374)\022<\220\274\224\006h\326\374x\000\034./\\\003\257r\200\025\013\007\350\344\030\230\374\\\253>\216Z(\025\0325*\361'RZa\352.\24028\001\252\214\352\265\221+\222\360<\262\313\246hQY\023\316\247\327\243:x0\233\202A9\237hB\365Q\342 \003\005\252\303\000\243\002Qq\340\260\000\0142\324Y\242\332:u\\lb\027\227\227\032C%\314\357?\251\016\342}\005\315\275\335\362\320\270\242z\023\360\t e\365\270\254\364/5\375\237\205\371Ch[D\003C3--*\300T_\371\253\363\3306\307O""\274\324i\215\252\334\226\206\356\330\335un\350\344(8\350\323 K\351\354\242\346/Yd\310\2505\3124\361\014\252\300/<\2211\0324\267\033\336\214\217\\Q6\300`2J\245\276\343A\271\343\305\374\025\243\217\364\232\013K,\331\006\272\353\261\330\0020+K\004\276\342\371\333k\034\227&\213\215\260\313\225 I\203wW\306\021\361@)U\346\2401\t\353\371\330\322\252\361G\244\312\243L0`\366\360\227\325\n\304\271\373\330u\347x\207\210\3052\216A\272\2217\203\206\237\004\277\315\363\235\377\020\177\320:]\345\317\222\352\301\243\332V\035\244\343j\203\3531QI\000\031\210\273\206H\376\225\263*|\0101A\027\250!\265\2732a\215A\221\272A\242\251\361\270\334\003n\331lB|\332\013\227\346\347p\001\201\r\205\311\210\213\221_!G(JW\305X\003cP\224\001\302\224K\214W\217\002\304\r\326\000\212]\217\251M\363\373W>a\302T\354\343\367\275\033\200k\002\013\270\276\3039R\221c\360\346\360\021S7\252\305\323\302\265z\342\330\345\356\252\374T\027\271A\273m\2052A\353W\302\003\364}\365\325\006\203\\9bM\022\233\261\335\361\334}\r\255}\301K\301J\311\002\341\260\347\2759\221\315_t\273z\277\217\320\336\004sma\320\337\004H\006\353*$K\200\217\351\2133\024\004V\366\216Y\342t\370\247n\304\251\242\002\230\274(\tZ\342\267\314\335Eh\235\303P\250Y{`\343\225g\t\0030\234\257c\260\031\237\"w\331\357~_!\352\030\215\216Q\265e9U\010K\240\367KOw\235%\352\230\371\233\317\340\324\035J\0020{\020\001:\266H\027\360\232\203V\263\241e_\245E~d-\267c\017\212\266\033V\307N`J\346^\244\254F\025\005\245!\365WU\346f\t\030\016\212[\271F\337\2264$\036\270N\235W;\277\315\303\374\230\034 \352\327\3436\014\202\372\365\rI\363mp\350 \321H\262\370\344\277\331\2004\373\210\302\274\227,\324*\263m\000\277\346M\010\243\034\230\035>\314\000|\362(\214CP\273\210;a#\305J\372\213\236\227\261@=\014\034\212J\373`\276'\r\320\365\216\251\246S\355\023\254e\212H\026\312lGgM\327\363\310\025\311.);\023\260\260\033\305^\304\030\310u<\3008\313\027\345\372w\332I\356\306\230\222\364yp0\345S\"\221\001\200,i\303\245\345\023\033B\0026\320\322\301\351\315x\331\0376P8\013\261\212I\361\2568""p\3529i\326z\345OQ{\261\212\246TS\2336r\226\312\373\004\330HQ \343Y\306\336\314\204\002\231\355\"\315PyM\251f0}\220b\351\357\303w\027\375\005\255mm\267\354\372\2748\241\217\003\323\263\320\027\247\366\2152\374\334\206\007,\205\372I\324\0258\214\346|Z\346\035X\014\251r\353x\327>A\324\005\253c!\257\251\231\221\233\327c\nG<\271M;\315\262D@\n\341V\377\362\340\264m\216\002'\005y\323\343.TR\335\216[\253}\311\030\331\234\303\211\3319\262T\265\024\217\036'j\364\377\233\000\261\035\355P\033\035Y/oX\342\003\313u\342\247\363q\233w,\230\350\272\030\227\010\350\010\374\221\254x\217\310\312\320\272\321\336\240\223Y\026d\3602\330!\360H\202\333\270\327\263\272\027(\031\334&X\346p\024P\211\n\263\252\220\310\317\354Rs\274\207\215\003tX\373+\362\024G\200\271\025\223\344X\353;\314\215\333\346km\2339\203\241\000\013!\273\031K&{\276)\315\260\226\251w+G\316\251\007\350\363\216[6\2535N\035\030\362\203\360\261?\377\227ZF\301.\022\024\217\010\200\273\375M\000\362`Y\210\315'\225Pf\325\2001\240\346\\\230\377\314a!\302\nz\356\022\002q\327\r";
    PyObject *data = __Pyx_DecompressString(cstring, 4528, 3);
    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) == 2 /* compression: bz2 (4575 bytes) */
const char* const cstring = "BZh91AY&SY\202\005\230B\000\004\202\377\377\377\377\377\377\377\377\377\377\377\377\377\337\277\377\377\375\300@@@@@@@@@@@@\000@\000`\023\235\3375+\303\275\213oWv\334[\330\367\223\3145\226f^\300\032\200\226\204\252A\305\300\247l\366\016i\037W\332\354\r#@$\220\220\310!\251\264LF\221\236\246i\262\"d\311\352\236I\344\215\251\351=4\217\"a\251\352\036\223\320\2326\214\232OS#\032\236\223M=A\240\224\322\000\020\223H\230\232hz\232\t\352=C@\003@4\r\000\032\000\r\000\000\000\001\220\320\tM\002ILSL\010\323OSi\352O\325\033F\210h\310d\310\320\000\000\000\000\000\031\000\321\243@z@$\324\222b\032\212i\246OI\352h<\246\200\320hh\036S@\000\000\017P\003@\0004\320\320\323M\032z\200\r\022P\3654\006\232h\32042\032h\320\321\220\030\2154\320\001\223&\206\200\0000\206@\320\006\236\243L@\221@ \215\000\3214&\223i\r#OSOD\323@4\00044\000\000\000\000\000\000\032hc\243\034\243\004\224\325j\265.dT\026!\326\373`n\377\\\343\370\223vB[f([)\236\301\257\372dc\022\256\341\211\303\330\233d y\025\320\221\021\332ab\220,\3538\300\260\023\257\252\007\252\220\177\326\202\r!SmJ\304\255\370\343\377\222D\3021\307\212\221D\224\250#\023C@\206\323M\t(\211\001Ab2*1AQD\001\030-\203\002\371F)b\201T\276\241v\034\300\206\324\222\r\"Z(#\014$\201\0300X,P\005$\347\214a\201\216|le\200\030\0161dQX\227h\3255,e\214\223 \327r\310\310\230\004\326PM,4\001\241\246\320\246\306\333BS@i\234\024R\325\004\243T\2622Ri\220\322\0306\314\315\341vkT\261E\305\342\204@J\216e.]O\221\226,\027\006fH\031\300\003`pm]\257\230\320Z\002\250\037\303\"\303\244\234\325M0\231\026\243\023\n6\323\233Ob\343r\020`m\n\302LZ\256\005\312\005\031\260\035\301\253bi\323\203P-\221\332\221\002HG\220\026\006\340<R%\r\033M\214\312C\262d\004&j\354Q\244\025&)2\254\303\336\212\"LeUZ\005\267\303\276\305\333L\225\251\320\361\016~\337\260\341etj\273\203F?\360M\037\024\356\035(p\300\010\276\235\370\270\256\275_\317\256(\330u\036\007\326t\344\366\322\"\375\005x\243J\344G\334\234\355O:~\267\032\265\266\230%\374v\236\224\241\212\222x\307R\235\020\372T\037\005\304\336\217\030""\316+7b\025&\277\324\217\363s{X7\256\346\366\343\215\247\360\321<\021\277\037\332\341\243i\t\352\204\242\377\337\026\214_\363\320j\242\272\320\251\323\222:\024'\302Fb\023\266\257\3608\354P&,\332\305%\0070\325\362\026X\331\"\224(N\240vg|`\016 \307\035\333\212\203h\014\315$\301\310\210\232\212\322RL\271\247\204\303\301\323\306\024\234\024\251\240\2433\373\014\236^\312\304\nI\2174\330\304K\334\220\314\327\277\206\014\022\300\251\212X\205\302\357So\300\336\010\270c\260m\261\244\322z)5\350P\356\365T\365\373x\214\305\037\320\220\363\310\331\366\315\326\021\237\003\317\267\236+T<\346\263j\374:\006sY\030\274\002\373\357\nzX\022\337\351Es9zK\377p\025\260\252\261\221\345n\364Mw\205\0163+\311$gt\207\277\341<\362\310a\321.\314\032\362f\226q\352\310\022\363nS/\262\014\230\242\210\252&9J\221Hk@\364\016\016\231\022\201\311C\244\212N\241)\257>\nR\225%F\2056\211=\213a\311\034\270\374xp\r\374\204\274n\351\2702EQS\237?\032Y\346*\251vOO\200O\307\256\022 x\022\007_\214\276\252Vj\251,Q\311\203\276g\216\364\247WhE\321\027\246\231\353g\243\203\306-Z\314\221\004F&\335\252\374\335tHh\214\024fn\033\347O\007\241\343};\026\0006\341\267\301rD\003b\220(G\350\314F|\332\rM\360\023'\033X\366\367\372F6\3135\0339\366;\355\2763+\033\006\303d\3432\304d\"\2350\247\225J;\022$\235\327\255\341\201\017\260\272\275\222\2071\324_R\370\203\3609\246\317\351\375\336#m\353zIkK\276o_[\353\265\343\371\024\265\254\311\270?\235+\253R\216_~\005B\305\001AT&\265\211%\2462U\371\213\027\014\227\"\362\274\345\\\014\n\271\276\013<\262\342CW\325\277\363\347w'\363**\230+\321\3105\254`\034p\300\344\275\343\310\327O\323Z\3532\261\331\307\204:qES\214\252\024\277%a\225\364t\360t#\333\205P\022)@\221\212H\305\236\207\023\250\304>\260V\272 \250\034\242\340\301\266\337\264[\205\212Xp\nr[\241|D\036\\\030\343dE\271\262\271\373\375\366\202\271\337f\323K1\237]\305\300\3666\265kN\360-iT\350N]g\210\310\256\354)\302\241\217\205)\332uI\322x\326\261\200\350\322\217{\335SF\366\202\243]\006o\327\245r\247Z\257\335\312\"\245\347\033\323\020\233""\271\033\271;\373\271?\216\336\317\314p\017\037\310\357\235CpY\240$\340\0250\235\007\\\255\004 \244\350d\216\335\030\304\331j\224\272L\030hv\001\307\034.\356\032TB\230\333j\255\032\233\177\275n\327Uo\260\307P^\275?\347O2\2234\232\341\005\260\351\235\345::yi\261R\241[\322;a\2053\241I\007<\213\302u&\026v>\305z\355\253w\241\201r\324\205K~\310\212\254/b'=\227\203:\210\030\364f\321\243\306q\242\343\261i\252]$G\255\345V\362j\360\345>\344\240S\035\3605\022Pf\275a\252\323Q?\004\264\\g\2434\215\304A\254\033\220\032\224\000\357\004\t\004\302%u1IM\264\247\233h\201B[\230h\202\023+\27091\223\224\3418\360(\212\253\332W\272U\252H\273\244\303\201k9h\264:\036sV\035\306\201\223\006\374YY\265|\213(a\340x\250\tV\312\206U\323Z\204\0375M\007\211\002\360\2010F\342\t\3259f\017\361\n}H\020\240\241:\207\251\335\022X\256\0230u\001\345\227\004\276\367\360\241\202UAa4\032w;\322J\342\374f\275t\301+\343_P@\341\000\026\r\022\025l\241\300#\324\241#\227)\350\275[\256\315\255\010e\226cu\025-$\361\200X\334\022\305\351\261\226\226|\372\315\235\210\r\370\304\347!\336\202\"N\025:\341\315\336\035\016\367\027\201\336l\201P\3252]\304\326m\351\272\030\355\026\335\270\375\261#\032\275~\353\0326\347\307\207Dd\307B\002\313\305s\302\223\362\227\022QI\321\326\017(\220\025\366:\037\226\031B\002<:\341\204:\360\251*\342\200\203\021$\261\206\315{BK\202D\026\242)3y9\210\364\316\373co\027wD\026/\273o\264%\344\212\361\325\356\214\222\237\373N\270Rnt\263\354\317\267K\3133:X\003\2410\030X\202\2142u)\347C\033\311\342\276\017{\013j\312@\250\264%8a\225p\220\354\346\246Hi\021\210H\3344\233mI\303\276\213\363\200k\310lI8\\\r\033\374e\"\212I\022\252\232E\244\335\033F\014\265$\200tu\220\021\024\364d\322;7\241;\326\030JL\tDMn,\352\003\304+F\355G\242\233'S[Z\251@\3134\032\246,N\254\305:-\026l\246b\266\340f\356\207S\273\371\032\331:\022\023+\210\266\244C\237\204\227nQ\362\2749\222\243x7\027H\344p\273\276\236{U\303\352\306%\220\314\033\rd\356\353\017\\_\020\234\312\220\226\"\343V)$\222I!\036(\355\000\274\207\007\014\2253\272I$\222I%""\201\346\3235\201\2516L\367\227h\010\234\261\265E\217N\243#.\303V\026\0340\215\355\311E02\264\200\204\212\302\n\354\245\007d8\3544T;R|\377\210\001>\214O\225\036\\\213\246\031\273M\227\277 g\347\306\273\\\020\351\267\035fR<N\256\347;\325&\230\230\033nm\003\\\247ks\350\016u\266\330\210\205\2136\371\253\204C\310\310\336@9\306\021c\033\026w\304\204\267\020\276\330\353\206A\302\244\251\237I7\036\003\rg\337wq\340m\006\2074\376\270\353\307\205T\241\017\033\224!x?_\307\276@\260\321P\"\364JQ\344*t\311@r@qh!\244\336\304\3060\032c\023+\0062\014\024\214\312\227\206\274\345]Rrv\323\254\350\224\243\357:\373\307x\362\367v\367\327\241\267\263\006\301-PF}\324\206\221\rQ\225\037\001Ne\322\355r\224\r\227\221\233\335\274D\214\013X\315\343;B\035Q\243\030\341\2354\336$t\260i\215\244\322cX\265\326\242\232}\006\252\337\315\340\352\324\336/Mn\330\257\202\265\306Z\245\242\346QE\263\300\274\034\370\236\263\236\304\257\301\r&\340\r \340\342\254W\036\366|\004k\031i\367\270\222\247\035\227\031\205\271,\030\273T\361K*\360\351`\225\314\264#\330)(]\206\201\206\t>\370M\277o\304]S$);\3541\t\277mBQO\330h\303\206\345\235\305\345z\242\037\233\242w\331\206HB\031`\362\304\006\265\326\323\035U\314\266Oz\211\240\325\026q\210at`\364\213\247\276x\024\273\335\345\330o\3524\253\342\213\375|\356LH\010\352\265MU\035JUk\\ov8=\252i\013\361\303\034\365d\305-\257\021\263\270\355\334\204\244^\242Y\t60\2721\255\256\275\300|\251\0046\227f_\217\250,\264\322\016\344\240<R\320\272y\342\275\273m#M\010Ug\200%\255\204E\201\270\336\321\036\254\271s+j \331\334}\303=\250(\250\206=\234\252\224IZ\350-<\254U\r\266G\317\236U\331\214V\010\204!6u\035u\"\322+\261\300\253\207JE\\\022D`\310\026soj\346\346\361\313\201\253*\325\304\232\2168M\022Ij\226/\253$\270d\2022[8 \254\216i\002\333\313\2138Lo\212I\025M*\230U\004B\252\200\201Q\330\352\264\002\267Cl<\\\371\323\014f\373*f\222\225P\026\343<\302\305\306j\337t[<:\340\345\023~\216t\234\371\237>\")30=\300\315\31564\354\257\361\354L:\204\316\014\321Q\213\255\205cP\264\221P\247\262\221\273`""\275Q\000PP\024\026H\242\305\201\030\261,\306\324\023\0355\002\332\232\024\207\024\007\253\306\223iP\225\203\311\030\256\310A\224\256\311\274\230\330[\273zD\016lG#V\371w'.nRp\352/m\314B\234\246\342\344\021\353\300;\250\016\336 \273%\3471@:\332^+\307\247d\243\253\t\333\213\212\rof\263\303\210O\204\255\243e\345*\246\3710:\n\032\274\232\232\304\314\307Z\274D\320\233fz}\354\033\343&\023\3103/\343#f[\027\003,\336q\232\017\203o)\242\202\332\203\251\222\320\265\212\202\203\034FmVn\301\216\017\0145\352\227\031$]\334\361U\316\030~\341\374|>fj-\331\207\02434c*\261fw\232g\235\316\340\323d\204\206C\276\204m\264'\240\023\034\271\022c^\003\003\002\r\343\275\263oa\321\235\032\014\250\330\352\363\353`\030\350\346\322e\264\225\323\250\003\244`V\263\200\355\225\376\023\\\247\326\264?'\277}\222[\233\211\023w\206\243~c\016\030L\372x\270\307\035=\016\303tD\261\306N\254B\005\360,#\314\0231\003Mx1\0104\006\022\021\230\203=\201\343\341\217\322\035\332B\036\255\313%\322\343>i\007~pJG\017VU5\t\r\033\246\030\330d\231b}\376\276ci\214\333\222\263\203l\376\224\0334\347\337n\317a]w\023\247ZGy[k3kh\217\364%$d\245\325;2 \356:\202\200\036\022\244\327F;\017\2649\010\022iP\331\216^\016\236%\241\247\270\345\256G\021\353\262\033\331F\004#g\244@s\254\254=\321\331P\337\211\006!\252tS^\311\206\252c\"\t\013\316\262\244\240J\200i9\203Ju\027/P\305\241\334\223[\177r\315\276\234\324\242\317\0022\225\207\000K\2025\341\356\366\231\030V\023\337\237U4\250g\023\253\331\2456l$\310h+\224'\004\230U\206\001\255\254\314\3677\032\204\032\2202\343Pc\233M\031cX\342\200\240\263\0132\323r\307L\232\261\020\242\271\203\331U\006\260\277z\344\306>W\\\200}\262\t\253s\244B\333\232`\323\272N'(\353\014V\225\237f{\202\337\336\362\350\326\304\230\371\227 B;\345\324\024\241Q\212\257~&\200\350\235c\362\324X\243_\324fUb\212\224(5\363\214%,\244\303[G\037\237xF\n\364zI\223\003f\036\3211F\211\023\331\252\311!\260i\362L. KoD|\013lm\277u\375\214\207\006Hx\200\315Fm\211\236\327YQ\3518\234L\363<\277\026\275\252\367\227i\332g-\033\245\221\333""\016\312:y\273\005\334\330]\305\0140\003\010*n7zd\352\322g\177\303\004\021j.\002s3\347\253\232h\340\274\303(\366LQ\210P\234\"\nL\353k\215\022SDz\320\274] \022\323}\351Y\213=<\305\274\026\201r\207*m\257\235\312\215>\227\210\276i\371\373\235e\303B6\272\206\323\2319\177\251\002rUY\004`\014\3579\004\373z\355\302\007 &\341\001\020b\002\243\263\302G\216\317W\314l \334KK\025\"\333\3666\303J\323\220\222`\375\310\222\366\270\203o\203\204\313Q\2140y\262\250\036\304\374\255+\357\335\3528\362\254Y\237:\254b\355\225\232\307;\311\234\243`\346\210Q>\340<\217\252\253\226I\270\376\027\000\303\252\252\236\004\342\324\023\230T\223\222pz\031\014\231f!\211\210\234x\240LN,\211\\\034\346\2251d\364\353\331s\245\034\234\014w\330V}I\2307\246\231;8I\322\276#\326{\246qhsL\361\352\020{\302\320\343\3310ntvL\210\262'\016\204\357\371\374\356\023\213\336u\007\266VH\341\377(\223\247\023\240C\204&\224\3216\026j\013\004\275\014\"N\301\030\356\320ng@\024B1\202(\215\"\036\246R\210\206\027g\214\3063+\227\034\341\2409\354\235\326\206`{\372\037\257\270\220h\222a\263\231\343\036CtI\362\261\023\357\325B\0148\347\007R\000\222\005\311\002.\263'\016\224H\007P\211\000\021d(\232@\301`?\276\207\326.\353\245\314\003\231.0-\206\0277\230\3544$\271\251\251\221\336\225ro'\2019hg\274\366\325gC]\221\376\204^\035t\336\223\327\236\272m\216gz\234\r\322;\235#\266k\221W5\\\327\341\007\372\216H&\351r\307\023\0353\341xd\316\3746:\007M\316P\205\234i\006W\243\264\355\367U6\223j\026M\306\344\352\341\334;l\331,B\241\334\207\202\006B\311w8Y\201p\035\027=\253\245 \326\223\001\2169\206\310YA\221\255l\256\310\326;\316\\\001(2\340\350T\022{\255m`\212\311I\333\246\366S\273\304\241\337%\330\t\232\374\304\336q\250m\324M\246i}\366+9\214Q\214]#7\272\333\330\333Cx\315\257\036\026\334\241\325{!x\333\330>mGhuX<\307Tw9\272\232|\006\313\314\177\215M{\357\233\334h\354@\362la\030\362\365\213x\266\2746\313S1\333\347\331\342\264\317{\364u\225\214fw\213+\033\3744Z\0327F[.\326Z\317\326\313\304cgC\231l\303nG)\3056<\333\247+\2236\366o\321u\246\307\332""\306\345\302\210\215\322\372kUn\377\013\305m\272.u.Lr\022\337D\360\223\244;\225\212\232\204\213K\017\005\230\240\252\255h\343\036\211\246yC\320\277DW(\202I\215N\310\213\263\274\303\025\001o\243\177WS\227{\332\354v\r\315\254C\356]\323\013\222k\323\246R\360S\346\254\272&\311\234|\001\031^E\035\340Wi\306\254a\242Fg\202\314i\363\265w\333\267Z\357\262\265a\264u\230D\304\020\020\234\214\\\013sD!\256q/SD\272\230L\231\341\324\244\251\335[\316\t\271O8a\356\246\342\321&\"\245\337\335\233\305\334\276TE#\027O\225\3731\017T\310\234\327\226b\334\257?\305\274\3510!\232\363\"\254(\212\306\332*\353U\366\315sY*\332\202h\021\004\341D\313\253r\024\017\n\007\"\220\320\213d\322\305\017xj\227yM0\314`wd\234\260{\026.\352\002\256\352&%\352\332\204\241\3603`\031\260\016\236\236\255b\251V!\260\337pQ\226\001\306\247\303\264\3458\252U$\274\231\nbJ162\302\252\247\245\211RJ\265\213uv\211\324-\313\312\355T\260\343\213\tC\t+\300<Z\377\305\334\221N\024$ \201f\020\200";
    PyObject *data = __Pyx_DecompressString(cstring, 4575, 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 (4582 bytes) */
const char* const cstring = "x\332\305X\313w\323V\267\307\267\201\032\032\036)\t)-\017%\345\225\024B]\302\243\320\227!\341\321R\210\033\332\262J\271Z\212,;*\262d\353\021\342\357\262\2762\314PC\r5\324PC\017=\314PC\017\363'\364O\270\277}\364\266\225\264\267\375\326\272k%\226\316>\3229\373\361\333\277\275\217\026\236h\246\304\231\353\202\311\335\353\232\353\232\312\311\006W\227\024yM\322\005SR\272\234a\352\262hJ:=\244r+\313+W\026o-r\202Z\347t\3517I4\r\316\260\326DE0\014\311\340\264\006\267f\311\212)\253\234\331mK\306\002\367\250\301u5\213S%\251\316\231\032\327\306s\331\027\314uI\345\014\311\244\033\356\242\240\252\232)\230\262\246\362x]V\233\027\271\272\254c\023yC\242\267\357\013\212!-\\\\y\240K\206\245\230\027\2717\334\023M\225Vj\206\244\326\357+\226\261\376\203\324\261$\303\344Hd\376\300\236\252\232\246np\rAV\244\372*M\253\242\364b\255kJ\306\313\350\375\2744\022\216L\312\252\031\313\270\027\334\245\271\257.\315}\375\005\367\225P\257\363*9\021.\374t\363ex\341\204\r\354'\254)\022'\253\206)\tu\216\255\235\335 \274\327tx\254\321\200\177\245\3156,\225\352\227\271\246fr\242\200=\025N\324T\225\354G`\260\t\247\265%U\252Gs\241I\2679Q\321\014\211k\353R[\320\341\345D\234\177\025!i\313mD\026\352\267\264\272\204i\303j\301\307\230i[f\3465K\251\253\027MNP\024M\004\006\270\225\007\264\324\250<\263A]j\010p\265\261\347C\262\332\320F\037\220Zm\263\313\305!\035\235o\300C\222!\nm\211'\217\t\204\261\342\247,\365\317\237\203\032\244\021\251\002,\352\206\224<\"\352\022\323\227\371\366\036\236\341\2645\302w\361\003\303\223\320\036 N\215M&\010\231\321;\nC6<l\351\272\244\232\310-M\245\004\263\332mMG\340I\271\307\262jm\326a\207\216\014\034\215i]6\010T\222\312~u\035V\313,\274\262(A\007QB\242\350\267\271\363F\344\t\271\216\215\344\206\014x\305K\354>\243j\331h\265um\003\017\325\243\347\025\031\034 (\303\313\014\213\367\\\203\250\004xK\226\330\224D\313$Ib'RM\357\026<\220\227\207W\"\004\330\000\003r\270N'\215\256*&s\rb\007\270(\244\207d%\222fu\032\021\020/e1l\204\351Vo\212\224\245\262\021\206\242\256\310\206\371\342^\204\254""\247mz\366%\2231`\203\202\226\340\203\227\360N\224)\034\317\303^K\224x\236\253[\214\334TM\275\002\007m\310p'\317\213\262*\233\230\304\236L\005E\206\255w8\204\327 =\010\274B\213\007\354[\002(8\0341\312\215\3567\004\005\226\202[L\306\271\2575\275\016o\211z\227\351\226\230\027z~\324\305m\243+j\355&/^mw\256\306\031\263\320\356n\346&X\\\361\362\310D\273\031B\276h\002\213\025\210\303\364\037\236\240q\010kR\021\342.W\027L!Q\223\005\024\025\302\340P\261\332\035\256\241k-nE3L\254\267Z{\314\262\217\275YL\221\311\364\310\302\271\031J\341\341\211\335s4~b\027P\307\323\241\224\352(\013\230\261\313\003\251\324d\231 \256[\352+,\252k\257\r\206\367\350\211x\036(Z\003\327\275\312b8\2363\360\203\212\204W\263o2x\215T\233\004\350\273%\300\250\034b\363\222\251KXX\027\232-\340u\316\264\332\n\253\234\227\271\226\324\322\364\356\206,\275~i\231\215+\267\356=\375\376\373\352\223%\376\351wq\332\344\323'\036-P\246\264u\236O\004M\311\344\343\202\223\010\031\231/Gx\214\257\013I\226\211\254\271\341\371\314\014\274b\240\331(\230\313\226\221aa\312\233\3033\021\025\016\213C\322K\244\371\"\265\014\206[\205\022\226q\237e2\365\005\350\310V\343\222\260L\024\377\264M\275\030\\\202\305i\214z\314\302\025_\311\007\331\373Q\253\207fG,\317\317Kh\014t\211\217sX\034^>\306WN\330\000_\031\3539\021\305\211\325(\276%\031\206\320\224r\263mM\311Y\260\300JhN\002%\365D\262\273U{Y\264\220w\325B\003\360\014\373\231\360\267p\325\335\275D3\341J|f\r\021\235q\023\016\213x6\226R\232\360\024GA\311\213\"b\210\205a\022\345G|\344\236\254(vG$C\367\0068R\357\026\311bJ\312\357\231J\363\333F\305`XkVQ\371\270j\362\304\023\361\014\260\312g\357C\336\312I\206\266\330D\t+Z*\001\013\033P\311\215\356\t2I\304\022\0018\230'v\316\310\206q\025\313\3032\022\td\203_\263\214n4j\t\257$\236u\233\371\247\250{B>\307\2060\253$r\202\301\0223\026\207\200\017o#\213\250\301\210e\241\345\361\310\032\325:\221\201\336#Q\214\370\344>\033\365P\220\2159\025\006\276\000UYy>\000l\246\030\026CS\005\357\261\270\360Q\307\224\235\310\333\312D\254V\215\010\362\010\311""\312\207\267\203k\302\272\306S]\313B\2059\201\325-\232\032\2361u\001\251\333P\204f\274\013\223D\367\226\032\215X\210\273\331V,>o\304\327\"\036Hf\n\230 \232\023\025I\320\223Q\010J`I\251'\262F\330\242\245cX\220\016T@-\035\031\362\2772#\223\032\313\241\241\250)\031\t\332\275dT\220\024\231\031\326\r&\222\264[LD\344L\001\007e\031\r#R\241v\227\235I\343k\201w\322\231Q\357\324\"\016g\007&\214\030=\256\304<ScP]\t\301\030\rb<\324\322\216\342G\364\030\017VW\253+\217Vj\021W\305K\260\202WcL\265\022\345\342\367\204\213\032\021N^\322\260\220P\272f\342\340\251\374\024\366\316+\265u4*8\266\303\2748\225W)\223\331W\204{Y\345RA\242 \254}F\240\272\3170\327\t\3136l\356n\342\177I\006M?\2216\315\037\244\306\263\345\347\317\330\223?\241\345\t\235\225\336\215:477\342RAij\272l\256\267\004C\224e\201\210\207g\277\262\206R\240ktJ\222\014\n \375 \262@\231\300\216\003q\261^\263\032\341w\206\360\227o\233h\251\350[M\235\217\316\024<kI\014Q\244\315\242\322\237\226:1|O\204\037E\340L\214N\036C\245\017\347\026\372\260\303\323U\022\324<\"Y\262\340Gm\232\353\206\310\030TV\303\024^\023\304WYf\313\263\231\250\030\242\032r\t\266\267Z*\257Z\2555(\303\006r]\324Z-4\322\270\264\251\241\r\277V0\034e\253i\256\214\2468\343QG[\202\336\215\0179\271\312*\202sD\346G1<P\021\241\323\267\223\360P\253\017q\353\010\237\206\002\326\317\302)u\202Gx\301A\276\r\337\351t\245\264\207T\023y\036'{\254\215p\361\361\315p\231.\352\316\nj\266\244nl@\001]o\031M\026\204\0147\345\202\302\006F\266'\035it\363\375m\256\255\2256E\372c\006\262\016 \323\030\344:\0026\010\013\352hW\320\210H\222iG\276m \214\252\026v\t\214\334Y-\"\352d\214\031=\215V\216QfH\215\tA2^\344\371\206\205\034\341A~\217\265&\\\220v\026\271\226\"{\226\030\241\320\264\241H8\224\255\030\346&/\313\300\273\334j+\370\205\253\302f\203\3075\311Hx\254e\274\222\272\0248EX\223\224\020\374\n}\344Q\230Z\364K\341\346[\002r\201\037\351Q \222L!N*\362\226\205J\310\223\027\222_\226\266\270J\257y>nf\242tA\236hm\323\2006\271\357\005\341 L\242\264\030d>\"d\277!\0147D\354\244\305\340Xo7?kw\201""\320\360T\037\376\022\263\304\307yj\232r\335R[A\334\240\003\345c[kG\350\340\371\364&<\374G\227\205$\r\214\344\253\300B\273\023\317f\357\350Q\253ed\004-\331\020I\227l/\226m\302\260\031H\233\216e\344Yv\277.\211\257\220\374\341(\016\000\335G\021\247\333\020]tg\251mY|\205p\304\207\273P\274\301\200Hkv,A\tc\224~\355\031!\376D m\206\003:\353bo\326\377\245]a\246\035\214\024\013c\251K\246\245\253\324\032\205\341\3247\014CR\032#\275bA\223X\324\035\026\267\205\243\375`\266\021L\033\273\221\326\257\240\347\313w\032\205\255\037+\200\021\272\013\372\277\241\306\017\303(\2033\205\223/(\242\304\025\206\2410\037\262\231\020\317`2\374I\320\266k\260\320QZ\323$\037\356\302\022\202o\010\006\325U\271\216\037dq\376\030\0375\232V\033\030\223\300p\311\336\270\327A\304J\230IQ\241\215\353-<\202%7\301\035\334\245\225\356S\366A\231\233\277\314Q]\340\346q\263\322\345\rV\034 \236\333\307G\225[0\"\362\345Q\363\230Q\301\330\355\336\314\240|\"8\361\251_\032\214\277\037\274\277\020,<\350w\006\345\367\266\026\267:\220\3303\301\361snupl\321\257\372\317\202\317\277\333\256\004c\364p\371\003\247\024\234\234\367f\3768\260\357\310\005\2676\030?f\277\347\\s\352\356\202\377\256\337\031\034\373\320Y\360J\336)\277F\213\335\261Eg\"]\316e\302k[\242=\221\335c\316\233\360\316\005\013\337\364K;\345i\373_\356\204;\023\214}\342U\006\345I\373\221Ss\352\301\354g~,\342\334R\262u\270\327\244\367\337\275J\357\361v\211\026\277i\237\263\205\354\342\013\236\340\231\301\265\345~\244P\323\301\213\307\203\3430a\360\301y\267\026\\\270\351\277\351W \263o9\225\235\360\022\214U\374\211p\233\237\275j\201\215\227]\301}\343Wv\265q\310\213\227H\315\340\312\327\275Nd\305\031G$3\007\345\271`\356\353\336\233\355\n\355\361_\366\314Ny|k\331\236\262\005\033\357O\332\217\335\222\213\265'\354\t{\326~\350,\247\203\357\034\013\013G\203\307\356~rG8\370\326\221\334J<x\344\374\210]\212f\276w\247\\a\247|*8u\305\253y\365\340\263\273\375\363}k\273:(Cm\033*\216o-\331\357\340&cY0\2068D\020\270\354Uw\205@\360!\274\353}\341w\376!\006\256\221\207g\203\331""\305`\361\333\355\031\006\324\371`\376\313^\361\022\320\310{\026T\356\365+\231%\200\337\235\303\347II\240\235b~l\322~\022\314\336\352\2252a\372\004 \023\006\271\227(Djp\371n?\331\366\253\236\020n\333\264\tA6\303\n\220\002o\260\245\202\2433\356\264W\032L\000\241\356$sKp\014\212\005c\327)\031F\314\000\030\376\272\031l\t\346w\340y\017\277\323\313\277\366&\376*.\201r\377\\p\343\341v)\030\233u\257\372'{@ \364\247Go\330\323\260\214R\345c\267\342&^\264[\030-yG\374\310\033kv)\273\"\320\355-\005\237\222\337\312G\267\000\367\233\204\002\2469\350c\017\315)O\337\364*\177Gs\026\314<\231E\351\276\007\231}\350\314\3741\276\357\340\370\326\347\301$,s\353\336L1m\274\255\016\026\257#Q\275\263\275R\350\331,jv\312S\366/N\307\205\032x\357\217C\373\016\236\214lMa\307\260\355\t\205\321\3162\303\274w\301\037\357\001zG\203\243\344\363\245\340\022L\303\376\247\317\014\312\025\377l\237\305\345z\234\225\021j\017\007\2079F\023\207O9U\220[\350v\000\001\020\016\316D~\272\337/\002\357[\246\3608\014\332\260W\235\322\250\313-\320\304q\342\231tb\247<\353\316\2707`\322y\257\003+\313\021@\226\274\375\340\341\353\375(\257\014{f$\275=\2119\024 8xdk\025tw\301)!\320\207\247\355\016\345\020\364~K\234\022)\364\263\203}\217n\231\366u\347\260\273\212\304:v\302\026\202ir\030Q\363\301K\301E`\253w\240'\364:\271=\341\227\3011\024\270\3365\232Jw\233\031\332i<\335i\031\t\373\314\233\362Z\364\316\236\326\276\227\3526\035L\303,\"\224e\347Lp\361Vo\177\357y\277\326\027v\306\247\355\177\207\205\305\352=\354W\373\265\235\021\365\020\327\336\361^\265\227q\306%g\026\253\346UDt>.\332\377\257\007\013\321\271\200Zez\327\375#=\251_)\214\016\243\034\177\212\245\323\336\3219\262\213B{\005k\007\244\261\356(\250\0107\375Y\377\256\277\206t\035\377(\370\010)\0269\317\355\372\373\375\347\275Z\017\276\303>T`g\234J\272\306`2\247ay\037\224\032]\321\371\032\202\317\375\345\336\304N\371\360\326\317\366]4\002q1c\332\017._\031\224\221$H\246\240R\355O\364\347\267\253\333\265LN\035\335z\315\250\007\033\277\"\336\335I\2558\341\275\366\005\177""\023P\233:K\351\316\224\333)L>l\364Mup\360PD{(\231\344\323Y\227qG\205\312:\302\314\270\001\010b\305\327_\350\227\267\017l\013\005\224\225\362P\030\230\037\231=\303)3\375\301`\2122~\232|z\212^<x\210\360}\034\250\232so{/\202[\254\362|\350\\q;\360\337n}\r+ \203I\316=\210d\370\r^\235\234\363N\372\363\275o\211>>r*\316C\367\221\367\313\036u}H{\024p\177\211\355\375\237T\223s\017{\265\177\242\345\347\366=;\247'\265+\213\301U`\"\351\002\240py\337\211+\036\323\361\000\203=\275\372\205\375\032\244;~\3229\013P\234F\021$\202\247 uv\3123I\210\247\354\227\356e\0107}\035%\003\372\357\267\177L m[\316\303\340\334\027\310\376_\267'\366\010\0065\267d\345\001W\366,\377Q\017\331\034\241\371o8\377\377\333\226y\267\232\263e\360'\266\214\024\312\302\020\261\214\236\264\037 \346\325\250\346M\242\315\025\0343\370\030\346\007c\310\312\250\016O\333oX\225*\215x\2126L\032\255\364\205S\316cv\270\310\"\3468i\234\354\276\223\3448\2628im\246C\302\240S\311\rR\366\230}\024\204\261\037\254x\310\337\275\305X\270J-\006\216M\276\260G\213\2214\335\305i\361\256\333\361\306\251w\375G\270'\373\331\372\323\366\377\200\353\027\335N\204\204\367\221\2463\330\3617\357\035\360\354=\3549A\331V\3155\024,\313\377<\301/\270\245=y\210\026`x\221\274\333\301uzi\362\0146.\375-\032J\233\305\377\224\202\316UT\376H\277\n\361\317\304\377I\277\021t\247\271\272\223\303\"Q\374\357\300\363Fp\376\206/\204=\346x\324c^E\236\376\205\036\323}\026\314\335\351!4\264\026\n\277\275\210\332\261\337\371\225\275\260\3567\251\354\006cdA\224IK\001\207\366\225\332\321\031\022=Da{\026\314\300\207\244\321C\267\032\356\361\233\363\216\023\037\016\251\177\306\326\023\366\t,]FqdjM\234t&\234s\216\352U\331!\tgM\347\021k\264\257\366\246z\315\302\006}\326\375\230\374\355=\367koK\203\261c\366a\007\207N,\226\030\235k\254\031|\275\242c\024\235UOR\367\302\024\241\220,Q\376\234v\342c\024\316)\t1\374\316\032\244J!1|\344\334&\343H\233C[\237\3305:'\355\361\355\343R\2320\273\004>w^\n\316S#8\031|\371t\273\0235\356\363\336%\177\206R\2766H\354d\207*\364oB\201\212""\314=\2058\030y\020\326\017\235\342J\205\317\321\2116|\216:\272/\211V\006Sg\210U\335\nulO\335\312[J\216\375G\266\236\301\351c\343[\017\354\212}\237>\212\014\306\336}\273\201\336k\331\231tB\216'b\351\020\250M\347\006;\037\343\211\016;\342\314\021\271zM\377E\377\335>\236\310IJ,|\t\023\235\260e\020\340\230[M\234\204uO;\317\tN\301<\373\230Up2?\357\376\342u\322\317\025\203\324\251\023(o\3569W\365\001Mv\256g\207x\366s\326y\023\036a\277\351\037@/\037\327\300\027t\250\017\316_\367\177\352\205\313S{\271\023}\242\211'\006\307\310V\372\t\306.\270B\362Y`\250+\017\306N\330Q\204\376\355\374\214\271\211\330\271\364\311\200#\240\022=\2253\213\307\357\214\007\343\2542O\242\327'\013\220\271g\350\020\230e\t\302*\365\374\033\036\222hg\014\355*%\364{\275;\375WA\355\207\301\030}\341\272EGz\n\305\033\373\246\003\357Q&\335\361\325>d08\030\203\t\311f\207\223\364\241\003*\001=w@=\330?\336_\242c86J\3224M\257\023\266\026\235\256\213\262t\227\324e\333\223\177~w\232)\223\010\314?P)\030\273\210\3760:\034\335B\270\036\261\272\031o\250\022\351yg\374n\177\177\277V\370\225\"\375\306\022\001\n\033F_\003\354'Q\n\027Vj\366ddY>\371\247N\207\307\361\202\304g\256)r\307g8g\225\212\353\361\377\002\031\244i\311";
    PyObject *data = __Pyx_DecompressString(cstring, 4582, 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 (12136 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 sending 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 rows mode failedsetting"" nonblocking failed: setting single row mode failedthe cancel connection is closedthe connection is closedthe connection is lost(tree fragment)tuple[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.ftable""PGresult.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_modeffformatfieldcodefilenofinishflagsflushfmodfnameformatfreefsizeftableftablecolftype__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_statusparsepasswdpg2pyencpgconnpgconn_ptrpgresultpingpipeline_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_numberrvsselfsend_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\004:\270!\330\010\026\320\0260\260\001\330\014\022\320\022.\320.G\300q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0204\260A\260T\3209K\3101\320\0040\260\001\330\010\030\230\001\320\031*\250!\360\006\000\016&\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230.\250\001\250\034\260Q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\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\004+\2501\330\010 \240\001\360\006\000\016&\240Q\330\014\032\230.\250\001\250\024\250^\2701\270L\310\001\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\0041\260\021\360\006\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230,\240a\240|\2601\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\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\0042\260!\330\010\030\230\001\320\031,\250A\360\006\000\016&\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\320\032*\250!\250<\260q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\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\"\320\"4\3204J\310!\330\014\022\320\022*\320*=\270Q\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\340\r%\240Q\330\014\026\320\026*\250!\330\020\024\220N\320\"8\270\001\330\010\013\2104\210q\330\014\022\220+\230Q\230a\330\010\027\220z\240\021\240!\320\0044\260A\330\010\036\230n\320,B\300!\330\014\022\320\022*\320*>\270a\330\010\013\2103\210g\220Q\330\014\023\2201\340\014\023\2201\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\"\320\"4\3204J\310!\330\014\022\320\022*\320*?\270q\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\0045\260Q\330\010\030\230\001\320\031.\250a\360\006\000\016&\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\320\032,\250A\250\\\270\021\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0201\260\021\260$\3206H\310\001\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\340\r%\240Q\330\014\026\220m\2401\240D\250\016\260a\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\360\006\000\016&\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\320\032.\250a\250|\2701\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\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\320\0260\260\001\330\014\022\320\022.\320.E\300Q\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\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\340\r%\240Q\330\014\026\320\026)\250\021\250$\250a\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\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\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\r%\240Q\330\014\027\320\027-\250Q\250d\260.\300\010\310\006\310a\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\360\014\000\t\023\220(\230)\240:\250[\3208J\310!\330\014\032\230-\240q\360\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\320\032,\250A\330\024 \240\t\250\025\250j\270\001\330\024)\250\031\260*\270J\300a\330\010\033\2301\230H\240I\250Z\260q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\330\0203\2601\260D\3208J\310!\200A\360\006\000\027\030\330\025,\250A\330\027.\250a\330\034$\240A\330\t\n\360\014\000\t\023\220(\230)\240:\250[\3208J\310!\330\014\032\230-\240q\360\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020 \240\r\250Q\330\024 \240\t\250\025\250j\270\001\330\024)\250\031\260*\270J\300a\330\010\033\2301\230H\240I\250Z\260q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\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\010\000\026-\250A\330\t\n\360\006\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\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230.\250\001\330\024 \240\006\240i\250u\260I\270Q\340\010\022\220!\2201\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\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\360\006\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\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230*\240A\330\024 \240\006\240i\250u\260I\270Q\330\010\022\220!\2201\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\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\330,-\330\010\024\220G\2301\230A\320\004,\250A\330\010\024\220J\230a\230t\320#3\2601\320\004\034\230A\340\r%\240Q\330\014\027\220|\2401\240D\250\001\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\240Q\330\010\027\220z\240\021\240!\320\004\034\230A\340\r%\240Q\330\014\034\230L\250\001\250\024\250Q\330\010\013\2109\220C\220q\330\014\023\2201\330\010\027\220z\240\021\240!\200A\340\t\n\330\010\030\230\001\320\031-\250Q\360\006\000\016&\240Q\330\014\027\320\027(\250\001\250\024\250^\2706\300\021\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,\250A\360\006\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020 \240\007\240q\250\014\260A\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\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\340\r%\240W\250A\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\006\000\027\030\330\027.\250a\330\034$\240A\330\t\n\360\014\000\t\023\220(""\230)\240:\250[\3208J\310!\330\014\032\230&\240\001\360\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\320\032.\250a\330\024 \240\006\240e\250:\3205J\310!\330\024\036\230j\250\001\330\010\033\2301\230H\240I\250Z\260q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\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\360\014\000\t\023\220(\230)\240:\250[\3208J\310!\330\014\032\230&\240\001\360\010\000\016&\240W\250A\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230/\250\021\330\024 \240\006\240e\2501\330\024)\250\021\330\024\036\230j\250\001\330\010\033\2301\230H\240I\250Z\260q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\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\034\230A\330\010\017\210\177\230a\230v\320%6\260a\320\004$\240A\360\014\000\t\031\230\001\320\031/\250q\340\r%\240Q\330\014\026\320\026)\250\021\250$\250a\330\010\013\2103\210c\220\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)\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%\240Q\330\021\031\230\021\230$\230n\250A\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\340\r%\240Q\330\014\026\320\026*\250!\2504\250q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023$\240A\240Q\320\004\031\230\021\330\r%\240Q\330\021\033\2301\230D\240\001\320\004\035\230Q\330""\010\030\230\001\320\031+\2501\340\r%\240Q\330\014\027\220\177\240a\240t\2501\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\"\240!\360\006\000\016&\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\020\032\230(\240!\2404\240q\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\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*\250(\260!\340\010\025\220Q\330\r%\240Q\330\014\026\320\026+\2501\250D\260\016\270a\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\240Q\320\004%\240Q\340\r%\240Q\330\014\026\320\026)\250\021\250$\250a\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\240Q\320\004\035\230Q\340\r%\240Q\330\014\026\220m\2401\240D\250\001\330\010\013\2104\210q\330\014\022\220!\320\023$\240A\240Q\320\004\030\230\001\330\r%\240Q\330\014\017\210t\220=\240\007\240q\330\025\036\230a\230t\2401\330\020\024\220O\2401\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\027\220t\2306\240\027\250\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\031\230\021\340\r%\240W\250A\330\014\026\220i\230q\240\004\240A\330\010\017\210q\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\010\025\220Q\330\r%\240Q\330\021!\240\021\240$\240n\260A\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\210\177\230a\230v\320%6\260a\200\001\330\004&\240a\240v\250Q\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\340\r%\240Q\330\014\026\220o\240Q\240d\250!\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\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\r%\240Q\330\014\026\220n\240A\240T\250\036\260y\300\005\300Q\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\027\220q\340\r%\240Q\330\014\020\220\013\2303\230d\240.\260\007\260q\330\025\035\230Q\230a\330\010\013\210;\220c\230\021\330\014\022\220!\320\023$\240A\240Q\320\004\037\230q\340\r%\240Q\330\014\026\220o\240Q\240d\250!\330\010\013\2102\210S\220\001\330\014\022\220!\320\023$\240A\330\020*\250!\2504\320/A\300\021";
    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 < 442; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 94) 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 = 442; i < 524; 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 < 524; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 442;
      for (Py_ssize_t i=0; i<82; ++i) {
        #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
        #if PY_VERSION_HEX < 0x030E0000
        if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
        #else
        if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
        #endif
        {
          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
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        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), 73};
    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), 81};
    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), 89};
    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_av_6a, 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), 92};
    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_Q_t_q_at1_O1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 121};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pgconn_ptr};
    __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_Q_3d_q_Qa_c_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 129};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __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_Q_m1D_4q_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), 136};
    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_av_6a, 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), 139};
    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), 198};
    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_n_B_a_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), 213};
    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, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 288};
    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->__pyx_n_u_pgconn_ptr};
    __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_WA_3d_q_q_A_c_AQ_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, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 301};
    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->__pyx_n_u_pgconn_ptr};
    __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_WA_3d_q_a_1_c_AQ_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, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 313};
    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_pgconn_ptr, __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_8J_q_WA_3d_q_Q_j_Ja_1HIZ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 344};
    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_pgconn_ptr, __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_8J_q_WA_3d_q_A_j_Ja_1HIZ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 375};
    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_pgconn_ptr, __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_wa_a_aq_1_axr_U_1_auH_A_WA_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (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_pgconn_ptr, __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_8J_WA_3d_q_a_e_5J_j_1HIZq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 439};
    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_pgconn_ptr, __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_wa_a_aq_1_axr_U_1_auH_A_WA_3_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 472};
    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_pgconn_ptr, __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_8J_WA_3d_q_e1_j_1HIZq_c_AQ, 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), 504};
    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_44J_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), 513};
    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_0_Gq_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), 521};
    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_44J_Q_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), 530};
    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_0_EQ_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, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 538};
    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->__pyx_n_u_pgconn_ptr};
    __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_Q_3d_q_q_c_AQ_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, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 553};
    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->__pyx_n_u_pgconn_ptr};
    __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_Q_3d_q_a_1_c_AQ_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, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 567};
    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->__pyx_n_u_pgconn_ptr};
    __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_Q_3d_q_Q_c_AQ_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, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 582};
    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->__pyx_n_u_pgconn_ptr};
    __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_Q_3d_q_A_c_AQ_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), 596};
    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_Q_L_Q_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, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 604};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __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_Q_oQd_2S_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), 612};
    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_WA_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), 634};
    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_Q_3d_q_4q_c_AQ_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, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 646};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __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_Q_a_4q_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, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 653};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_rv, __pyx_mstate->__pyx_n_u_s};
    __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_Q_Q_1D_a_4q_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), 661};
    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_Q_at1_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), 670};
    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_Q_1D_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), 678};
    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_WA_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), 689};
    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_Q_nAT_y_Q_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), 702};
    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_m1D_a_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), 715};
    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_Q_1L_7_a_A_at3EQ_gQ_Q_7_1_81, 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), 731};
    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_Q_nA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 738};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flags, __pyx_mstate->__pyx_n_u_f};
    __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_Q_Q_nA, 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), 744};
    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_1D, 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), 748};
    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_Q_Qd_a_4q_A_at3EQ_U_1, 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), 768};
    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_Q_6_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), 781};
    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_Q_N_8_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, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 803};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __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_Q_4q_3c_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, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 816};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rv};
    __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_Q_a_3c_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), 829};
    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_Q_oQd_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), 844};
    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_Q_a_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_tree_fragment, __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_tree_fragment, __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_tree_fragment, __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_tree_fragment, __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_tree_fragment, __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_tree_fragment, __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_tree_fragment, __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_tree_fragment, __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_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_G1F_a_vWE_Q_q_t6_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_tree_fragment, __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_tree_fragment, __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_tree_fragment, __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_tree_fragment, __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_tree_fragment, __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_tree_fragment, __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_4
#define __PYX_HAVE_RT_ImportType_3_2_4
static PyTypeObject *__Pyx_ImportType_3_2_4(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_4 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_4 &&
            ((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_4 && (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 __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
    PyDict_SetDefaultRef(d, key, default_value, &value);
#elif 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);
#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 = NULL, *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)) goto bad;
        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 */
