I. Problem description
This error was reported during the query operation, and by analysis, it was not an SQL statement syntax error, if it was an SQL statement syntax error, which row would be reported as a problem, it was a query with a PostgreSQL data type error, a non-Bigint data type, and a value of 1.0 saved in the database. Query as a bigint type. SQL example:
This error was reported during the query operation, and by analysis, it was not an SQL statement syntax error, if it was an SQL statement syntax error, which row would be reported as a problem, it was a query with a PostgreSQL data type error, a non-Bigint data type, and a value of 1.0 saved in the database. Query as a bigint type. SQL example:
select (
ext ->> 'weekly_outpatient_days'
) :: BIGINT AS weekly_outpatient_days from test
Ii. Solutions
Get the question SQL, see which fields are designated as Bigint, then change it to something else, which I call numeric, and that’s fine.
select (
ext ->> 'weekly_outpatient_days'
) :: numeric AS weekly_outpatient_days from test
Third, summary
The problem arises because of a lack of understanding of PostgreSQL data types.
1. The number types are as follows
2. The string type is as follows:
3. Generally, Integer or Bigint is used as the type, while numeric is used for the high-precision type and text is used for the string type. Please refer to the form for the specific refinement. If helpful, welcome to focus on Java basic notes public account.