Re: Error on query execution

2025-03-06 Thread Tom Lane
Igor Korot writes: > On Tue, Mar 4, 2025 at 8:37 PM Tom Lane wrote: >> ... but given that you didn't specify any data type, I think the >> parser will fall back to assuming that $1 is the same type as >> "abf_type", whatever that is. Passing data in binary is not at all >> forgiving about gettin

Re: Error on query execution

2025-03-06 Thread Igor Korot
H, On Tue, Mar 4, 2025 at 8:37 PM Tom Lane wrote: > > Igor Korot writes: > > binaryIntVal = htonl( (uint32_t) type ); > > paramValues[0] = (char *) &binaryIntVal; > > paramLengths[0] = sizeof( binaryIntVal ); > > paramFormats[0] = 1; > > You're apparently trying to pass this para

Re: Error on query execution

2025-03-05 Thread Igor Korot
Tom, On Tue, Mar 4, 2025, 8:37 PM Tom Lane wrote: > Igor Korot writes: > > binaryIntVal = htonl( (uint32_t) type ); > > paramValues[0] = (char *) &binaryIntVal; > > paramLengths[0] = sizeof( binaryIntVal ); > > paramFormats[0] = 1; > > You're apparently trying to pass this param

Re: Error on query execution

2025-03-05 Thread Igor Korot
Hi, Tom, On Tue, Mar 4, 2025 at 8:37 PM Tom Lane wrote: > > Igor Korot writes: > > binaryIntVal = htonl( (uint32_t) type ); > > paramValues[0] = (char *) &binaryIntVal; > > paramLengths[0] = sizeof( binaryIntVal ); > > paramFormats[0] = 1; > > You're apparently trying to pass thi

Re: Error on query execution

2025-03-04 Thread Tom Lane
Igor Korot writes: > binaryIntVal = htonl( (uint32_t) type ); > paramValues[0] = (char *) &binaryIntVal; > paramLengths[0] = sizeof( binaryIntVal ); > paramFormats[0] = 1; You're apparently trying to pass this parameter as an int4 ... > res = PQexecParams( m_db, "SELECT * FRO

Error on query execution

2025-03-04 Thread Igor Korot
Hi, ALL, [code] type = 80; uint32_t binaryIntVal; const char *paramValues[1]; int paramLengths[1]; int paramFormats[1]; binaryIntVal = htonl( (uint32_t) type ); paramValues[0] = (char *) &binaryIntVal; paramLengths[0] = sizeof( binaryIntVal ); paramFormats[0] = 1