The forum will be down for maintenance at some point between Friday, September 25, 2020 at 5pm PDT and Sunday, September 27, 2020 at 11:59 PDT. Downtime is unknown but will be minimized.

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.

asked 07 Sep, 10:21

Bud%20Durland%20MRP's gravatar image

Bud Durland MRP
1715715
accept rate: 50%


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.

permanent link

answered 07 Sep, 10:56

Breck%20Carter's gravatar image

Breck Carter
30.8k496680992
accept rate: 20%

edited 07 Sep, 10:57

Replies hidden

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

(07 Sep, 15:24) Volker Barth

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

(08 Sep, 02:46) Vlad

I think so, too :)

(08 Sep, 05:41) Volker Barth
2

> change the owner of tables

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

(08 Sep, 10:26) Breck Carter

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.

(09 Sep, 08:21) Bud Durland MRP
showing 2 of 6 show all flat view
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×120
×22

question asked: 07 Sep, 10:21

question was seen: 86 times

last updated: 09 Sep, 08:21