2
我正在使用JOOQ for java來postgresql db連接。它試圖運行這個查詢。Postgres:在「as」或附近的語法錯誤
insert into "public"."mission_batches" as "MB"
("micro_task_id", "is_active", "created_at", "updated_at")
values
('7e1cc9e8-fc11-409b-865e-3bf08e6ca924', false, timestamp '2016-10-05 21:47:13.061', timestamp '2016-10-05 21:47:13.061') returning "MB"."id", "MB"."micro_task_id", "MB"."is_active", "MB"."created_at", "MB"."updated_at"
但我從DB
org.jooq.exception.DataAccessException: SQL [insert into "public"."mission_batches" as "MB" ("micro_task_id", "is_active", "created_at", "updated_at") values (?, ?, cast(? as timestamp), cast(? as timestamp)) returning "MB"."id", "MB"."micro_task_id", "MB"."is_active", "MB"."created_at", "MB"."updated_at"];
ERROR: syntax error at or near "as"
Position: 40
它正在與我的本地DB [9.5]收到錯誤。在測試服務器[9.4]上,它拋出了這個錯誤。我應該在哪裏尋找修復? Java端還是PG端?
因此,9.4中不支持插入別名?因爲此查詢運行正常 'select「U」。「id」,「U」。「username」,「E」。「email」from「公共「。」用戶「爲」U「加入」公共「。」電子郵件「爲」U「上的」E「。」id「=」E「。」user_id「其中」E「。」email「='abc @ xyz.com'' – theGamblerRises
@theGamblerRises是的,在選擇別名已經在那裏很長一段時間... – Roberto
哦,好的。然後,我會更改我的代碼,並確保所有設備上都有相同的版本。謝謝 – theGamblerRises