You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hawq.apache.org by Wenbin Lu <lu...@gmail.com> on 2017/06/11 10:39:54 UTC
HAWQ psql does not change the current session search_path
Hi all,
I create some schema using "create schema testschema1".
I set the search_path for db1 to the new schema using "alter database db1
set search_path to testschema1".
The current session does not have the latest schema when I use "select
current_schema()", still shows "public". Only when I log out and login
again, the "select current_schema() shows the correct schema, which is
"testschema1".
When I delete the schema and use "alter database db1 set search_path to
public", this also doesn't work and the later table creation will fail.
Do I miss something to refresh the HAWQ setting after I change the
search_path for the current database? If there is, how to do it?
Or is it a bug?
Thanks!
Regards,
Lu Wenbin
Re: HAWQ psql does not change the current session search_path
Posted by Hongxu Ma <in...@outlook.com>.
Hi Wenbin
It's not a bug.
Since HAWQ uses postgres as the frontend, its behavior is similar to postgres, you can refer here:
https://dba.stackexchange.com/questions/22301/postgresql-schemas-and-search-path
In brief:
"alter database db1 set search_path = xxx" only take effects for new sessions.
You should use "set search_path = xxx" if you want to take effect in current session.
在 11/06/2017 18:39, Wenbin Lu 写道:
Hi all,
I create some schema using "create schema testschema1".
I set the search_path for db1 to the new schema using "alter database db1 set search_path to testschema1".
The current session does not have the latest schema when I use "select current_schema()", still shows "public". Only when I log out and login again, the "select current_schema() shows the correct schema, which is "testschema1".
When I delete the schema and use "alter database db1 set search_path to public", this also doesn't work and the later table creation will fail.
Do I miss something to refresh the HAWQ setting after I change the search_path for the current database? If there is, how to do it?
Or is it a bug?
Thanks!
Regards,
Lu Wenbin
--
Regards,
Hongxu.