I want to create user from another user on hp vertica.
How can I create user from another user with data?
I think this is a "user provisioning" question. There's no command CREATE USER x LIKE y...
but you can easily automate this process using roles and a script going through the following steps:
CREATE USER newuser IDENTIFIED BY 'passwd' ... ;
GRANT myrole TO newuser ;
ALTER USER newuser DEFAULT ROLE myrole ... ;
See below procedure assumes you want to replicate dbadmin user into dbadmin_tmp (data will be share between both users , in vertica data manage by schema's )
SELECT 'CREATE USER '||user_name||'_tmp ACCOUNT '||CASE
WHEN is_locked=FALSE THEN 'UNLOCK'
ELSE 'LOCK'
END ||' IDENTIFIED BY ''password'' MEMORYCAP '||
CASE
WHEN memory_cap_kb='unlimited' THEN 'NONE'
ELSE ''||memory_cap_kb||''
END ||' PROFILE '||profile_name||' RESOURCE POOL '||resource_pool||' RUNTIMECAP '||
CASE
WHEN run_time_cap='unlimited' THEN 'NONE'
ELSE ''||run_time_cap||''
END ||' TEMPSPACECAP '||CASE
WHEN temp_space_cap_kb='unlimited' THEN 'NONE'
ELSE ''||temp_space_cap_kb||''
END ||CASE
WHEN search_path ILIKE '' THEN ''
ELSE ' SEARCH_PATH '||search_path
END
FROM users
WHERE user_name='dbadmin'