Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pSIgY-00045R-8I for pgsql-odbc@arkaria.postgresql.org; Wed, 15 Feb 2023 14:23:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pSIgX-0003ms-1K for pgsql-odbc@arkaria.postgresql.org; Wed, 15 Feb 2023 14:23:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pSGqx-0001gz-PF for pgsql-odbc@lists.postgresql.org; Wed, 15 Feb 2023 12:25:40 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pSGqs-0001zV-2G for pgsql-odbc@postgresql.org; Wed, 15 Feb 2023 12:25:38 +0000 Received: by mail-ej1-x62c.google.com with SMTP id b2so1639420ejz.9 for ; Wed, 15 Feb 2023 04:25:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=MwVrURhVwdQF8UKTC1SWx79FGg53iMxv1n9ebwb1YWo=; b=bs7F+D0fBTBIQL053vYc7di/Mmk7KXam6U8JMRWDq6OxIP8GysN9Q4CYlzWtS+i35b eSMUqtdUNsMJOQ7Mzzo+kmK6q/GofmHDLm5HDTklicG1AlRQX9rD2uS7WKtnTq8Q0Cvr j1v0y8NyK7/e2AfNpZejhUWndjaTYMJlA5bk21beSJWkSCChztFOsJD5ZuSvsMs2KrLt pwu03PBU+S09ZnoB9OgwzdaBuRJCv9MxUkkYsi9+2BHeefj+bpEJpKMrX+wdvfk99Fc4 hlRmyiZFY9VLGc2Tt7GsZAkE7TxH8CKR4DeU0KUkefPLTczvR8qvDT2XzqtwgI4UYbRz ichA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=MwVrURhVwdQF8UKTC1SWx79FGg53iMxv1n9ebwb1YWo=; b=UFQInBklPc4bt64VDrYvFuUf6hxL/5NKjoegyA4huMHXSUSFgmkW+ehX//kJGh60aN Exqfb+UJIfifambdCwx3UqS+LxcMizVMbiQ1DUtKiXkYng+19SR1vWnzz/nNQjGoWhpm //gL/BOiEl59gTZ0PS62Hzlt7tSAOItdWMRbvsFBdm6tV4zCrrz3Lgvj1pFsSDYPaemi JSEw3qLJvku56qVl9TBg+rJImW6BhzPRP6CLWNSIIAGQOeclpgFfvywrrlXHcX68oVlJ q9mTylhsCdYsO1ZDRsO3bSJha3IQUimmFmgwVxO34bgX3EZbUXYD97L0VzRuA48uWoY3 CHPA== X-Gm-Message-State: AO0yUKX7BsTjFakcsUsNPnM4g6zqv36K+OSDJNb1XdGiQlYuQTmugT/I ydn5nFghbcf6Y2c/bntH75OHNnkdsFmCrsL8VYKYTNPJZbY= X-Google-Smtp-Source: AK7set94CU7IiAD8qyo4YaMDjdaCaZusaN9h28MwCVIOSd+waxv9pWL7uOSzKTXZ7KFtzoNiLNGBevors0yzLlCL93Q= X-Received: by 2002:a17:906:6898:b0:878:8061:e114 with SMTP id n24-20020a170906689800b008788061e114mr1260959ejr.0.1676463931634; Wed, 15 Feb 2023 04:25:31 -0800 (PST) MIME-Version: 1.0 From: Kevin Verfaille Date: Wed, 15 Feb 2023 13:24:54 +0100 Message-ID: Subject: ODBC-parameter of type BIGINT doesn't seem to casted by the driver To: pgsql-odbc@postgresql.org Content-Type: multipart/alternative; boundary="0000000000001fb84105f4bc2d19" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001fb84105f4bc2d19 Content-Type: text/plain; charset="UTF-8" Hi, I am trying to put an bigint parameter into the below query, but I get an unexpected error. Is there anything we are doing wrong (given the info below) or is this a bug? SystemInfo: ODBC driver version: 13.02 (also tested on: 12.1 Ubuntu20.04/odbc-postgresql) PostgreSQL DB Version: 14.7 (also tested on: 15.2) Query: WITH data_def AS ( SELECT 1::bigint BIGINT_ID ), data_param AS ( SELECT ? AS BIGINT_ID_EXPECTED ) SELECT * FROM data_def WHERE BIGINT_ID IN (SELECT BIGINT_ID_EXPECTED FROM data_param LIMIT 1); ODBC-log parameter binding log & errors: [7fffea581d40] bind.c[PGAPI_BindParameter]138: ipar=0, paramType=1, fCType=-25, fSqlType=-5, cbColDef=0, ibScale=6,rgbValue=0x19457b0(8), pcbValue=0x197d170 [7fffea581d40]connection[handle_pgres_error]881: [QLOG] ERROR(ERROR) 42883 'operator does not exist: bigint = text' [7fffea581d40]connection[handle_pgres_error]950: error message=ERROR: operator does not exist: bigint = text(45) Full ODBC-log: [7fffea581d40] pgapi30.c[PGAPI_GetStmtAttr]1561: entering Handle=0x44a7730 10010 [7fffea581d40]odbcapi30.[SQLGetStmtAttr]411: Entering Handle=0x44a7730 10011 [7fffea581d40] pgapi30.c[PGAPI_GetStmtAttr]1561: entering Handle=0x44a7730 10011 [7fffea581d40]odbcapi30.[SQLGetStmtAttr]411: Entering Handle=0x44a7730 10012 [7fffea581d40] pgapi30.c[PGAPI_GetStmtAttr]1561: entering Handle=0x44a7730 10012 [7fffea581d40]odbcapi30.[SQLGetStmtAttr]411: Entering Handle=0x44a7730 10013 [7fffea581d40] pgapi30.c[PGAPI_GetStmtAttr]1561: entering Handle=0x44a7730 10013 [7fffea581d40] odbcapi.c[SQLPrepare]586: Entering [7fffea581d40] execute.c[PGAPI_Prepare]47: entering... [7fffea581d40] execute.c[PGAPI_Prepare]75: **** STMT_ALLOCATED, copy [7fffea581d40] odbcapi.c[SQLBindParameter]1526: Entering [7fffea581d40] bind.c[PGAPI_BindParameter]51: entering... [7fffea581d40] bind.c[extend_parameter_bindings]493: entering ... self=0x44a7910, parameters_allocated=0, num_params=1,(nil) [7fffea581d40] bind.c[extend_parameter_bindings]518: leaving 0x44ad8b0 [7fffea581d40] bind.c[extend_iparameter_bindings]526: entering ... self=0x44a7980, parameters_allocated=0, num_params=1 [7fffea581d40] bind.c[extend_iparameter_bindings]552: leaving 0x44a06c0 [7fffea581d40] bind.c[extend_putdata_info]947: entering ... self=0x44a7a78, parameters_allocated=0, num_params=1 [7fffea581d40] bind.c[extend_putdata_info]989: leaving 0x44ad860 [7fffea581d40] bind.c[PGAPI_BindParameter]138: ipar=0, paramType=1, fCType=-25, fSqlType=-5, cbColDef=0, ibScale=6,rgbValue=0x19457b0(8), pcbValue=0x197d170 [7fffea581d40] odbcapi.c[SQLGetInfo]502: Entering [7fffea581d40] info.c[PGAPI_GetInfo]88: entering...fInfoType=81 [7fffea581d40] info.c[PGAPI_GetInfo]1076: p='', len=4, value=15, cbMax=4 [7fffea581d40]odbcapi30.[SQLSetStmtAttr]540: Entering Handle=0x44a7730 27,1 [7fffea581d40] pgapi30.c[PGAPI_SetStmtAttr]1930: entering Handle=0x44a7730 27,1(0x1) [7fffea581d40]odbcapi30.[SQLSetStmtAttr]540: Entering Handle=0x44a7730 26,71963824 [7fffea581d40] pgapi30.c[PGAPI_SetStmtAttr]1930: entering Handle=0x44a7730 26,71963824(0x44a14b0) [7fffea581d40]odbcapi30.[SQLSetStmtAttr]540: Entering Handle=0x44a7730 0,60 [7fffea581d40] pgapi30.c[PGAPI_SetStmtAttr]1930: entering Handle=0x44a7730 0,60(0x3c) [7fffea581d40] options.c[PGAPI_SetStmtOption]618: entering... [7fffea581d40] options.c[set_statement_option]178: SQL_QUERY_TIMEOUT, vParam = 60 [7fffea581d40] odbcapi.c[SQLFreeStmt]395: Entering [7fffea581d40]statement.[PGAPI_FreeStmt]248: entering...hstmt=0x44a7730, fOption=0 [7fffea581d40]statement.[SC_recycle_statement]856: entering self=0x44a7730 [7fffea581d40] qresult.c[QR_Destructor]344: entering [7fffea581d40] bind.c[PDATA_free_params]663: entering self=0x44a7a78 [7fffea581d40] bind.c[PDATA_free_params]689: leaving [7fffea581d40] odbcapi.c[SQLFreeStmt]395: Entering [7fffea581d40]statement.[PGAPI_FreeStmt]248: entering...hstmt=0x44a7730, fOption=2 [7fffea581d40] odbcapi.c[SQLExecute]338: Entering [7fffea581d40] execute.c[PGAPI_Execute]937: entering...5 0x44a7730 status=1 [7fffea581d40] execute.c[PGAPI_Execute]954: clear errors... [7fffea581d40] bind.c[PGAPI_NumParams]425: entering... [7fffea581d40]statement.[SC_scanQueryAndCountParams]966: entering... [7fffea581d40]statement.[SC_scanQueryAndCountParams]1124: leaving...num_p=1 multi=0 [7fffea581d40] execute.c[PGAPI_Execute]1035: prepare=1 prepared=0 batch_size=100 start_row=0end_row=0 => maybeBatch=0 [7fffea581d40] execute.c[PGAPI_Execute]1048: prepareParameters was not called, prepare state:7 [7fffea581d40] execute.c[PGAPI_Execute]1061: prepare=7 maybeBatch=0 exec_type=0 [7fffea581d40]statement.[SC_recycle_statement]856: entering self=0x44a7730 [7fffea581d40] qresult.c[QR_Destructor]344: entering [7fffea581d40] bind.c[PDATA_free_params]663: entering self=0x44a7a78 [7fffea581d40] bind.c[PDATA_free_params]689: leaving [7fffea581d40] bind.c[PDATA_free_params]663: entering self=0x44a7a78 [7fffea581d40] bind.c[PDATA_free_params]689: leaving [7fffea581d40] execute.c[Exec_with_parameters_resolved]445: copying statement params: trans_status=1, len=198, stmt='WITH data_def AS ( SELECT 1::bigint BIGINT_ID ), data_param AS ( SELECT ? AS BIGINT_ID_EXPECTED) SELECT * FROM data_def WHERE BIGINT_ID IN (SELECT BIGINT_ID_EXPECTED FROM data_param LIMIT 1)' [7fffea581d40] execute.c[Exec_with_parameters_resolved]486: stmt_with_params = '(null)' [7fffea581d40] execute.c[Exec_with_parameters_resolved]491: about to begin SC_execute exec_type=0 [7fffea581d40]statement.[libpq_bind_and_exec]2618: bind stmt=0x44a7730 [7fffea581d40] convert.c[ResolveOneParam]4673: from(fcType)=-25, to(fSqlType)=-5(20), *pgType=0 [7fffea581d40] convert.c[ResolveOneParam]5010: cvt_null_date_string=0 pgtype=20 send_buf=(nil) [7fffea581d40]statement.[libpq_bind_and_exec]2632: execute stmt=0x44a7730 [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=4 status=1 token=WITH [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=8 status=1 token=data_def [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=2 status=1 token=AS [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=0 token=( [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=6 status=1 token=SELECT [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=1 token=1 [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=0 token=: [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=0 token=: [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=6 status=1 token=bigint [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=9 status=1 token=BIGINT_ID [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=0 token=) [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=0 token=, [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=10 status=1 token=data_param [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=2 status=1 token=AS [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=0 token=( [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=6 status=1 token=SELECT [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=0 token=? [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=2 status=1 token=AS [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=18 status=1 token=BIGINT_ID_EXPECTED [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=0 token=) [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=6 status=1 token=SELECT [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=0 token=* [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=4 status=1 token=FROM [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=8 status=1 token=data_def [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=5 status=1 token=WHERE [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=9 status=1 token=BIGINT_ID [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=2 status=1 token=IN [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=0 token=( [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=6 status=1 token=SELECT [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=18 status=1 token=BIGINT_ID_EXPECTED [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=4 status=1 token=FROM [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=10 status=1 token=data_param [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=5 status=1 token=LIMIT [7fffea581d40] convert.c[inner_process_tokens]3911: token_len=1 status=1 token=1 [7fffea581d40]statement.[SC_scanQueryAndCountParams]966: entering... [7fffea581d40]statement.[SC_scanQueryAndCountParams]1124: leaving...num_p=1 multi=0 [7fffea581d40]statement.[SC_scanQueryAndCountParams]966: entering... [7fffea581d40]statement.[SC_scanQueryAndCountParams]1124: leaving...num_p=0 multi=0 [7fffea581d40] convert.c[prepareParametersNoDesc]2772: parsed for the first command length=-1(-1) num_p=1 [7fffea581d40]statement.[ParseAndDescribeWithLibpq]2938: entering plan_name=_PLAN0x44a7730 query=WITH data_def AS ( SELECT 1::bigint BIGINT_ID ), data_param AS ( SELECT $1 AS BIGINT_ID_EXPECTED) SELECT * FROM data_def WHERE BIGINT_ID IN (SELECT BIGINT_ID_EXPECTED FROM data_param LIMIT 1) [7fffea581d40] qresult.c[QR_Constructor]173: entering [7fffea581d40] qresult.c[QR_Constructor]242: leaving 0x1ae0bf0 [7fffea581d40]statement.[ParseWithLibpq]2799: entering plan_name=_PLAN0x44a7730 query=WITH data_def AS ( SELECT 1::bigint BIGINT_ID ), data_param AS ( SELECT $1 AS BIGINT_ID_EXPECTED) SELECT * FROM data_def WHERE BIGINT_ID IN (SELECT BIGINT_ID_EXPECTED FROM data_param LIMIT 1) [7fffea581d40]statement.[ParseWithLibpq]2837: sta_pidx=0 end_pidx=0 num_p=1 [7fffea581d40]statement.[ParseWithLibpq]2857: ipdopts->allocated: 1 [7fffea581d40]statement.[ParseWithLibpq]2881: [QLOG]PQprepare: 0x19bec10 'WITH data_def AS ( SELECT 1::bigint BIGINT_ID ), data_param AS ( SELECT $1 AS BIGINT_ID_EXPECTED) SELECT * FROM data_def WHERE BIGINT_ID IN (SELECT BIGINT_ID_EXPECTED FROM data_param LIMIT 1)' plan=_PLAN0x44a7730 nParams=1 [7fffea581d40]connection[handle_pgres_error]864: PG_DIAG_SEVERITY_NONLOCALIZED=ERROR [7fffea581d40]connection[handle_pgres_error]881: [QLOG] ERROR(ERROR) 42883 'operator does not exist: bigint = text' [7fffea581d40]connection[handle_pgres_error]950: error message=ERROR: operator does not exist: bigint = text(45) [7fffea581d40] qresult.c[QR_Destructor]344: entering [7fffea581d40]statement.[SC_log_error]2467: STATEMENT ERROR: func=desc_params_and_sync, desc='', errnum=1, errmsg='Error while preparing parameters' [7fffea581d40]connection[CC_log_error]2618: CONN ERROR: func=desc_params_and_sync, desc='', errnum=110, errmsg='(NULL)' [7fffea581d40]statement.[SC_SetExecuting]3115: set 0x44a7730 STMT_FINISHED [7fffea581d40] execute.c[Exec_with_parameters_resolved]564: count_of_deffered=0 [7fffea581d40] execute.c[PGAPI_Execute]1188: leaving 0x44a7730 retval=-1 status=3 [7fffea581d40] execute.c[DiscardStatementSvp]803: in_progress=0 previous=0 [7fffea581d40]odbcapi30.[SQLGetDiagRec]342: Entering [7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]43: entering type=3 rec=1 [7fffea581d40] environ.c[ER_ReturnError]202: entering status = 1, msg = #ERROR: operator does not exist: bigint = text; Error while preparing parameters# [7fffea581d40] environ.c[ER_ReturnError]259: szSqlState = '42883',len=79, szError='ERROR: operator does not exist: bigint = text; Error while preparing parameters' [7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]70: leaving 0 [7fffea581d40]odbcapi30.[SQLGetDiagRec]342: Entering [7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]43: entering type=3 rec=2 [7fffea581d40] environ.c[ER_ReturnError]202: entering status = 1, msg = #ERROR: operator does not exist: bigint = text; Error while preparing parameters# [7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]70: leaving 100 [7fffea581d40]odbcapi30.[SQLGetDiagRec]342: Entering [7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]43: entering type=3 rec=1 [7fffea581d40] environ.c[ER_ReturnError]202: entering status = 1, msg = #ERROR: operator does not exist: bigint = text; Error while preparing parameters# [7fffea581d40] environ.c[ER_ReturnError]259: szSqlState = '(null)',len=79, szError='(null)' [7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]70: leaving 1 [7fffea581d40]odbcapi30.[SQLGetDiagRec]342: Entering [7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]43: entering type=3 rec=1 [7fffea581d40] environ.c[ER_ReturnError]202: entering status = 1, msg = #ERROR: operator does not exist: bigint = text; Error while preparing parameters# [7fffea581d40] environ.c[ER_ReturnError]259: szSqlState = '42883',len=79, szError='ERROR: operator does not exist: bigint = text; Error while preparing parameters' [7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]70: leaving 0 [7fffea581d40]odbcapi30.[SQLGetDiagRec]342: Entering [7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]43: entering type=3 rec=2 [7fffea581d40] environ.c[ER_ReturnError]202: entering status = 1, msg = #ERROR: operator does not exist: bigint = text; Error while preparing parameters# [7fffea581d40] environ.c[ER_ReturnError]259: szSqlState = '(null)',len=0, szError='(null)' [7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]70: leaving 0 [7fffea581d40] odbcapi.c[SQLCancel]77: Entering [7fffea581d40] execute.c[PGAPI_Cancel]1270: entering... [7fffea581d40] odbcapi.c[SQLFreeStmt]395: Entering [7fffea581d40]statement.[PGAPI_FreeStmt]248: entering...hstmt=0x44a7730, fOption=0 Looking into the ODBC-code I noticed this: - The ResolveOneParam uses sqltype_to_bind_pgtype - sqltype_to_bind_pgtype always return 0 and states it is deprecated and sqltype_to_pgcast should be used. - I guess this last call is missing somewhere, but --> ResolveOneParam comments on top that server should determine in case pg_type = 0, but it seems to give an error when not casted --> /* pgType is set to the PostgreSQL type OID that should be used when binding * (or 0, to let the server decide) */ Regards, Kevin --0000000000001fb84105f4bc2d19 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I am trying to put an bigint parame= ter into the below query, but I get an unexpected error.
Is there= anything we are doing wrong (given the info below) or is this a bug?

