cancel
Showing results for 
Search instead for 
Did you mean: 

Rename a user

BudDurland
Participant
1,324

Using SQL Anywhere 17, is there really still no way to easily rename a user? Deleting and re-creating the user seems a bit clunky.

Accepted Solutions (1)

Accepted Solutions (1)

Breck_Carter
Participant

That's right, the inability to rename a user has been baked into SQL Anywhere since the beginning of time.

But wait, it gets worse: Dropping a user drops all the objects owned by that user... "a bit clunky" is too kind 🙂

It's a clear violation of The Watcom Rule ("Watcom does things the way they should be done") but it's unlikely to be changed any time soon.

There is a kludgy workaround: Create a new user with the new name. Remove the password from the user with the old name so it can't be used to connect. If necessary GRANT GROUP to the old user, and make the new user a member of that group so it can "see" all the objects still owned by the old user. Grant other privileges as necessary, so the new user can do all the same stuff as the old user. This is fraught with errors, but the errors involve ease of use rather than loss of data.

In some setups this is not too difficult, since ordinary users don't own anything.

Vlad
Product and Topic Expert
Product and Topic Expert
VolkerBarth
Contributor
0 Kudos

Note that v16 introduced to facility to change the owner of tables, which was not valid at the time of that old discussion...

Vlad
Product and Topic Expert
Product and Topic Expert
0 Kudos

ah, ok. I thought this link might be helpful because of the discussion from there.

VolkerBarth
Contributor
0 Kudos

I think so, too 🙂

Breck_Carter
Participant

> change the owner of tables

IMO that eliminates most use cases for "rename user".

BudDurland
Participant
0 Kudos

I saw the old thread, but took away that is was more about changing table owners than renaming users. And I was hoping in v17 something had changed.

One of Breck's comments in that thread hit close to home for me: "If someone wants to **** around with "schemas" they should switch over to Oracle or some other offense against nature". We (as in the PTB, not me) are looking to move to a different ERP system, which has Oracle on the backend, so I started poking around to learn about it. Eek.

Answers (0)