pgAdmin错误-关系"[[函数名称/视图/触发函数]""不存在 [英] pgAdmin error - relation "[name of function/Views/Trigger Functions]" does not exist
问题描述
我只是pgAdmin的新手,所以我真的不知道是什么原因导致了这些错误:
I'm just new to pgAdmin, so I don't really know what causes these errors:
ERROR: relation "ongoingprojects" does not exist
LINE 1: SELECT * FROM ongoingProjects;
^
********** Error **********
ERROR: relation "ongoingprojects" does not exist
SQL state: 42P01
Character: 15
即使功能/视图存在于架构中.为什么会出现该错误?我该怎么做才能解决它?
Even if the function/view exists in the schema. Why does it give that error? And what should I do to fix it?
推荐答案
请特别注意错误消息:
ERROR: relation "ongoingprojects" does not exist
请注意,当您的SQL谈论ongoingProjects
时,它会抱怨ongoingprojects
.您可能使用以下内容创建了表:
Note that it is complaining about ongoingprojects
when your SQL talks about ongoingProjects
. You probably created the table with something like:
create table "ongoingProjects" ( ...
PostgreSQL将所有标识符(表名,列名...)折叠成小写,除非使用双引号.将表创建为"ongoingProjects"
后,您必须在所有位置都用双引号将该名称括起来并完全匹配这种情况:
PostgreSQL folds all identifiers (table names, column names, ...) to lower case unless they are double quoted. Once you've created the table as "ongoingProjects"
, you'll have to double quote the name everywhere and exactly match that case:
select * from "ongoingProjects";
PostgreSQL的通常做法是创建带有小写的未加引号的名称的表,并用下划线将单词分隔开:
The usual practice with PostgreSQL is to create tables with unquoted names in lower case with word separated using underscores:
create table ongoing_projects ( ...
这样您就不必担心报价了.
so that you don't have worry about quoting.
这篇关于pgAdmin错误-关系"[[函数名称/视图/触发函数]""不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!