Cannot simply use PostgreSQL table name (“relation does not exist”)

后端 未结 11 2627
一向
一向 2020-11-22 05:35

I\'m trying to run the following PHP script to do a simple database query:

$db_host = \"localhost\";
$db_name = \"showfinder\";
$username = \"user\";
$passwo         


        
11条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 05:56

    You have to add the schema first e.g.

    SELECT * FROM place.user_place;
    

    If you don't want to add that in all queries then try this:

    SET search_path TO place;
    

    Now it will works:

    SELECT * FROM user_place;
    

提交回复
热议问题