Обсуждение: [ODBC] [HY000] no error information; Error while preparing parameters
Hi, _Sometimes_ I’m getting very «informative» error message on SQLExecute(). The query is quite easy, but I’m guessing thaterror comes from the driver(or driver manager though?). What should I check? My environment: macOS 10.12 unixODBC 2.3.4 psqlodbc 09.05.0400 PostgreSQL 9.5.4_1 Trace: [ODBC][5368][1486063625.565019][SQLAllocHandle.c][1085] Exit:[SQL_SUCCESS] Output Handle = 0x102915800 [ODBC][5368][1486063625.565280][SQLSetStmtAttr.c][265] Entry: Statement = 0x102915800 Attribute = SQL_ATTR_CURSOR_TYPE Value = 0x1 StrLen = 0 [ODBC][5368][1486063625.565463][SQLSetStmtAttr.c][928] Exit:[SQL_SUCCESS] [ODBC][5368][1486063625.565851][SQLPrepare.c][196] Entry: Statement = 0x102915800 SQL = [INSERT INTO Core_Message(channel_id, date, member_id, reply_id) VALUES(25, '2017-02-02 22:27:05', 4, NULL) ][length = 109 (SQL_NTS)] [ODBC][5368][1486063625.565943][SQLPrepare.c][377] Exit:[SQL_SUCCESS] [ODBC][5368][1486063625.566442][SQLExecute.c][187] Entry: Statement = 0x102915800 [ODBC][5368][1486063625.566724][SQLExecute.c][357] Exit:[SQL_ERROR] DIAG [HY000] no error information; Error while preparing parameters [ODBC][5368][1486063625.567160][SQLFreeHandle.c][381] Entry: Handle Type = 3 Input Handle = 0x102915800 [ODBC][5368][1486063625.567308][SQLFreeHandle.c][494] Exit:[SQL_SUCCESS] Thanks in advance. Daniil A Megrabyan — Daniil A Megrabyan — phone(telegram, whatsapp, viber) : +79151762470 | skype: danil.megrabyan
Hi Daniil, On 2017/02/03 17:06, Daniil Megrabyan wrote: > Hi, > > _Sometimes_ I’m getting very «informative» error message on SQLExecute(). The query is quite easy, but I’m guessing thaterror comes from the driver(or driver manager though?). What should I check? Could you take mylog output and send it to me? regards, Hiroshi Inoue > My environment: > macOS 10.12 > unixODBC 2.3.4 > psqlodbc 09.05.0400 > PostgreSQL 9.5.4_1 > > Trace: > [ODBC][5368][1486063625.565019][SQLAllocHandle.c][1085] > Exit:[SQL_SUCCESS] > Output Handle = 0x102915800 > [ODBC][5368][1486063625.565280][SQLSetStmtAttr.c][265] > Entry: > Statement = 0x102915800 > Attribute = SQL_ATTR_CURSOR_TYPE > Value = 0x1 > StrLen = 0 > [ODBC][5368][1486063625.565463][SQLSetStmtAttr.c][928] > Exit:[SQL_SUCCESS] > [ODBC][5368][1486063625.565851][SQLPrepare.c][196] > Entry: > Statement = 0x102915800 > SQL = [INSERT INTO Core_Message(channel_id, date, member_id, reply_id) > VALUES(25, '2017-02-02 22:27:05', 4, NULL) > ][length = 109 (SQL_NTS)] > [ODBC][5368][1486063625.565943][SQLPrepare.c][377] > Exit:[SQL_SUCCESS] > [ODBC][5368][1486063625.566442][SQLExecute.c][187] > Entry: > Statement = 0x102915800 > [ODBC][5368][1486063625.566724][SQLExecute.c][357] > Exit:[SQL_ERROR] > DIAG [HY000] no error information; > Error while preparing parameters > > [ODBC][5368][1486063625.567160][SQLFreeHandle.c][381] > Entry: > Handle Type = 3 > Input Handle = 0x102915800 > [ODBC][5368][1486063625.567308][SQLFreeHandle.c][494] > Exit:[SQL_SUCCESS] > > > Thanks in advance. > > Daniil A Megrabyan > — Daniil A Megrabyan — > phone(telegram, whatsapp, viber) : +79151762470 | skype: danil.megrabyan
On 02/03/2017 12:06 AM, Daniil Megrabyan wrote: > Hi, > > _Sometimes_ I’m getting very «informative» error message on SQLExecute(). The query is quite easy, but I’m guessing thaterror comes from the driver(or driver manager though?). What should I check? What does the Postgres server log show? > > My environment: > macOS 10.12 > unixODBC 2.3.4 > psqlodbc 09.05.0400 > PostgreSQL 9.5.4_1 > > Trace: > [ODBC][5368][1486063625.565019][SQLAllocHandle.c][1085] > Exit:[SQL_SUCCESS] > Output Handle = 0x102915800 > [ODBC][5368][1486063625.565280][SQLSetStmtAttr.c][265] > Entry: > Statement = 0x102915800 > Attribute = SQL_ATTR_CURSOR_TYPE > Value = 0x1 > StrLen = 0 > [ODBC][5368][1486063625.565463][SQLSetStmtAttr.c][928] > Exit:[SQL_SUCCESS] > [ODBC][5368][1486063625.565851][SQLPrepare.c][196] > Entry: > Statement = 0x102915800 > SQL = [INSERT INTO Core_Message(channel_id, date, member_id, reply_id) > VALUES(25, '2017-02-02 22:27:05', 4, NULL) > ][length = 109 (SQL_NTS)] > [ODBC][5368][1486063625.565943][SQLPrepare.c][377] > Exit:[SQL_SUCCESS] > [ODBC][5368][1486063625.566442][SQLExecute.c][187] > Entry: > Statement = 0x102915800 > [ODBC][5368][1486063625.566724][SQLExecute.c][357] > Exit:[SQL_ERROR] > DIAG [HY000] no error information; > Error while preparing parameters > > [ODBC][5368][1486063625.567160][SQLFreeHandle.c][381] > Entry: > Handle Type = 3 > Input Handle = 0x102915800 > [ODBC][5368][1486063625.567308][SQLFreeHandle.c][494] > Exit:[SQL_SUCCESS] > > > Thanks in advance. > > Daniil A Megrabyan > — Daniil A Megrabyan — > phone(telegram, whatsapp, viber) : +79151762470 | skype: danil.megrabyan > > > -- Adrian Klaver adrian.klaver@aklaver.com
> 3 февр. 2017 г., в 16:50, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): > > On 2017/02/03 17:06, Daniil Megrabyan wrote: >> Hi, >> >> _Sometimes_ I’m getting very «informative» error message on SQLExecute(). The query is quite easy, but I’m guessing thaterror comes from the driver(or driver manager though?). What should I check? > > Could you take mylog output and send it to me? [123145489756160]**** PGAPI_AllocStmt: hdbc = 0x10308cc00, stmt = 0x10101ca00 [123145489756160]CC_add_statement: self=0x10308cc00, stmt=0x10101ca00 [123145489756160][[SQLGetStmtAttr]] Handle=16894464 10010 [123145489756160]PGAPI_GetStmtAttr Handle=0x10101ca00 10010 [123145489756160][[SQLGetStmtAttr]] Handle=16894464 10011 [123145489756160]PGAPI_GetStmtAttr Handle=0x10101ca00 10011 [123145489756160][[SQLGetStmtAttr]] Handle=16894464 10012 [123145489756160]PGAPI_GetStmtAttr Handle=0x10101ca00 10012 [123145489756160][[SQLGetStmtAttr]] Handle=16894464 10013 [123145489756160]PGAPI_GetStmtAttr Handle=0x10101ca00 10013 [123145489756160][[SQLSetStmtAttr]] Handle=0x10101ca00 6,1 [123145489756160]PGAPI_SetStmtAttr Handle=0x10101ca00 6,1(0x1) [123145489756160]PGAPI_SetStmtOption: entering... [123145489756160]SetStmtOption(): SQL_CURSOR_TYPE = 1 [123145489756160]-> 1 [123145489756160][SQLPrepare][123145489756160]PGAPI_Prepare: entering... [123145489756160]**** PGAPI_Prepare: STMT_ALLOCATED, copy [123145489756160][SQLExecute][123145489756160]PGAPI_Execute: entering...1 [123145489756160]PGAPI_Execute: clear errors... [123145489756160]PGAPI_NumParams: entering... [123145489756160]SC_scanQueryAndCountParams: entering... [123145489756160]prepareParameters was not called, prepare state:7 [123145489756160]SC_recycle_statement: self= 0x10101ca00 [123145489756160]PDATA_free_params: ENTER, self=0x10101cd30 [123145489756160]Exec_with_parameters_resolved: copying statement params: trans_status=1, len=109, stmt='INSERT INTO Core_Message(channel_id,date, member_id, reply_id) VALUES(18, '2017-02-04 14:01:22', 4, NULL) ' [123145489756160] stmt_with_params = '(null)' [123145489756160]about to begin SC_execute [123145489756160]libpq_bind_and_exec: bind stmt=0x10101ca00 [123145489756160]libpq_bind_and_exec: execute stmt=0x10101ca00 [123145489756160]SC_scanQueryAndCountParams: entering... [123145489756160]SC_scanQueryAndCountParams: entering... [123145489756160]process_statements:parsed for the first command length=-1(-1) num_p=0 [123145489756160]ParseAndDescribeWithLibpq: plan_name=_PLAN0x10101ca00 query=INSERT INTO Core_Message(channel_id, date, member_id,reply_id) VALUES(18, '2017-02-04 14:01:22', 4, NULL) [123145489756160]in QR_Constructor [123145489756160]exit QR_Constructor [123145489756160]ParseWithLibpq: plan_name=_PLAN0x10101ca00 query=INSERT INTO Core_Message(channel_id, date, member_id, reply_id) VALUES(18, '2017-02-04 14:01:22', 4, NULL) [123145489756160]notice/error message len=20 [123145489756160]CC_on_abort in [123145489756160]SC_set_Result(101ca00, c3c5e0)[123145489756160]QResult: enter DESTRUCTOR [123145489756160]STATEMENT ERROR: func=desc_params_and_sync, desc='', errnum=1, errmsg='Error while preparing parameters' [123145489756160]CONN ERROR: func=desc_params_and_sync, desc='', errnum=108, errmsg='(NULL)' [123145489756160]CC_on_abort in [123145489756160]retval=-1 [123145489756160][[SQLGetDiagRec]] [123145489756160]PGAPI_GetDiagRec entering type=3 rec=1 [123145489756160]ER_ReturnError: status = 1, msg = #no error information; Error while preparing parameters# [123145489756160] szSqlState = 'HY000',len=54, szError='no error information; Error while preparing parameters' [123145489756160]PGAPI_GetDiagRec exiting 0 [123145489756160][[SQLGetDiagRec]] [123145489756160]PGAPI_GetDiagRec entering type=3 rec=2 [123145489756160]ER_ReturnError: status = 1, msg = #no error information; Error while preparing parameters# [123145489756160]PGAPI_GetDiagRec exiting 100 [123145489756160][[SQLFreeHandle]][123145489756160]PGAPI_FreeStmt: entering...hstmt=0x10101ca00, fOption=1 [123145489756160]QResult: enter DESTRUCTOR [123145489756160]QResult: in QR_close_result [123145489756160]QResult: free memory in, fcount=0 [123145489756160]QResult: free memory out [123145489756160]QResult: exit close_result [123145489756160]QResult: exit DESTRUCTOR [123145489756160]SC_init_Result(101ca00)[123145489756160]SC_Destructor: self=0x10101ca00, self->result=0x0, self->hdbc=0x10308cc00 [123145489756160]APD_free_params: ENTER, self=0x10101cbd0 [123145489756160]IPD_free_params: ENTER, self=0x10101cc40 [123145489756160]PDATA_free_params: ENTER, self=0x10101cd30 [123145489756160]SC_Destructor: EXIT — Daniil A Megrabyan —
Hi, On 2017/02/04 20:07, Daniil Megrabyan wrote: >> 3 февр. 2017 г., в 16:50, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): >> >> On 2017/02/03 17:06, Daniil Megrabyan wrote: >>> Hi, >>> >>> _Sometimes_ I’m getting very «informative» error message on SQLExecute(). The query is quite easy, but I’m guessing thaterror comes from the driver(or driver manager though?). What should I check? >> Could you take mylog output and send it to me? Thanks for the Mylog output. Could you tell me the definition of core_message table? regards, Hiroshi Inoue.
> 4 февр. 2017 г., в 17:06, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): > >>> 3 февр. 2017 г., в 16:50, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): >>> >>> On 2017/02/03 17:06, Daniil Megrabyan wrote: >>>> Hi, >>>> >>>> _Sometimes_ I’m getting very «informative» error message on SQLExecute(). The query is quite easy, but I’m guessingthat error comes from the driver(or driver manager though?). What should I check? >>> Could you take mylog output and send it to me? > > Thanks for the Mylog output. > Could you tell me the definition of core_message table? For sure. CREATE TABLE Сore_Message ( id int8 NOT NULL DEFAULT nextval('core_message_id_seq'::regclass), channel_id int8 NOT NULL, date timestamp(6) NOT NULL, member_id int8 NOT NULL, reply_id int8 ) WITH (OIDS=FALSE); By the way I have realised the wrong data type for id column ;) Anyway, in this case it doesn’t matter. — Daniil A Megrabyan —
Hi Daniil, On 2017/02/04 23:39, Daniil Megrabyan wrote: >> 4 февр. 2017 г., в 17:06, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): >> >>>> 3 февр. 2017 г., в 16:50, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): >>>> >>>> On 2017/02/03 17:06, Daniil Megrabyan wrote: >>>>> Hi, >>>>> >>>>> _Sometimes_ I’m getting very «informative» error message on SQLExecute(). The query is quite easy, but I’m guessingthat error comes from the driver(or driver manager though?). What should I check? >>>> Could you take mylog output and send it to me? >> Thanks for the Mylog output. >> Could you tell me the definition of core_message table? > For sure. > CREATE TABLE Сore_Message ( > id int8 NOT NULL DEFAULT nextval('core_message_id_seq'::regclass), > channel_id int8 NOT NULL, > date timestamp(6) NOT NULL, > member_id int8 NOT NULL, > reply_id int8 > ) > WITH (OIDS=FALSE); Thanks. Unfortunately I can't reproduce your case. Though I found a suspicious place thanks to the mylog you sent, there is not enough information in the log unfortunately. Could you build the drivers from source? regards, Hiroshi Inoue
> 5 февр. 2017 г., в 3:26, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): > > Thanks. > Unfortunately I can't reproduce your case. > > Though I found a suspicious place thanks to the mylog you sent, there is not enough > information in the log unfortunately. > > Could you build the drivers from source? I have built from the latest sources and got the same stuff. But! I’ve noticed another error occurred before — driver managerblames encoding and UTF8-data becomes a question mark. odbc trace: Exit:[SQL_SUCCESS] [ODBC][43276][1486279223.490067][SQLAllocHandle.c][540] Entry: Handle Type = 3 Input Handle = 0x10286c200 [ODBC][43276][1486279223.490282][SQLAllocHandle.c][1085] Exit:[SQL_SUCCESS] Output Handle = 0x10101ca00 [ODBC][43276][1486279223.490374][SQLSetStmtAttr.c][265] Entry: Statement = 0x10101ca00 Attribute = SQL_ATTR_CURSOR_TYPE Value = 0x1 StrLen = 0 [ODBC][43276][1486279223.490567][SQLSetStmtAttr.c][928] Exit:[SQL_SUCCESS] [ODBC][43276][1486279223.490748][SQLPrepare.c][196] Entry: Statement = 0x10101ca00 SQL = [INSERT INTO Core_TextMessage(message_id, text) VALUES(32, '?') ][length = 65 (SQL_NTS)] [ODBC][43276][1486279223.490868][SQLPrepare.c][377] Exit:[SQL_SUCCESS] [ODBC][43276][1486279223.491009][SQLExecute.c][187] Entry: Statement = 0x10101ca00 [ODBC][43276][1486279223.531171][SQLExecute.c][357] Exit:[SQL_ERROR] DIAG [22021] ERROR: invalid byte sequence for encoding "UTF8": 0xd0 0x27; Error while preparing parameters [ODBC][43276][1486279223.531656][SQLFreeHandle.c][381] Entry: Handle Type = 3 Input Handle = 0x10101ca00 [ODBC][43276][1486279223.532054][SQLFreeHandle.c][494] mylog: [123145375444992][[SQLAllocHandle]][123145375444992]PGAPI_AllocStmt: entering... [123145375444992]**** PGAPI_AllocStmt: hdbc = 0x1030a3200, stmt = 0x101000600 [123145375444992]CC_add_statement: self=0x1030a3200, stmt=0x101000600 [123145375444992][[SQLGetStmtAttr]] Handle=16778752 10010 [123145375444992]PGAPI_GetStmtAttr Handle=0x101000600 10010 [123145375444992][[SQLGetStmtAttr]] Handle=16778752 10011 [123145375444992]PGAPI_GetStmtAttr Handle=0x101000600 10011 [123145375444992][[SQLGetStmtAttr]] Handle=16778752 10012 [123145375444992]PGAPI_GetStmtAttr Handle=0x101000600 10012 [123145375444992][[SQLGetStmtAttr]] Handle=16778752 10013 [123145375444992]PGAPI_GetStmtAttr Handle=0x101000600 10013 [123145375444992][[SQLSetStmtAttr]] Handle=0x101000600 6,1 [123145375444992]PGAPI_SetStmtAttr Handle=0x101000600 6,1(0x1) [123145375444992]PGAPI_SetStmtOption: entering... [123145375444992]SetStmtOption(): SQL_CURSOR_TYPE = 1 [123145375444992]-> 1 [123145375444992][SQLPrepare][123145375444992]PGAPI_Prepare: entering... [123145375444992]**** PGAPI_Prepare: STMT_ALLOCATED, copy [123145375444992][SQLExecute][123145375444992]PGAPI_Execute: entering...1 [123145375444992]PGAPI_Execute: clear errors... [123145375444992]PGAPI_NumParams: entering... [123145375444992]SC_scanQueryAndCountParams: entering... [123145375444992]prepareParameters was not called, prepare state:7 [123145375444992]SC_recycle_statement: self= 0x101000600 [123145375444992]PDATA_free_params: ENTER, self=0x101000938 [123145375444992]Exec_with_parameters_resolved: copying statement params: trans_status=1, len=65, stmt='INSERT INTO Core_TextMessage(message_id,text) VALUES(32, '?') ' [123145375444992] stmt_with_params = '(null)' [123145375444992]about to begin SC_execute [123145375444992]libpq_bind_and_exec: bind stmt=0x101000600 [123145375444992]libpq_bind_and_exec: execute stmt=0x101000600 [123145375444992]SC_scanQueryAndCountParams: entering... [123145375444992]SC_scanQueryAndCountParams: entering... [123145375444992]process_statements:parsed for the first command length=-1(-1) num_p=0 [123145375444992]ParseAndDescribeWithLibpq: plan_name=_PLAN0x101000600 query=INSERT INTO Core_TextMessage(message_id, text) VALUES(32, '?') [123145375444992]in QR_Constructor [123145375444992]exit QR_Constructor [123145375444992]ParseWithLibpq: plan_name=_PLAN0x101000600 query=INSERT INTO Core_TextMessage(message_id, text) VALUES(32, '?') [123145375444992]error message len=59 [123145375444992]SC_set_Result(1000600, 93b160)[123145375444992]QResult: enter DESTRUCTOR [123145375444992]STATEMENT ERROR: func=desc_params_and_sync, desc='', errnum=1, errmsg='Error while preparing parameters' [123145375444992]CONN ERROR: func=desc_params_and_sync, desc='', errnum=110, errmsg='(NULL)' [123145375444992]CC_on_abort in [123145375444992]retval=-1 [123145375444992][[SQLGetDiagRec]] [123145375444992]PGAPI_GetDiagRec entering type=3 rec=1 [123145375444992]ER_ReturnError: status = 1, msg = #ERROR: invalid byte sequence for encoding "UTF8": 0xd0 0x27; Error while preparing parameters# [123145375444992] szSqlState = '22021',len=93, szError='ERROR: invalid byte sequence for encoding "UTF8": 0xd0 0x27; Error while preparing parameters' [123145375444992]PGAPI_GetDiagRec exiting 0 [123145375444992][[SQLGetDiagRec]] [123145375444992]PGAPI_GetDiagRec entering type=3 rec=2 [123145375444992]ER_ReturnError: status = 1, msg = #ERROR: invalid byte sequence for encoding "UTF8": 0xd0 0x27; Error while preparing parameters# [123145375444992]PGAPI_GetDiagRec exiting 100 [123145375444992][[SQLFreeHandle]][123145375444992]PGAPI_FreeStmt: entering...hstmt=0x101000600, fOption=1 [123145375444992]QResult: enter DESTRUCTOR [123145375444992]QResult: in QR_close_result [123145375444992]QResult: free memory in, fcount=0 [123145375444992]QResult: free memory out [123145375444992]QResult: exit close_result [123145375444992]QResult: exit DESTRUCTOR [123145375444992]SC_init_Result(1000600)[123145375444992]SC_Destructor: self=0x101000600, self->result=0x0, self->hdbc=0x1030a3200 [123145375444992]APD_free_params: ENTER, self=0x1010007d0 [123145375444992]IPD_free_params: ENTER, self=0x101000840 [123145375444992]PDATA_free_params: ENTER, self=0x101000938 [123145375444992]SC_Destructor: EXIT [123145375444992][[SQLAllocHandle]][123145375444992]PGAPI_AllocStmt: entering... [123145375444992]**** PGAPI_AllocStmt: hdbc = 0x1030a3200, stmt = 0x10101ca00 [123145375444992]CC_add_statement: self=0x1030a3200, stmt=0x10101ca00 [123145375444992][[SQLGetStmtAttr]] Handle=16894464 10010 [123145375444992]PGAPI_GetStmtAttr Handle=0x10101ca00 10010 [123145375444992][[SQLGetStmtAttr]] Handle=16894464 10011 [123145375444992]PGAPI_GetStmtAttr Handle=0x10101ca00 10011 [123145375444992][[SQLGetStmtAttr]] Handle=16894464 10012 [123145375444992]PGAPI_GetStmtAttr Handle=0x10101ca00 10012 [123145375444992][[SQLGetStmtAttr]] Handle=16894464 10013 [123145375444992]PGAPI_GetStmtAttr Handle=0x10101ca00 10013 [123145375444992][[SQLSetStmtAttr]] Handle=0x10101ca00 6,1 [123145375444992]PGAPI_SetStmtAttr Handle=0x10101ca00 6,1(0x1) [123145375444992]PGAPI_SetStmtOption: entering... [123145375444992]SetStmtOption(): SQL_CURSOR_TYPE = 1 [123145375444992]-> 1 [123145375444992][SQLPrepare][123145375444992]PGAPI_Prepare: entering... [123145375444992]**** PGAPI_Prepare: STMT_ALLOCATED, copy [123145375444992][SQLExecute][123145375444992]PGAPI_Execute: entering...1 [123145375444992]PGAPI_Execute: clear errors... [123145375444992]PGAPI_NumParams: entering... [123145375444992]SC_scanQueryAndCountParams: entering... [123145375444992]prepareParameters was not called, prepare state:7 [123145375444992]SC_recycle_statement: self= 0x10101ca00 [123145375444992]PDATA_free_params: ENTER, self=0x10101cd38 [123145375444992]Exec_with_parameters_resolved: copying statement params: trans_status=1, len=109, stmt='INSERT INTO Core_Message(channel_id,date, member_id, reply_id) VALUES(25, '2017-02-05 10:20:38', 4, NULL) ' [123145375444992] stmt_with_params = '(null)' [123145375444992]about to begin SC_execute [123145375444992]libpq_bind_and_exec: bind stmt=0x10101ca00 [123145375444992]libpq_bind_and_exec: execute stmt=0x10101ca00 [123145375444992]SC_scanQueryAndCountParams: entering... [123145375444992]SC_scanQueryAndCountParams: entering... [123145375444992]process_statements:parsed for the first command length=-1(-1) num_p=0 [123145375444992]ParseAndDescribeWithLibpq: plan_name=_PLAN0x10101ca00 query=INSERT INTO Core_Message(channel_id, date, member_id,reply_id) VALUES(25, '2017-02-05 10:20:38', 4, NULL) [123145375444992]in QR_Constructor [123145375444992]exit QR_Constructor [123145375444992]ParseWithLibpq: plan_name=_PLAN0x10101ca00 query=INSERT INTO Core_Message(channel_id, date, member_id, reply_id) VALUES(25, '2017-02-05 10:20:38', 4, NULL) [123145375444992]error message len=20 [123145375444992]CC_on_abort in [123145375444992]SC_set_Result(101ca00, d0f920)[123145375444992]QResult: enter DESTRUCTOR [123145375444992]STATEMENT ERROR: func=desc_params_and_sync, desc='', errnum=1, errmsg='Error while preparing parameters' [123145375444992]CONN ERROR: func=desc_params_and_sync, desc='', errnum=113, errmsg='(NULL)' [123145375444992]CC_on_abort in [123145375444992]retval=-1 [123145375444992][[SQLGetDiagRec]] [123145375444992]PGAPI_GetDiagRec entering type=3 rec=1 [123145375444992]ER_ReturnError: status = 1, msg = #no error information; Error while preparing parameters# [123145375444992] szSqlState = 'HY000',len=54, szError='no error information; Error while preparing parameters' [123145375444992]PGAPI_GetDiagRec exiting 0 [123145375444992][[SQLGetDiagRec]] [123145375444992]PGAPI_GetDiagRec entering type=3 rec=2 [123145375444992]ER_ReturnError: status = 1, msg = #no error information; Error while preparing parameters# [123145375444992]PGAPI_GetDiagRec exiting 100 [123145375444992][[SQLFreeHandle]][123145375444992]PGAPI_FreeStmt: entering...hstmt=0x10101ca00, fOption=1 [123145375444992]QResult: enter DESTRUCTOR [123145375444992]QResult: in QR_close_result [123145375444992]QResult: free memory in, fcount=0 [123145375444992]QResult: free memory out [123145375444992]QResult: exit close_result [123145375444992]QResult: exit DESTRUCTOR [123145375444992]SC_init_Result(101ca00)[123145375444992]SC_Destructor: self=0x10101ca00, self->result=0x0, self->hdbc=0x1030a3200 [123145375444992]APD_free_params: ENTER, self=0x10101cbd0 [123145375444992]IPD_free_params: ENTER, self=0x10101cc40 [123145375444992]PDATA_free_params: ENTER, self=0x10101cd38 [123145375444992]SC_Destructor: EXIT [123145375444992][[SQLGetDiagRec]] [123145375444992]PGAPI_GetDiagRec entering type=2 rec=1 [123145375444992]**** PGAPI_ConnectError: hdbc=0x1030a3200 <512> [123145375444992]enter CC_get_error [123145375444992]exit CC_get_error [123145375444992]CC_Get_error returned nothing. [123145375444992]PGAPI_GetDiagRec exiting 100 — Daniil A Megrabyan —
> 5 февр. 2017 г., в 10:46, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): > > Oh nice. > Could you apply an attached patch and try? Here we go! errmsg='PQprepare failed with memory error?' [123145367658496][[SQLAllocHandle]][123145367658496]PGAPI_AllocStmt: entering... [123145367658496]**** PGAPI_AllocStmt: hdbc = 0x10387d200, stmt = 0x10381c800 [123145367658496]CC_add_statement: self=0x10387d200, stmt=0x10381c800 [123145367658496][[SQLGetStmtAttr]] Handle=58836992 10010 [123145367658496]PGAPI_GetStmtAttr Handle=0x10381c800 10010 [123145367658496][[SQLGetStmtAttr]] Handle=58836992 10011 [123145367658496]PGAPI_GetStmtAttr Handle=0x10381c800 10011 [123145367658496][[SQLGetStmtAttr]] Handle=58836992 10012 [123145367658496]PGAPI_GetStmtAttr Handle=0x10381c800 10012 [123145367658496][[SQLGetStmtAttr]] Handle=58836992 10013 [123145367658496]PGAPI_GetStmtAttr Handle=0x10381c800 10013 [123145367658496][[SQLSetStmtAttr]] Handle=0x10381c800 6,1 [123145367658496]PGAPI_SetStmtAttr Handle=0x10381c800 6,1(0x1) [123145367658496]PGAPI_SetStmtOption: entering... [123145367658496]SetStmtOption(): SQL_CURSOR_TYPE = 1 [123145367658496]-> 1 [123145367658496][SQLPrepare][123145367658496]PGAPI_Prepare: entering... [123145367658496]**** PGAPI_Prepare: STMT_ALLOCATED, copy [123145367658496][SQLExecute][123145367658496]PGAPI_Execute: entering...1 [123145367658496]PGAPI_Execute: clear errors... [123145367658496]PGAPI_NumParams: entering... [123145367658496]SC_scanQueryAndCountParams: entering... [123145367658496]prepareParameters was not called, prepare state:7 [123145367658496]SC_recycle_statement: self= 0x10381c800 [123145367658496]PDATA_free_params: ENTER, self=0x10381cb38 [123145367658496]Exec_with_parameters_resolved: copying statement params: trans_status=1, len=109, stmt='INSERT INTO Core_Message(channel_id,date, member_id, reply_id) VALUES(25, '2017-02-05 11:01:34', 4, NULL) ' [123145367658496] stmt_with_params = '(null)' [123145367658496]about to begin SC_execute [123145367658496]libpq_bind_and_exec: bind stmt=0x10381c800 [123145367658496]libpq_bind_and_exec: execute stmt=0x10381c800 [123145367658496]SC_scanQueryAndCountParams: entering... [123145367658496]SC_scanQueryAndCountParams: entering... [123145367658496]process_statements:parsed for the first command length=-1(-1) num_p=0 [123145367658496]ParseAndDescribeWithLibpq: plan_name=_PLAN0x10381c800 query=INSERT INTO Core_Message(channel_id, date, member_id,reply_id) VALUES(25, '2017-02-05 11:01:34', 4, NULL) [123145367658496]in QR_Constructor [123145367658496]exit QR_Constructor [123145367658496]ParseWithLibpq: plan_name=_PLAN0x10381c800 query=INSERT INTO Core_Message(channel_id, date, member_id, reply_id) VALUES(25, '2017-02-05 11:01:34', 4, NULL) [123145367658496]PQprepare failed with memory error? [123145367658496]STATEMENT ERROR: func=ParseWithLibpq, desc='', errnum=4, errmsg='PQprepare failed with memory error?' [123145367658496]CONN ERROR: func=ParseWithLibpq, desc='', errnum=110, errmsg='(NULL)' [123145367658496]SC_set_Result(381c800, b325d0)[123145367658496]QResult: enter DESTRUCTOR [123145367658496]error message len=20 [123145367658496]CC_on_abort in [123145367658496]retval=-1 [123145367658496][[SQLGetDiagRec]] [123145367658496]PGAPI_GetDiagRec entering type=3 rec=1 [123145367658496]ER_ReturnError: status = 4, msg = #no error information; PQprepare failed with memory error?# [123145367658496] szSqlState = 'HY001',len=57, szError='no error information; PQprepare failed with memory error?' [123145367658496]PGAPI_GetDiagRec exiting 0 [123145367658496][[SQLGetDiagRec]] [123145367658496]PGAPI_GetDiagRec entering type=3 rec=2 [123145367658496]ER_ReturnError: status = 4, msg = #no error information; PQprepare failed with memory error?# [123145367658496]PGAPI_GetDiagRec exiting 100 [123145367658496][[SQLFreeHandle]][123145367658496]PGAPI_FreeStmt: entering...hstmt=0x10381c800, fOption=1 [123145367658496]QResult: enter DESTRUCTOR [123145367658496]QResult: in QR_close_result [123145367658496]QResult: free memory in, fcount=0 [123145367658496]QResult: free memory out [123145367658496]QResult: exit close_result [123145367658496]QResult: exit DESTRUCTOR [123145367658496]SC_init_Result(381c800)[123145367658496]SC_Destructor: self=0x10381c800, self->result=0x0, self->hdbc=0x10387d200 [123145367658496]APD_free_params: ENTER, self=0x10381c9d0 [123145367658496]IPD_free_params: ENTER, self=0x10381ca40 [123145367658496]PDATA_free_params: ENTER, self=0x10381cb38 [123145367658496]SC_Destructor: EXIT [123145367658496][[SQLGetDiagRec]] [123145367658496]PGAPI_GetDiagRec entering type=2 rec=1 [123145367658496]**** PGAPI_ConnectError: hdbc=0x10387d200 <512> [123145367658496]enter CC_get_error [123145367658496]exit CC_get_error [123145367658496]CC_Get_error returned nothing. [123145367658496]PGAPI_GetDiagRec exiting 100 — Daniil A Megrabyan —
Hi Daniil,
Hmm, strange.
This means
pgres = PQprepare(conn->pqconn, plan_name, query, num_params, paramTypes);
returns a null pointer.
https://www.postgresql.org/docs/9.6/static/libpq-exec.html says
Returns a PGresult pointer or possibly a null pointer. A non-null pointer will generally be returned except in out-of-memory conditions
or serious errors such as inability to send the command to the server.
regards,
Hiroshi Inoue
On 2017/02/05 17:06, Daniil Megrabyan wrote:
5 февр. 2017 г., в 10:46, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): Oh nice. Could you apply an attached patch and try?Here w go! errmsg='PQprepare failed with memory error?'
Hmm, strange.
This means
pgres = PQprepare(conn->pqconn, plan_name, query, num_params, paramTypes);
returns a null pointer.
https://www.postgresql.org/docs/9.6/static/libpq-exec.html says
Returns a PGresult pointer or possibly a null pointer. A non-null pointer will generally be returned except in out-of-memory conditions
or serious errors such as inability to send the command to the server.
regards,
Hiroshi Inoue
> 5 февр. 2017 г., в 11:20, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): > > This means > pgres = PQprepare(conn->pqconn, plan_name, query, num_params, paramTypes); > returns a null pointer. > https://www.postgresql.org/docs/9.6/static/libpq-exec.html says > Returns a PGresult pointer or possibly a null pointer. A non-null pointer will generally be returned except in out-of-memoryconditions > or serious errors such as inability to send the command to the server. I believe, you can reproduce by your own. CREATE TABLE core_message ( id int8 NOT NULL DEFAULT nextval('core_message_id_seq'::regclass), channel_id int8 NOT NULL, date timestamp(6) NOT NULL, member_id int8 NOT NULL, reply_id int8 ) WITH (OIDS=FALSE); CREATE TABLE core_textmessage ( message_id int8 NOT NULL, text text NOT NULL ) WITH (OIDS=FALSE); INSERT INTO core_textmessage(message_id, text) VALUES(1, ‘Мультибайт’) < This UTF8 text does the «magic» and environmentbecomes unusable INSERT INTO core_message(channel_id, date, member_id, reply_id) VALUES(25, '2017-02-05 11:01:34', 4, NULL) — Daniil A Megrabyan — phone(telegram, whatsapp, viber) : +79151762470 | skype: danil.megrabyan
On 2017/02/05 17:30, Daniil Megrabyan wrote: >> 5 февр. 2017 г., в 11:20, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): >> >> This means >> pgres = PQprepare(conn->pqconn, plan_name, query, num_params, paramTypes); >> returns a null pointer. >> https://www.postgresql.org/docs/9.6/static/libpq-exec.html says >> Returns a PGresult pointer or possibly a null pointer. A non-null pointer will generally be returned except in out-of-memoryconditions >> or serious errors such as inability to send the command to the server. > I believe, you can reproduce by your own. I tried on Windows and Linux but can't reproduce the case. I have no mac Environment unfortunately. regards, Hiroshi Inoue > > > CREATE TABLE core_message ( > id int8 NOT NULL DEFAULT nextval('core_message_id_seq'::regclass), > channel_id int8 NOT NULL, > date timestamp(6) NOT NULL, > member_id int8 NOT NULL, > reply_id int8 > ) > WITH (OIDS=FALSE); > > CREATE TABLE core_textmessage ( > message_id int8 NOT NULL, > text text NOT NULL > ) > WITH (OIDS=FALSE); > > INSERT INTO core_textmessage(message_id, text) VALUES(1, ‘Мультибайт’) < This UTF8 text does the «magic» and environmentbecomes unusable > INSERT INTO core_message(channel_id, date, member_id, reply_id) VALUES(25, '2017-02-05 11:01:34', 4, NULL) > > — Daniil A Megrabyan — > phone(telegram, whatsapp, viber) : +79151762470 | skype: danil.megrabyan
On 2017/02/05 22:03, Inoue, Hiroshi wrote: > > > On 2017/02/05 17:30, Daniil Megrabyan wrote: >>> 5 февр. 2017 г., в 11:20, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> >>> написал(а): >>> >>> This means >>> pgres = PQprepare(conn->pqconn, plan_name, query, >>> num_params, paramTypes); >>> returns a null pointer. >>> https://www.postgresql.org/docs/9.6/static/libpq-exec.html says >>> Returns a PGresult pointer or possibly a null pointer. A non-null >>> pointer will generally be returned except in out-of-memory conditions >>> or serious errors such as inability to send the command to the server. >> I believe, you can reproduce by your own. > > I tried on Windows and Linux but can't reproduce the case. > I have no mac Environment unfortunately. I recommend you to check the server log. I now doubt your program really calls PQprepare() in libpq. regards, Hiroshi Inoue > regards, > Hiroshi Inoue > >> >> CREATE TABLE core_message ( >> id int8 NOT NULL DEFAULT nextval('core_message_id_seq'::regclass), >> channel_id int8 NOT NULL, >> date timestamp(6) NOT NULL, >> member_id int8 NOT NULL, >> reply_id int8 >> ) >> WITH (OIDS=FALSE); >> >> CREATE TABLE core_textmessage ( >> message_id int8 NOT NULL, >> text text NOT NULL >> ) >> WITH (OIDS=FALSE); >> >> INSERT INTO core_textmessage(message_id, text) VALUES(1, >> ‘Мультибайт’) < This UTF8 text does the «magic» and environment >> becomes unusable >> INSERT INTO core_message(channel_id, date, member_id, reply_id) >> VALUES(25, '2017-02-05 11:01:34', 4, NULL) >> >> — Daniil A Megrabyan — >> phone(telegram, whatsapp, viber) : +79151762470 | skype: danil.megrabyan >
On 02/05/2017 12:58 PM, Inoue, Hiroshi wrote: > On 2017/02/05 22:03, Inoue, Hiroshi wrote: >> >> >> On 2017/02/05 17:30, Daniil Megrabyan wrote: >>>> 5 февр. 2017 г., в 11:20, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> >>>> написал(а): >>>> >>>> This means >>>> pgres = PQprepare(conn->pqconn, plan_name, query, >>>> num_params, paramTypes); >>>> returns a null pointer. >>>> https://www.postgresql.org/docs/9.6/static/libpq-exec.html says >>>> Returns a PGresult pointer or possibly a null pointer. A non-null >>>> pointer will generally be returned except in out-of-memory conditions >>>> or serious errors such as inability to send the command to the server. >>> I believe, you can reproduce by your own. >> >> I tried on Windows and Linux but can't reproduce the case. >> I have no mac Environment unfortunately. > > I recommend you to check the server log. > I now doubt your program really calls PQprepare() in libpq. Hmm, this got me to wondering. If I recall OS X ships with its own version of Postgres. Can you search for what libpq versions you might have installed on your machine? Also from your first post you have: PostgreSQL 9.5.4_1 This is not Postgres community version number(the _1 part), so where did you get it and/or install it? > > regards, > Hiroshi Inoue > >> regards, >> Hiroshi Inoue >> >>> >>> CREATE TABLE core_message ( >>> id int8 NOT NULL DEFAULT nextval('core_message_id_seq'::regclass), >>> channel_id int8 NOT NULL, >>> date timestamp(6) NOT NULL, >>> member_id int8 NOT NULL, >>> reply_id int8 >>> ) >>> WITH (OIDS=FALSE); >>> >>> CREATE TABLE core_textmessage ( >>> message_id int8 NOT NULL, >>> text text NOT NULL >>> ) >>> WITH (OIDS=FALSE); >>> >>> INSERT INTO core_textmessage(message_id, text) VALUES(1, >>> ‘Мультибайт’) < This UTF8 text does the «magic» and environment >>> becomes unusable >>> INSERT INTO core_message(channel_id, date, member_id, reply_id) >>> VALUES(25, '2017-02-05 11:01:34', 4, NULL) >>> >>> — Daniil A Megrabyan — >>> phone(telegram, whatsapp, viber) : +79151762470 | skype: danil.megrabyan >> > > > -- Adrian Klaver adrian.klaver@aklaver.com
> 6 февр. 2017 г., в 0:49, Adrian Klaver <adrian.klaver@aklaver.com> написал(а): > > On 02/05/2017 12:58 PM, Inoue, Hiroshi wrote: >> On 2017/02/05 22:03, Inoue, Hiroshi wrote: >>> >>> >>> On 2017/02/05 17:30, Daniil Megrabyan wrote: >>>>> 5 февр. 2017 г., в 11:20, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> >>>>> написал(а): >>>>> >>>>> This means >>>>> pgres = PQprepare(conn->pqconn, plan_name, query, >>>>> num_params, paramTypes); >>>>> returns a null pointer. >>>>> https://www.postgresql.org/docs/9.6/static/libpq-exec.html says >>>>> Returns a PGresult pointer or possibly a null pointer. A non-null >>>>> pointer will generally be returned except in out-of-memory conditions >>>>> or serious errors such as inability to send the command to the server. >>>> I believe, you can reproduce by your own. >>> >>> I tried on Windows and Linux but can't reproduce the case. >>> I have no mac Environment unfortunately. >> >> I recommend you to check the server log. >> I now doubt your program really calls PQprepare() in libpq. > > Hmm, this got me to wondering. > > If I recall OS X ships with its own version of Postgres. > > Can you search for what libpq versions you might have installed on your machine? > > Also from your first post you have: > > PostgreSQL 9.5.4_1 > > This is not Postgres community version number(the _1 part), so where did you get it and/or install it? This is homebrew(http://brew.sh) version, actual version is bash-3.2$ pg_ctl --version pg_ctl (PostgreSQL) 9.5.4 — Daniil A Megrabyan —
> 5 февр. 2017 г., в 23:58, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): > > On 2017/02/05 22:03, Inoue, Hiroshi wrote: >> >> >> On 2017/02/05 17:30, Daniil Megrabyan wrote: >>>> 5 февр. 2017 г., в 11:20, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): >>>> >>>> This means >>>> pgres = PQprepare(conn->pqconn, plan_name, query, num_params, paramTypes); >>>> returns a null pointer. >>>> https://www.postgresql.org/docs/9.6/static/libpq-exec.html says >>>> Returns a PGresult pointer or possibly a null pointer. A non-null pointer will generally be returned except in out-of-memoryconditions >>>> or serious errors such as inability to send the command to the server. >>> I believe, you can reproduce by your own. >> >> I tried on Windows and Linux but can't reproduce the case. >> I have no mac Environment unfortunately. > > I recommend you to check the server log. > I now doubt your program really calls PQprepare() in libpq. I have moved everything to Ubuntu and can confirm that no errors are appeared. I’m wondering how it will be on other machines from BSD stack like FreeBSD. — Daniil A Megrabyan —
On 02/05/2017 10:47 PM, Daniil Megrabyan wrote: > >> 6 февр. 2017 г., в 0:49, Adrian Klaver <adrian.klaver@aklaver.com> написал(а): >> >> On 02/05/2017 12:58 PM, Inoue, Hiroshi wrote: >>> On 2017/02/05 22:03, Inoue, Hiroshi wrote: >>>> >>>> >>>> On 2017/02/05 17:30, Daniil Megrabyan wrote: >>>>>> 5 февр. 2017 г., в 11:20, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> >>>>>> написал(а): >>>>>> >>>>>> This means >>>>>> pgres = PQprepare(conn->pqconn, plan_name, query, >>>>>> num_params, paramTypes); >>>>>> returns a null pointer. >>>>>> https://www.postgresql.org/docs/9.6/static/libpq-exec.html says >>>>>> Returns a PGresult pointer or possibly a null pointer. A non-null >>>>>> pointer will generally be returned except in out-of-memory conditions >>>>>> or serious errors such as inability to send the command to the server. >>>>> I believe, you can reproduce by your own. >>>> >>>> I tried on Windows and Linux but can't reproduce the case. >>>> I have no mac Environment unfortunately. >>> >>> I recommend you to check the server log. >>> I now doubt your program really calls PQprepare() in libpq. >> >> Hmm, this got me to wondering. >> >> If I recall OS X ships with its own version of Postgres. >> >> Can you search for what libpq versions you might have installed on your machine? Is there more then one version of libpq? >> >> Also from your first post you have: >> >> PostgreSQL 9.5.4_1 >> >> This is not Postgres community version number(the _1 part), so where did you get it and/or install it? > This is homebrew(http://brew.sh) version, actual version is > > bash-3.2$ pg_ctl --version > pg_ctl (PostgreSQL) 9.5.4 > > — Daniil A Megrabyan — > > > -- Adrian Klaver adrian.klaver@aklaver.com
On 02/06/2017 10:48 AM, Daniil Megrabyan wrote: > >> 6 февр. 2017 г., в 18:19, Adrian Klaver <adrian.klaver@aklaver.com> написал(а): >> >>>>> I now doubt your program really calls PQprepare() in libpq. >>>> >>>> Hmm, this got me to wondering. >>>> >>>> If I recall OS X ships with its own version of Postgres. >>>> >>>> Can you search for what libpq versions you might have installed on your machine? >> >> Is there more then one version of libpq? > There are some old versions. > > bash-3.2$ ls -la /usr/local/Cellar/postgresql/ > total 0 > drwxr-xr-x 5 danilabagroff admin 170 2 ноя 22:53 . > drwxr-xr-x 35 danilabagroff admin 1190 17 ноя 17:55 .. > drwxr-xr-x 11 danilabagroff admin 374 15 янв 2015 9.4.0 > drwxr-xr-x 11 danilabagroff admin 374 29 авг 16:06 9.4.5_2 > drwxr-xr-x 11 danilabagroff admin 374 2 ноя 22:53 9.5.4_1 These are Postgres versions. What I am talking about is the libpq library that psqlodbc uses to communicate with Postgres. Should have asked earlier, how did you install psqlodbc? Find the psqlodbc file, on my machine(openSUSE 42.2 psqlodbc built from source) it is: /usr/local/lib64/psqlodbcw.so From this post: http://dba.stackexchange.com/questions/120309/psql-invalid-client-encoding-error-on-os-x-postgresql-9-4-5 on OS X you would need to do: otool -L /path/to/psqlodbcw This should show what libpq it is using. > > But in use just the latest one: > miniBagroff:psqlodbc-09.06.0100 danilabagroff$ ls -la /usr/local/bin/pg_ctl > lrwxr-xr-x 1 danilabagroff admin 39 2 ноя 22:53 /usr/local/bin/pg_ctl -> ../Cellar/postgresql/9.5.4_1/bin/pg_ctl That indicates you are starting the latest Postgres version as your Postgres server. It does not necessarily mean you are using the latest libpq with psqlodbc. > >>>> >>>> Also from your first post you have: >>>> >>>> PostgreSQL 9.5.4_1 >>>> >>>> This is not Postgres community version number(the _1 part), so where did you get it and/or install it? >>> This is homebrew(http://brew.sh) version, actual version is >>> >>> bash-3.2$ pg_ctl --version >>> pg_ctl (PostgreSQL) 9.5.4 >>> >>> — Daniil A Megrabyan — >>> >>> >>> >> > > — Daniil A Megrabyan — > phone(telegram, whatsapp, viber) : +79151762470 | skype: danil.megrabyan > -- Adrian Klaver adrian.klaver@aklaver.com
On 02/06/2017 11:14 PM, Daniil Megrabyan wrote: Please reply to the list also. Ccing list > >> 6 февр. 2017 г., в 23:57, Adrian Klaver <adrian.klaver@aklaver.com> написал(а): >> These are Postgres versions. What I am talking about is the libpq library that psqlodbc uses to communicate with Postgres. >> >> Should have asked earlier, how did you install psqlodbc? >> >> Find the psqlodbc file, on my machine(openSUSE 42.2 psqlodbc built from source) it is: >> >> /usr/local/lib64/psqlodbcw.so >> >> From this post: >> >> http://dba.stackexchange.com/questions/120309/psql-invalid-client-encoding-error-on-os-x-postgresql-9-4-5 >> >> on OS X you would need to do: >> >> otool -L /path/to/psqlodbcw >> >> This should show what libpq it is using. > miniBagroff:psqlodbc-09.06.0100 danilabagroff$ otool -L /usr/local/lib/psqlodbcw.so /usr/local/lib/psqlodbcw.so: /usr/local/opt/postgresql/lib/libpq.5.dylib (compatibility version 5.0.0, current version 5.8.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0) /usr/local/opt/unixodbc/lib/libodbcinst.2.dylib (compatibility version 3.0.0, current version 3.0.0) > — Daniil A Megrabyan — > -- Adrian Klaver adrian.klaver@aklaver.com
Hi Daniil. On 2017/02/06 23:20, Daniil Megrabyan wrote: >> 5 февр. 2017 г., в 23:58, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): >> >> On 2017/02/05 22:03, Inoue, Hiroshi wrote: >>> >>> On 2017/02/05 17:30, Daniil Megrabyan wrote: >>>>> 5 февр. 2017 г., в 11:20, Inoue, Hiroshi <h-inoue@dream.email.ne.jp> написал(а): >>>>> >>>>> This means >>>>> pgres = PQprepare(conn->pqconn, plan_name, query, num_params, paramTypes); >>>>> returns a null pointer. >>>>> https://www.postgresql.org/docs/9.6/static/libpq-exec.html says >>>>> Returns a PGresult pointer or possibly a null pointer. A non-null pointer will generally be returned except in out-of-memoryconditions >>>>> or serious errors such as inability to send the command to the server. >>>> I believe, you can reproduce by your own. >>> I tried on Windows and Linux but can't reproduce the case. >>> I have no mac Environment unfortunately. >> I recommend you to check the server log. >> I now doubt your program really calls PQprepare() in libpq. > I have moved everything to Ubuntu and can confirm that no errors are appeared. > I’m wondering how it will be on other machines from BSD stack like FreeBSD. Could you try debug using lldb? regards, Hiroshi Inoue