错误:“;”或附近的语法错误在CREATE TABLE

时间:2018-09-11 09:44:29

标签: sql postgresql ddl

我学习Postgresql。我刚刚在Ubuntu上安装了PG,以“ postgres”用户身份签出并运行psql命令行。但是当我尝试执行SHOW,CREATE等命令时,我得到:

  

错误:“;”或附近的语法错误

postgres@comp:/etc/postgresql/10/main$ psql
psql (10.5 (Ubuntu 10.5-1.pgdg18.04+1))
Type "help" for help.

postgres=# \c
You are now connected to database "postgres" as user "postgres".
postgres=# CREATE TABLE TEST1
postgres-# ;
ERROR:  syntax error at or near ";"
LINE 2: ;
        ^
postgres=# CREATE TABLE TEST1;
ERROR:  syntax error at or near ";"
LINE 1: CREATE TABLE TEST1;
                          ^
postgres=# CREATE TABLE 'TEST1';
ERROR:  syntax error at or near "'TEST1'"
LINE 1: CREATE TABLE 'TEST1';
                     ^
postgres=# 

我试图在Stackoverflow上找到相同的问题,但没有结果。我做错了什么?

0 个答案:

没有答案