pgAdmin error - relation “[name of function/Views/Trigger Functions]” does not exist

前端 未结 2 1530
名媛妹妹
名媛妹妹 2021-01-06 10:35

I\'m just new to pgAdmin, so I don\'t really know what causes these errors:

ERROR:  relation \"ongoingprojects\" doe         


        
2条回答
  •  再見小時候
    2021-01-06 10:59

    Pay careful attention to the error message:

    ERROR: relation "ongoingprojects" does not exist
    

    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 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";
    

    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.

    Here is the link to the relevant part of the manual

提交回复
热议问题