Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change column names to avoid using reserved words #23

Open
smclay opened this issue Feb 11, 2020 · 1 comment
Open

Change column names to avoid using reserved words #23

smclay opened this issue Feb 11, 2020 · 1 comment

Comments

@smclay
Copy link
Contributor

smclay commented Feb 11, 2020

In Oracle "comment" is a reserved word, "archive" is a keyword and "type" is a "PL/SQL" reserved word (see https://docs.oracle.com/database/121/ZZPRE/appb.htm#ZZPRE959). Could we change the names of the following table columns ngas_subscr_queue.comment, ngas_disks.archive and ngas_disks.type in a future release?

@rtobar
Copy link
Contributor

rtobar commented Feb 18, 2020

Yes, there are, and there have been in the past, such conflicts with keywords (the one I'm aware of is "ignore", I think it's a keyword in MySQL). Probably changing the names in the schema and then in the code is fairly easy, but if one wants to ensure backwards compatibility (e.g., if you want to rollback to an old NGAS version, or use old/new versions concurrently) this might considerably harder.

One alternative would be to do something similar to what we did with the ignore v/s file_ignore column name in ngas_files, where the code is flexible to use either based on a configuration value (so it's up to users which one to use). A different alternative would be to move slowly towards keyword-"safe" column names, with one release of NGAS adding the new columns and writing data to both new and old (again, to ensure backwards-compatibility), then at a later release removing the old column and sticking with the new one.

A third alternative (what we are doing) is enclosing "comment" in double-quotes, which seems to work in all engines, but is of course more tedious for those having to write queries by hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants