1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PostgreSQLでinvalid input syntax for type jsonエラー

Posted at

PostgreSQLのsql/plpgsqlでinvalid input syntax for type jsonエラーが起こる場合。

例えば以下のようなエラーに遭遇した。

ERROR:  invalid input syntax for type json
DETAIL:  The input string ended unexpectedly.
CONTEXT:  JSON data, line 1: 
SQL state: 22P02

解決

jsonファイルの最後に空白行が入っている可能性があるので、それを除去する。

it was beucase an empty line in the end of the json file
sql - PostgreSQL invalid input syntax for type json The input string ended unexpectedly - Stack Overflow

1
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?