Reserved words

Answered

Dear Colleagues,

I am a newbie in SQL world and I am just getting accuanted with the database functionality in Intellij IDEA. I was informed that "there may be some reserved words in PostgreSQL dialect", for instance "name", and I should put them in double quatation marks (please, see the picture below):

However, when I remove them, IDEA does not identify an error, just change the word's color. I am not aware if the functionality changes when I do so:

Please, could you advise me if there are any words in Intellij IDEA (PostgreSQL dialect) that require special treatment, such as double quatation marks etc.

Thanks in advance for your help.

K.R. Alex

7 comments
Comment actions Permalink
Hi Alex,

Thank you for contacting us.

The system-reserved words are mostly related to the Postgres engine. See the reference here:

https://www.postgresql.org/docs/current/sql-keywords-appendix.html

DataGrip browses through the connected data source and returns its objects via a process called introspection.

Sure enough, you'd want to put a reserved name in quotes if it's already being used by another database object: function, procedure, column, etc.

Let me know if you have questions.
0
Comment actions Permalink

Dear Aleksandr,

Thanks for your feedback. I appreciate it.

Following your reply I browsed through the SQL Key words and discovered that the word "name" is marked as "non-reserved". Then why is it highlighted in the color which differs from the other column names (pls, see it below)?

1
Comment actions Permalink
Thanks for the update.

It seems to be an unexpected behavior, rather than considering the name word to be in the list of reserved words, thus highlighting it with a different color. I'll get back to you with details as soon as I have more information.
0
Comment actions Permalink
Hi Alex,

This is to inform you that we have reported your issue on youtrack:

https://youtrack.jetbrains.com/issue/DBE-16815

Just so you know, the difference in column color is a misbehavior that has nothing to do with any system-reserved words. Our developers will take care of it. You can monitor the issue progress by following the bug report we created. See also how to use the platform:

https://intellij-support.jetbrains.com/hc/en-us/articles/207241135
0
Comment actions Permalink

It is the same for MariaDB 10.4.17 column name 'description' which is not a reserved keyword as far as I know.

0
Comment actions Permalink

I am experiencing this same issue in PyCharm 2022.3.1 with both Oracle and Postgres. So far I've seen it happen with columns called "name", "column_name" and  "table_name" and a table called "location". 

0

Please sign in to leave a comment.