SystemInfo:
ODBC driver version: 13.02 (also tes= ted on: 12.1 Ubuntu20.04/odbc-postgresql)
PostgreSQL DB Version: 14.7 (a= lso tested on: 15.2)

Query:
WITH data_def AS ( =
=C2=A0 =C2=A0 SELECT 1::bigint BIGINT_ID
), data_param AS (
= =C2=A0 =C2=A0 SELECT ? AS BIGINT_ID_EXPECTED
)
SELECT *
= FROM data_def
WHERE BIGINT_ID IN (SELECT BIGINT_ID_EXPECTED FROM da= ta_param LIMIT 1);

ODBC-log parameter binding = log & errors:
[7fffea581d40] =C2=A0 =C2=A0bind.c[PGAPI_BindPa= rameter]138: ipar=3D0, paramType=3D1, fCType=3D-25, fSqlType=3D-5, cbColDef= =3D0, ibScale=3D6,rgbValue=3D0x19457b0(8), pcbValue=3D0x197d170
[7fffea5= 81d40]connection[handle_pgres_error]881: [QLOG] ERROR(ERROR) 42883 'ope= rator does not exist: bigint =3D text'
[7fffea581d40]connection[hand= le_pgres_error]950: error message=3DERROR: operator does not exist: bigint = =3D text(45)

