Skip to main content

Rename table not owner

  • January 22, 2018
  • 2 replies
  • 12 views

sergey_h
Forum|alt.badge.img+1

Hi,
I can't rename table, if I not owner, why?

I see doc:
https://my.vertica.com/docs/9.0.x/HTML/index.htm#Authoring/SQLReferenceManual/Statements/ALTERTABLE.htm

Renaming a table requires USAGE and CREATE privilege on the table schema.

My user test

ga=> \dt test1
               List of tables
 Schema | Name  | Kind  |  Owner  | Comment 
--------+-------+-------+---------+---------
 openx  | test1 | table | dbadmin | 
(1 row)

\dp openx
                                       Access privileges for database "ga"
    Grantee     | Grantor |                             Privileges                              | Schema | Name  
----------------+---------+---------------------------------------------------------------------+--------+-------
 test | dbadmin | INSERT, SELECT, UPDATE, DELETE, REFERENCES, USAGE, CREATE, TRUNCATE |        | openx

ALTER TABLE openx.test1 rename to test2;
ROLLBACK 3989:  Must be owner of relation test1

2 replies

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • January 22, 2018

Hi,

I just reproduced your issue in Vertica 9.0.1. I opened a Jira ticket and will keep you updated on its progress. Note that this might be a documentation error.

Thanks for reporting this!


Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • January 23, 2018

@sergey_h - The documentation is incorrect when it says:

  • “Renaming a table requires USAGE and CREATE privileges on the schema that contains it”
  • “Renaming a table requires USAGE and CREATE privilege on the table schema.”

A user must OWN the table in order to rename it! The documentation will be updated ASAP to reflect this requirement.

Thanks again for pointing out this discrepancy.