Need assistance for running postgresql procedures

Started by Sasmit Utkarshabout 2 years ago3 messagesgeneral
Jump to latest
#1Sasmit Utkarsh
utkarshsasmit@gmail.com

Hi Postgres Team,

Kindly assist with the issue faced while calling procedures on postgresql
using libpq in C. I have attached all the details in the note. Please let
me know if you need any more information

Regards,
Sasmit Utkarsh
+91-7674022625

Attachments:

Posgresql_procedure_test_results.txttext/plain; charset=US-ASCII; name=Posgresql_procedure_test_results.txtDownload
#2Francisco Olarte
folarte@peoplecall.com
In reply to: Sasmit Utkarsh (#1)
Re: Need assistance for running postgresql procedures

Hi sasmit.

On Tue, 23 Jan 2024 at 18:51, Sasmit Utkarsh <utkarshsasmit@gmail.com> wrote:

Kindly assist with the issue faced while calling procedures on postgresql using libpq in C. I have attached all the details in the note. Please let me know if you need any more information

I'm not familiar with using binary parameters, but are you sured you
do not need calling htonl(3) on the rtp value? ( 3 is man section, not
htonl argument ).

"Values passed in binary format require knowledge of the internal
representation expected by the backend.
********* For example, integers must be passed in network byte order. ******
Passing numeric values requires knowledge of the server storage
format, as implemented in
src/backend/utils/adt/numeric.c::numeric_send() and
src/backend/utils/adt/numeric.c::numeric_recv()."

A quick test would be to use rtp=0x04000000 and see if it then works (
if it comes from cmd line or similar, if it comes from code just use
hton )

Francisco Olarte.

#3Sasmit Utkarsh
utkarshsasmit@gmail.com
In reply to: Francisco Olarte (#2)
Re: Need assistance for running postgresql procedures

Thanks, I'll check it out.

Regards,
Sasmit Utkarsh
+91-7674022625

On Wed, 24 Jan, 2024, 01:59 Francisco Olarte, <folarte@peoplecall.com>
wrote:

Show quoted text

Hi sasmit.

On Tue, 23 Jan 2024 at 18:51, Sasmit Utkarsh <utkarshsasmit@gmail.com>
wrote:

Kindly assist with the issue faced while calling procedures on

postgresql using libpq in C. I have attached all the details in the note.
Please let me know if you need any more information

I'm not familiar with using binary parameters, but are you sured you
do not need calling htonl(3) on the rtp value? ( 3 is man section, not
htonl argument ).

"Values passed in binary format require knowledge of the internal
representation expected by the backend.
********* For example, integers must be passed in network byte order.
******
Passing numeric values requires knowledge of the server storage
format, as implemented in
src/backend/utils/adt/numeric.c::numeric_send() and
src/backend/utils/adt/numeric.c::numeric_recv()."

A quick test would be to use rtp=0x04000000 and see if it then works (
if it comes from cmd line or similar, if it comes from code just use
hton )

Francisco Olarte.