In GaussDB, How Do I Configure a Search Path If A Statement Without Schema Name Fails To Be Executed?
You can execute the following command in GaussDB to see if the aa table exists.
create schema sch1;
create table sch1.aa(col int);
select * from aa;
If it does not exist, the actual error message is as follows: -ERROR: The table aa does not exist.
LINE 1: select * from aa;
^
SQL state: 42P01
Character: 15
This is because there is no sch1 in the search path.
Run following statement to add sch1 to the search path:
set search_path = "$user",public,sch1;
Run the SELECT statement.
select * from aa;
In this case, no error occurs.
To obtain the current search_path, run the following statement:
show search_path;
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot