Postgresql - 使用 LIKE 创建表语法错误 -
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4874607/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Postgresql - CREATE TABLE SYNTAX ERROR USING LIKE -
提问by jzafrilla
I'm trying to create a temp table from a parent table:
我正在尝试从父表创建临时表:
This is the code that I execute with pgAdmin III (or by JDBC in Java):
这是我使用 pgAdmin III(或 Java 中的 JDBC)执行的代码:
CREATE TEMP TABLE table1_tmp LIKE table1 INCLUDING DEFAULTS;
And the error I received is:
我收到的错误是:
[WARNING ] CREATE TEMP TABLE table1_tmp LIKE table1 INCLUDING DEFAULTS
ERROR: syntax error at or near ?LIKE?
LíNEA 1: CREATE TEMP TABLE table1_tmp LIKE table1 INCLUDING DEFAULTS
^
Reading postgresql 8.4 documentation, create tables using this, its very easy, but I don't understand where is the syntax problem.
阅读 postgresql 8.4 文档,使用它创建表,非常简单,但我不明白语法问题在哪里。