Full ODBC-log:

[7ff= fea581d40] pgapi30.c[PGAPI_GetStmtAttr]1561: entering Handle=3D0x44a7730 10= 010
[7fffea581d40]odbcapi30.[SQLGetStmtAttr]411: Entering Handle=3D0x44a= 7730 10011
[7fffea581d40] pgapi30.c[PGAPI_GetStmtAttr]1561: entering Han= dle=3D0x44a7730 10011
[7fffea581d40]odbcapi30.[SQLGetStmtAttr]411: Enter= ing Handle=3D0x44a7730 10012
[7fffea581d40] pgapi30.c[PGAPI_GetStmtAttr]= 1561: entering Handle=3D0x44a7730 10012
[7fffea581d40]odbcapi30.[SQLGetS= tmtAttr]411: Entering Handle=3D0x44a7730 10013
[7fffea581d40] pgapi30.c[= PGAPI_GetStmtAttr]1561: entering Handle=3D0x44a7730 10013
[7fffea581d40]= odbcapi.c[SQLPrepare]586: Entering
[7fffea581d40] execute.c[PGAPI_Prepa= re]47: entering...
[7fffea581d40] execute.c[PGAPI_Prepare]75: **** STMT_= ALLOCATED, copy
[7fffea581d40] odbcapi.c[SQLBindParameter]1526: Entering=
[7fffea581d40] =C2=A0 =C2=A0bind.c[PGAPI_BindParameter]51: entering...<= br>[7fffea581d40] =C2=A0 =C2=A0bind.c[extend_parameter_bindings]493: enteri= ng ... self=3D0x44a7910, parameters_allocated=3D0, num_params=3D1,(nil)
= [7fffea581d40] =C2=A0 =C2=A0bind.c[extend_parameter_bindings]518: leaving 0= x44ad8b0
[7fffea581d40] =C2=A0 =C2=A0bind.c[extend_iparameter_bindings]5= 26: entering ... self=3D0x44a7980, parameters_allocated=3D0, num_params=3D1=
[7fffea581d40] =C2=A0 =C2=A0bind.c[extend_iparameter_bindings]552: leav= ing 0x44a06c0
[7fffea581d40] =C2=A0 =C2=A0bind.c[extend_putdata_info]947= : entering ... self=3D0x44a7a78, parameters_allocated=3D0, num_params=3D1[7fffea581d40] =C2=A0 =C2=A0bind.c[extend_putdata_info]989: leaving 0x44a= d860
[7fffea581d40] =C2=A0 =C2=A0bind.c[PGAPI_BindParameter]138: ipar=3D= 0, paramType=3D1, fCType=3D-25, fSqlType=3D-5, cbColDef=3D0, ibScale=3D6,rg= bValue=3D0x19457b0(8), pcbValue=3D0x197d170
[7fffea581d40] odbcapi.c[SQL= GetInfo]502: Entering
[7fffea581d40] =C2=A0 =C2=A0info.c[PGAPI_GetInfo]8= 8: entering...fInfoType=3D81
[7fffea581d40] =C2=A0 =C2=A0info.c[PGAPI_Ge= tInfo]1076: p=3D'<NULL>', len=3D4, value=3D15, cbMax=3D4
[= 7fffea581d40]odbcapi30.[SQLSetStmtAttr]540: Entering Handle=3D0x44a7730 27,= 1
[7fffea581d40] pgapi30.c[PGAPI_SetStmtAttr]1930: entering Handle=3D0x4= 4a7730 27,1(0x1)
[7fffea581d40]odbcapi30.[SQLSetStmtAttr]540: Entering H= andle=3D0x44a7730 26,71963824
[7fffea581d40] pgapi30.c[PGAPI_SetStmtAttr= ]1930: entering Handle=3D0x44a7730 26,71963824(0x44a14b0)
[7fffea581d40]= odbcapi30.[SQLSetStmtAttr]540: Entering Handle=3D0x44a7730 0,60
[7fffea5= 81d40] pgapi30.c[PGAPI_SetStmtAttr]1930: entering Handle=3D0x44a7730 0,60(0= x3c)
[7fffea581d40] options.c[PGAPI_SetStmtOption]618: =C2=A0entering...=
[7fffea581d40] options.c[set_statement_option]178: SQL_QUERY_TIMEOUT, v= Param =3D 60
[7fffea581d40] odbcapi.c[SQLFreeStmt]395: Entering
[7fff= ea581d40]statement.[PGAPI_FreeStmt]248: entering...hstmt=3D0x44a7730, fOpti= on=3D0
[7fffea581d40]statement.[SC_recycle_statement]856: entering self= =3D0x44a7730
[7fffea581d40] qresult.c[QR_Destructor]344: entering
[7f= ffea581d40] =C2=A0 =C2=A0bind.c[PDATA_free_params]663: entering self=3D0x44= a7a78
[7fffea581d40] =C2=A0 =C2=A0bind.c[PDATA_free_params]689: leaving<= br>[7fffea581d40] odbcapi.c[SQLFreeStmt]395: Entering
[7fffea581d40]stat= ement.[PGAPI_FreeStmt]248: entering...hstmt=3D0x44a7730, fOption=3D2
[7f= ffea581d40] odbcapi.c[SQLExecute]338: Entering
[7fffea581d40] execute.c[= PGAPI_Execute]937: entering...5 0x44a7730 status=3D1
[7fffea581d40] exec= ute.c[PGAPI_Execute]954: clear errors...
[7fffea581d40] =C2=A0 =C2=A0bin= d.c[PGAPI_NumParams]425: entering...
[7fffea581d40]statement.[SC_scanQue= ryAndCountParams]966: entering...
[7fffea581d40]statement.[SC_scanQueryA= ndCountParams]1124: leaving...num_p=3D1 multi=3D0
[7fffea581d40] execute= .c[PGAPI_Execute]1035: prepare=3D1 prepared=3D0 =C2=A0batch_size=3D100 star= t_row=3D0end_row=3D0 =3D> maybeBatch=3D0
[7fffea581d40] execute.c[PGA= PI_Execute]1048: prepareParameters was not called, prepare state:7
[7fff= ea581d40] execute.c[PGAPI_Execute]1061: prepare=3D7 maybeBatch=3D0 exec_typ= e=3D0
[7fffea581d40]statement.[SC_recycle_statement]856: entering self= =3D0x44a7730
[7fffea581d40] qresult.c[QR_Destructor]344: entering
[7f= ffea581d40] =C2=A0 =C2=A0bind.c[PDATA_free_params]663: entering self=3D0x44= a7a78
[7fffea581d40] =C2=A0 =C2=A0bind.c[PDATA_free_params]689: leaving<= br>[7fffea581d40] =C2=A0 =C2=A0bind.c[PDATA_free_params]663: entering self= =3D0x44a7a78
[7fffea581d40] =C2=A0 =C2=A0bind.c[PDATA_free_params]689: l= eaving
[7fffea581d40] execute.c[Exec_with_parameters_resolved]445: copyi= ng statement params: trans_status=3D1, len=3D198, stmt=3D'WITH data_def= AS (
=C2=A0 =C2=A0 =C2=A0 =C2=A0 SELECT 1::bigint BIGINT_ID
), data_= param AS (
=C2=A0 =C2=A0 =C2=A0 =C2=A0 SELECT ? AS BIGINT_ID_EXPECTED)SELECT *
FROM data_def
WHERE BIGINT_ID IN (SELECT BIGINT_ID_EXPECTE= D FROM data_param LIMIT 1)'
[7fffea581d40] execute.c[Exec_with_param= eters_resolved]486: =C2=A0 =C2=A0stmt_with_params =3D '(null)'
[= 7fffea581d40] execute.c[Exec_with_parameters_resolved]491: about to begin S= C_execute exec_type=3D0
[7fffea581d40]statement.[libpq_bind_and_exec]261= 8: bind stmt=3D0x44a7730
[7fffea581d40] convert.c[ResolveOneParam]4673: = from(fcType)=3D-25, to(fSqlType)=3D-5(20), *pgType=3D0
[7fffea581d40] co= nvert.c[ResolveOneParam]5010: cvt_null_date_string=3D0 pgtype=3D20 send_buf= =3D(nil)
[7fffea581d40]statement.[libpq_bind_and_exec]2632: execute stmt= =3D0x44a7730
[7fffea581d40] convert.c[inner_process_tokens]3911: token_l= en=3D4 status=3D1 token=3DWITH
[7fffea581d40] convert.c[inner_process_to= kens]3911: token_len=3D8 status=3D1 token=3Ddata_def
[7fffea581d40] conv= ert.c[inner_process_tokens]3911: token_len=3D2 status=3D1 token=3DAS
[7f= ffea581d40] convert.c[inner_process_tokens]3911: token_len=3D1 status=3D0 t= oken=3D(
[7fffea581d40] convert.c[inner_process_tokens]3911: token_len= =3D6 status=3D1 token=3DSELECT
[7fffea581d40] convert.c[inner_process_to= kens]3911: token_len=3D1 status=3D1 token=3D1
[7fffea581d40] convert.c[i= nner_process_tokens]3911: token_len=3D1 status=3D0 token=3D:
[7fffea581d= 40] convert.c[inner_process_tokens]3911: token_len=3D1 status=3D0 token=3D:=
[7fffea581d40] convert.c[inner_process_tokens]3911: token_len=3D6 statu= s=3D1 token=3Dbigint
[7fffea581d40] convert.c[inner_process_tokens]3911:= token_len=3D9 status=3D1 token=3DBIGINT_ID
[7fffea581d40] convert.c[inn= er_process_tokens]3911: token_len=3D1 status=3D0 token=3D)
[7fffea581d40= ] convert.c[inner_process_tokens]3911: token_len=3D1 status=3D0 token=3D,[7fffea581d40] convert.c[inner_process_tokens]3911: token_len=3D10 status= =3D1 token=3Ddata_param
[7fffea581d40] convert.c[inner_process_tokens]39= 11: token_len=3D2 status=3D1 token=3DAS
[7fffea581d40] convert.c[inner_p= rocess_tokens]3911: token_len=3D1 status=3D0 token=3D(
[7fffea581d40] co= nvert.c[inner_process_tokens]3911: token_len=3D6 status=3D1 token=3DSELECT<= br>[7fffea581d40] convert.c[inner_process_tokens]3911: token_len=3D1 status= =3D0 token=3D?
[7fffea581d40] convert.c[inner_process_tokens]3911: token= _len=3D2 status=3D1 token=3DAS
[7fffea581d40] convert.c[inner_process_to= kens]3911: token_len=3D18 status=3D1 token=3DBIGINT_ID_EXPECTED
[7fffea5= 81d40] convert.c[inner_process_tokens]3911: token_len=3D1 status=3D0 token= =3D)
[7fffea581d40] convert.c[inner_process_tokens]3911: token_len=3D6 s= tatus=3D1 token=3DSELECT
[7fffea581d40] convert.c[inner_process_tokens]3= 911: token_len=3D1 status=3D0 token=3D*
[7fffea581d40] convert.c[inner_p= rocess_tokens]3911: token_len=3D4 status=3D1 token=3DFROM
[7fffea581d40]= convert.c[inner_process_tokens]3911: token_len=3D8 status=3D1 token=3Ddata= _def
[7fffea581d40] convert.c[inner_process_tokens]3911: token_len=3D5 s= tatus=3D1 token=3DWHERE
[7fffea581d40] convert.c[inner_process_tokens]39= 11: token_len=3D9 status=3D1 token=3DBIGINT_ID
[7fffea581d40] convert.c[= inner_process_tokens]3911: token_len=3D2 status=3D1 token=3DIN
[7fffea58= 1d40] convert.c[inner_process_tokens]3911: token_len=3D1 status=3D0 token= =3D(
[7fffea581d40] convert.c[inner_process_tokens]3911: token_len=3D6 s= tatus=3D1 token=3DSELECT
[7fffea581d40] convert.c[inner_process_tokens]3= 911: token_len=3D18 status=3D1 token=3DBIGINT_ID_EXPECTED
[7fffea581d40]= convert.c[inner_process_tokens]3911: token_len=3D4 status=3D1 token=3DFROM=
[7fffea581d40] convert.c[inner_process_tokens]3911: token_len=3D10 stat= us=3D1 token=3Ddata_param
[7fffea581d40] convert.c[inner_process_tokens]= 3911: token_len=3D5 status=3D1 token=3DLIMIT
[7fffea581d40] convert.c[in= ner_process_tokens]3911: token_len=3D1 status=3D1 token=3D1
[7fffea581d4= 0]statement.[SC_scanQueryAndCountParams]966: entering...
[7fffea581d40]s= tatement.[SC_scanQueryAndCountParams]1124: leaving...num_p=3D1 multi=3D0[7fffea581d40]statement.[SC_scanQueryAndCountParams]966: entering...
[7= fffea581d40]statement.[SC_scanQueryAndCountParams]1124: leaving...num_p=3D0= multi=3D0
[7fffea581d40] convert.c[prepareParametersNoDesc]2772: parsed= for the first command length=3D-1(-1) num_p=3D1
[7fffea581d40]statement= .[ParseAndDescribeWithLibpq]2938: entering plan_name=3D_PLAN0x44a7730 query= =3DWITH data_def AS (
=C2=A0 =C2=A0 =C2=A0 =C2=A0 SELECT 1::bigint BIGIN= T_ID
), data_param AS (
=C2=A0 =C2=A0 =C2=A0 =C2=A0 SELECT $1 AS BIGI= NT_ID_EXPECTED)
SELECT *
FROM data_def
WHERE BIGINT_ID IN (SELECT = BIGINT_ID_EXPECTED FROM data_param LIMIT 1)
[7fffea581d40] qresult.c[QR_= Constructor]173: entering
[7fffea581d40] qresult.c[QR_Constructor]242: l= eaving 0x1ae0bf0
[7fffea581d40]statement.[ParseWithLibpq]2799: entering = plan_name=3D_PLAN0x44a7730 query=3DWITH data_def AS (
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 SELECT 1::bigint BIGINT_ID
), data_param AS (
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 SELECT $1 AS BIGINT_ID_EXPECTED)
SELECT *
FROM data= _def
WHERE BIGINT_ID IN (SELECT BIGINT_ID_EXPECTED FROM data_param LIMIT= 1)
[7fffea581d40]statement.[ParseWithLibpq]2837: sta_pidx=3D0 end_pidx= =3D0 num_p=3D1
[7fffea581d40]statement.[ParseWithLibpq]2857: ipdopts->= ;allocated: 1
[7fffea581d40]statement.[ParseWithLibpq]2881: [QLOG]PQprep= are: 0x19bec10 'WITH data_def AS (
=C2=A0 =C2=A0 =C2=A0 =C2=A0 SELEC= T 1::bigint BIGINT_ID
), data_param AS (
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = SELECT $1 AS BIGINT_ID_EXPECTED)
SELECT *
FROM data_def
WHERE BIGI= NT_ID IN (SELECT BIGINT_ID_EXPECTED FROM data_param LIMIT 1)' plan=3D_P= LAN0x44a7730 nParams=3D1
[7fffea581d40]connection[handle_pgres_error]864= : PG_DIAG_SEVERITY_NONLOCALIZED=3DERROR
[7fffea581d40]connection[handle_= pgres_error]881: [QLOG] ERROR(ERROR) 42883 'operator does not exist: bi= gint =3D text'
[7fffea581d40]connection[handle_pgres_error]950: erro= r message=3DERROR: operator does not exist: bigint =3D text(45)
[7fffea5= 81d40] qresult.c[QR_Destructor]344: entering
[7fffea581d40]statement.[SC= _log_error]2467: STATEMENT ERROR: func=3Ddesc_params_and_sync, desc=3D'= ', errnum=3D1, errmsg=3D'Error while preparing parameters'
[= 7fffea581d40]connection[CC_log_error]2618: CONN ERROR: func=3Ddesc_params_a= nd_sync, desc=3D'', errnum=3D110, errmsg=3D'(NULL)'
[7ff= fea581d40]statement.[SC_SetExecuting]3115: set 0x44a7730 STMT_FINISHED
[= 7fffea581d40] execute.c[Exec_with_parameters_resolved]564: count_of_deffere= d=3D0
[7fffea581d40] execute.c[PGAPI_Execute]1188: leaving 0x44a7730 ret= val=3D-1 status=3D3
[7fffea581d40] execute.c[DiscardStatementSvp]803: in= _progress=3D0 previous=3D0
[7fffea581d40]odbcapi30.[SQLGetDiagRec]342: E= ntering
[7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]43: entering type=3D3 = rec=3D1
[7fffea581d40] environ.c[ER_ReturnError]202: entering status =3D= 1, msg =3D #ERROR: operator does not exist: bigint =3D text;
Error whil= e preparing parameters#
[7fffea581d40] environ.c[ER_ReturnError]259: =C2= =A0 =C2=A0 =C2=A0 =C2=A0 szSqlState =3D '42883',len=3D79, szError= =3D'ERROR: operator does not exist: bigint =3D text;
Error while pre= paring parameters'
[7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]70: lea= ving 0
[7fffea581d40]odbcapi30.[SQLGetDiagRec]342: Entering
[7fffea58= 1d40] pgapi30.c[PGAPI_GetDiagRec]43: entering type=3D3 rec=3D2
[7fffea58= 1d40] environ.c[ER_ReturnError]202: entering status =3D 1, msg =3D #ERROR: = operator does not exist: bigint =3D text;
Error while preparing paramete= rs#
[7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]70: leaving 100
[7fffea= 581d40]odbcapi30.[SQLGetDiagRec]342: Entering
[7fffea581d40] pgapi30.c[P= GAPI_GetDiagRec]43: entering type=3D3 rec=3D1
[7fffea581d40] environ.c[E= R_ReturnError]202: entering status =3D 1, msg =3D #ERROR: operator does not= exist: bigint =3D text;
Error while preparing parameters#
[7fffea581= d40] environ.c[ER_ReturnError]259: =C2=A0 =C2=A0 =C2=A0 =C2=A0 szSqlState = =3D '(null)',len=3D79, szError=3D'(null)'
[7fffea581d40]= pgapi30.c[PGAPI_GetDiagRec]70: leaving 1
[7fffea581d40]odbcapi30.[SQLGe= tDiagRec]342: Entering
[7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]43: ent= ering type=3D3 rec=3D1
[7fffea581d40] environ.c[ER_ReturnError]202: ente= ring status =3D 1, msg =3D #ERROR: operator does not exist: bigint =3D text= ;
Error while preparing parameters#
[7fffea581d40] environ.c[ER_Retur= nError]259: =C2=A0 =C2=A0 =C2=A0 =C2=A0 szSqlState =3D '42883',len= =3D79, szError=3D'ERROR: operator does not exist: bigint =3D text;
E= rror while preparing parameters'
[7fffea581d40] pgapi30.c[PGAPI_GetD= iagRec]70: leaving 0
[7fffea581d40]odbcapi30.[SQLGetDiagRec]342: Enterin= g
[7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]43: entering type=3D3 rec=3D= 2
[7fffea581d40] environ.c[ER_ReturnError]202: entering status =3D 1, ms= g =3D #ERROR: operator does not exist: bigint =3D text;
Error while prep= aring parameters#
[7fffea581d40] environ.c[ER_ReturnError]259: =C2=A0 = =C2=A0 =C2=A0 =C2=A0 szSqlState =3D '(null)',len=3D0, szError=3D= 9;(null)'
[7fffea581d40] pgapi30.c[PGAPI_GetDiagRec]70: leaving 0[7fffea581d40] odbcapi.c[SQLCancel]77: Entering
[7fffea581d40] execute.= c[PGAPI_Cancel]1270: entering...
[7fffea581d40] odbcapi.c[SQLFreeStmt]39= 5: Entering
[7fffea581d40]statement.[PGAPI_FreeStmt]248: entering...hstm= t=3D0x44a7730, fOption=3D0

Looking into t= he ODBC-code I noticed this:
- The=C2=A0ResolveOneParam uses sqlt= ype_to_bind_pgtype
-=C2=A0sqltype_to_bind_pgtype always return 0 = and states it is deprecated and=C2=A0sqltype_to_pgcast should be used.
- I guess this last call is missing somewhere, but
--> R= esolveOneParam comments on top that server should determine in case pg_type= =3D 0, but it seems to give an error when not casted
--> /* p= gType is set to the PostgreSQL type OID that should be used when binding * = (or 0, to let the server decide) */

Regards,=
Kevin

--0000000000001fb84105f4bc2d19--