postgresql postgres - 从现有表中选择 * - psql 表示表不存在
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28240352/
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
postgres - select * from existing table - psql says table does not exist
提问by Ferenjito
Fresh postgres installation, db 'test', table 'Graeber' created from another program.
全新的 postgres 安装、db 'test'、从另一个程序创建的表 'Graeber'。
I want to see the content of table 'Graeber'. When I connect to the database and try to select the content of 'Graeber', the application tells me : ERROR: relation "graeber" does not exist
.
我想查看“Graeber”表的内容。当我连接到数据库并尝试选择“Graeber”的内容时,应用程序告诉我:ERROR: relation "graeber" does not exist
。
See screenshot:
看截图:
What is wrong here?
这里有什么问题?
回答by Walker Farrow
Try adding the schema as in:
尝试添加架构,如下所示:
select *
from public.Graeber
If that doesn't work, then it is because you have a capital letter so try:
如果这不起作用,那是因为你有一个大写字母,所以尝试:
select *
from public."Graeber"
Hope this helps.
希望这可以帮助。
回答by Usman Yaqoob
See This Example.
请参阅此示例。
queuerecords=# create table employee(id int,name varchar(100));
CREATE TABLE
queuerecords=# insert into employee values(1,'UsmanYaqoob');
INSERT 0 1
queuerecords=# select * from employee;
id | name
----+-------------
1 | UsmanYaqoob
(1 row)