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

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
gameiro
Posts: 1
Joined: Wed 16 Dec 2020 20:28

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

Post by gameiro » Wed 16 Dec 2020 20:32

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

DmitryGm
Devart Team
Posts: 4
Joined: Fri 11 Dec 2020 10:27

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

Post by DmitryGm » Wed 23 Dec 2020 08:13

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.

Shalex
Site Admin
Posts: 9164
Joined: Thu 14 Aug 2008 12:44

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

Post by Shalex » Mon 28 Dec 2020 17:36

We have reproduced the issue with jsonb and will notify you when it is fixed.

Shalex
Site Admin
Posts: 9164
Joined: Thu 14 Aug 2008 12:44

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

Post by Shalex » Fri 15 Jan 2021 13:36

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.

Post Reply