PostgreSQL语法问题。
下面的查询将运行,但结果是:
错误:查询结果内存不足
SELECT
AD.ADDRESS_DETAIL_PID as ADDRESS_DETAIL_PID,
AD.STREET_LOCALITY_PID as STREET_LOCALITY_PID,
AD.LOCALITY_PID as LOCALITY_PID,
AD.BUILDING_NAME as BUILDING_NAME
将查询修改为:
set FETCH_COUNT=1000
SELECT
AD.ADDRESS_DETAIL_PID as ADDRESS_DETAIL_PID,
AD.STREET_LOCALITY_PID as STREET_LOCALITY_PID,
AD.LOCALITY_PID as LOCALITY_PID,
AD.BUILDING_NAME as BUILDING_NAME
结果是:
错误:“ SELECT”处或附近的语法错误第3行:SELECT ^ SQL状态:42601字符:23
除了冒号时;最后的结果是:
错误:无法识别的配置参数“ fetch_count”的SQL状态: 42704
我正在寻求有关语法的帮助。
答案 0 :(得分:0)
FETCH_COUNT
是一个psql
区间变量,不在服务器上执行。
SET
是在服务器上执行的SQL命令,不能用于设置psql
内部变量。改用\set
。
\set FETCH_COUNT 1000