Page 1 of 1

Error insert/update $exception {"invalid input syntax for type json"}

Posted: Wed 16 Dec 2020 20:32
by gameiro
Hi,

Hi, after i updated the dotconnect for postgres to the last version (7.20.1782)i have face some exception when i insert or update a json/jsonb column type.
The exception is:
$exception {"invalid input syntax for type json"}
The column type is jsonb

Re: Error insert/update $exception {"invalid input syntax for type json"}

Posted: Wed 23 Dec 2020 08:13
by DmitryGm
Hello.

I was unable to reproduce the exception with dotConnect for PostgreSQL - 7.20.1782 - I can insert and update jsonb data via dotConnect.
Update example:

Code: Select all

PgSqlCommand cmd = db.CreateCommand();
cmd.CommandText = @"update books set info= '{""price"": 60, ""name"": ""Alice""}' where id=3";
cmd.ExecuteNonQuery();
(The column "info" in the table "books" has type jsonb).

Can you send us an example of your code witch causes exception?
Besides, the latest version of dotConnect for PostgreSQL is 7.20.1792 and we recommend updating to it.
If the error is still reproduced, we need more information about it and a code example, reproducing it.

Re: Error insert/update $exception {"invalid input syntax for type json"}

Posted: Mon 28 Dec 2020 17:36
by Shalex
We have reproduced the issue with jsonb and will notify you when it is fixed.

Re: Error insert/update $exception {"invalid input syntax for type json"}

Posted: Fri 15 Jan 2021 13:36
by Shalex
The bug with inserting JSONB value via a parameter of PgSqlCommand is fixed in dotConnect for PostgreSQL v7.20.1812: viewtopic.php?f=3&t=44357.