[GENERAL] BUG in Prepared transactions from C code using JSON - Mailing list pgsql-general

From Арсен Арутюнян
Subject [GENERAL] BUG in Prepared transactions from C code using JSON
Date
Msg-id 1498214047.708561783@f419.i.mail.ru
Whole thread Raw
List pgsql-general
i've got table with json field.

i'm trying to insert from C function some json data.
i'm using SPI_execute_plan function to do this.

json data prepared with StringInfo
simple example:

StringInfo Message = makeStringInfo();

appendStringInfoString(Message, "{\"Command\":227,\"Status\":2,\"JobId\":4"});
Datum Values[2];

Values[0] = Int32GetDatum(227);
Values[1] = CStringGetDatum(Message->data);

ret = SPI_execute_plan(PreparedTr, Values, NULL, false, 0);

if (ret > 0 && SPI_tuptable != NULL && SPI_processed){
///// Data inserted 
}after selection inserted data looks like 

 "Command":227,"Status":2,"JobId":4}

first { simboll is lost....

Arsen





--
Арсен Арутюнян

pgsql-general by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: [GENERAL] pglogical vs. built-in logical replication in pg-10
Next
From: Harry Ambrose
Date:
Subject: Re: [GENERAL] ERROR: unexpected chunk number 0 (expected 1) for toastvalue 76753264 in pg_toast_10920100