简体   繁体   English

如何修复 psql ubuntu 中“psql”处或附近的语法错误

[英]How to fix syntax error at or near “psql” in psql ubuntu

I am entirely new to psql and not particularly familiar with some terms.我对 psql 完全陌生,对某些术语不是特别熟悉。 I am following instructions on an ETL process for mimic-in the link here: https://github.com/chichukw/mimic-omop/blob/master/README-run-etl.md .我在此处的链接中遵循有关模仿的 ETL 过程的说明: https://github.com/chichukw/mimic-omop/blob/master/README-run-etl.md When I run this code, it shows no output but this error:当我运行此代码时,它显示没有 output 但此错误:

syntax error at or near "psql" “psql”处或附近的语法错误

I have tried adding semicolon, removing the psql part and removing the quotes and dollar sign but I still get this syntax error on the first character regardless.我尝试添加分号,删除 psql 部分并删除引号和美元符号,但无论如何我仍然在第一个字符上收到此语法错误。 在此处输入图像描述

psql "$MIMIC" postgres_create_mimic_id.sql; 

I expect concept ids to be created after running this code on the server using the jupyter terminal.我希望在使用 jupyter 终端在服务器上运行此代码后创建概念 ID。

The only way I can think of how you could get that output/error is if you did this:我能想到如何获得该输出/错误的唯一方法是,如果您这样做:

[root@foo /]# psql
psql (11.5)
Type "help" for help.

postgres=# psql "$MIMIC" postgres_create_mimic_id.sql; 
ERROR:  syntax error at or near "psql"
LINE 1: psql "$MIMIC" postgres_create_mimic_id.sql;
        ^
postgres=# 

Instead, I think you should be doing this:相反,我认为你应该这样做:

[root@foo /]# export MIMIC='host=localhost dbname=postgres user=postgres options=--search_path=mimiciii'
[root@foo /]# psql "$MIMIC" -f postgres_create_mimic_id.sql;

Disclosure: I am an EnterpriseDB (EDB) employee披露:我是EnterpriseDB (EDB)员工

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM