Howdy,
Anyone know if we can set the search path of a user as a parameter setting of some sort when running a sql statement via vsql command line?
vql -u user_name -w user_password -c "select count(*) from table;"
I want to run the above command sometimes with a different search path for the user user_name...
Set search path for vsql on the command line
Moderator: NorbertKrupa
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: Set search path for vsql on the command line
Hi Beth,
You can include the SET SEARCH_PATH command in your vsql command...
Example:
You can include the SET SEARCH_PATH command in your vsql command...
Example:
Code: Select all
[dbadmin@rivers-vertica-1 ~]$ vsql -c "set search_path=sales,sales_stg;show search_path"
name | setting
-------------+---------------------------------------------------
search_path | sales, sales_stg, v_catalog, v_monitor, v_internal
(1 row)
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.