Skip to content
Advertisement

Postgres: SQL Error [42601]: ERROR: syntax error at or near “int”

I am getting the below error for the following Block-

SQL Error [42601]: ERROR: syntax error at or near “int”

Position: 14

BLOCK

Kindly help me in pointing my mistake.

Advertisement

Answer

First of all the types like smallint, integer, bigint and int store whole numbers, that is, numbers without fractional components, of various ranges. Attempts to store values outside of the allowed range will result in an error.

You add a text in a int value and this is not allowed:

Second to avoid the error you should add $$ LANGUAGE plpgsql to your code:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement