[Solved] Linux executes SQL script Error: Syntax error

Demand scenario:

when deploying the production environment, you need to run the SQL script uploaded locally


Problem Description:

the local script runs normally, and liunux reports syntax error </ font>

syntax error

Cause analysis:

when running stored procedures or a long string of SQL scripts in Linux, you need to add fixed syntax at the beginning and end
beginning: \set sqlterm/
end:/\ set sqlterm


Solution:

add fixed statements \set sqlterm/and
/\ set sqlterm
as shown in the figure:
 

Read More: