Who created a schema?

Moderator: NorbertKrupa

Post Reply
sarah
Intermediate
Intermediate
Posts: 77
Joined: Mon Aug 27, 2012 1:34 pm

Who created a schema?

Post by sarah » Tue Apr 22, 2014 3:35 pm

Hi,

Per viewtopic.php?f=3&t=1831 I now know when a schema was created, but how do I know who create it?
Have a GREAT day!

scutter
Master
Master
Posts: 302
Joined: Tue Aug 07, 2012 2:15 am

Re: Who created a schema?

Post by scutter » Tue Apr 22, 2014 4:06 pm

Hi Sarah,

You have the documentation? In the same SCHEMATA table:

Code: Select all

SCHEMA_OWNER  VARCHAR  Name of the owner who created the schema
—Sharon
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

sarah
Intermediate
Intermediate
Posts: 77
Joined: Mon Aug 27, 2012 1:34 pm

Re: Who created a schema?

Post by sarah » Tue Apr 22, 2014 4:32 pm

Ok, sorry. I was thinking if the schema owner was changed, how would I know who created it. But we can't change a schema owner, so I guess this is a none issue :oops:

Code: Select all

dbadmin=> create user sarah;
CREATE USER
dbadmin=> create schema sarah;
CREATE SCHEMA
dbadmin=> select schema_owner from schemata where schema_name = 'sarah';
 schema_owner 
--------------
 dbadmin
(1 row)
dbadmin=> alter schema sarah owner to sarah;
ERROR 2676:  Command ALTER SCHEMA is not supported
Have a GREAT day!

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Who created a schema?

Post by JimKnicely » Thu Apr 24, 2014 2:13 pm

SCHEMA_OWNER VARCHAR Name of the owner who created the schema
That's not technically true when the "AUTHORIZATION" option is used on the CREATE SCHEMA command :lol:

Code: Select all

dbadmin=> create user jim;
CREATE USER

dbadmin=> create schema cowboy authorization jim;
CREATE SCHEMA

dbadmin=> select schema_owner, create_time  from schemata where schema_name = 'cowboy';
 schema_owner |          create_time
--------------+-------------------------------
 jim          | 2014-04-24 09:05:46.588581-04
(1 row)
I created the cowboy schema as the user dbadmin, not the user jim.
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “Vertica Database Administration”