Thanks Michael for the fast reaction.

For sure, each database has its own set of reserved words, and there will
be commonalities across databases. Also the list of reserved words can
change over time with each new version of the database used.
And yet, hard coded the solution dictates a one-size-fits-all. Which
doesn't hold merit.
While many will opt for MySQL as the backend data store, some will make use
of the choice offered by the project (PostgreSQL, SQL Server, etc). And the
adopter should be able to customise the list of reserved words in
accordance with the requirements related to his choice, without having to
go through an implementation process of changes to the code.
IMO, it would be better if the list of reserved words were to be pulled
from the code and captures in a configuration file.

Best regards,

Pierre Smits

ORRTIZ.COM <http://www.orrtiz.com>
OFBiz based solutions & services


On Thu, Oct 7, 2021 at 5:40 PM Michael Brohl <michael.br...@ecomify.de>
wrote:

> Correcting myself: only DATABASE is a reserved name in MySQL, the other
> two are keywords.
>
> Michael Brohl
>
> ecomify GmbH - www.ecomify.de
>
>
> Am 07.10.21 um 17:28 schrieb Michael Brohl:
> > Hi Pierre,
> >
> > those words are reserved names in different databases, please check
> > yourself:
> >
> https://stackoverflow.com/questions/8339396/all-reserved-words-of-every-dbms#8341855
> >
> > To me, the list seems pretty sophisticated for a variety of databases.
> > It is not meant to be used only for a specific database.
> >
> > For MySQL, all three words are reserved.
> >
> > Regards,
> >
> > Michael Brohl
> >
> > ecomify GmbH - www.ecomify.de
> >
> >
> > Am 07.10.21 um 11:06 schrieb Pierre Smits:
> >> Hi all,
> >>
> >> While working on a solution that involves bringing existing tables
> >> from a
> >> postgresql database into the entity group and model definitions, I
> >> noticed
> >> that some of the column definitions were not acceptable by OFBiz and
> >> thus
> >> entities would not get created in the underlying OFBiz database.
> >>
> >> I found in ModelEntityChecker.java has a list of reserved words,
> >> including
> >> words like:
> >>
> >>     - password
> >>     - database
> >>     - type
> >>
> >> Many of the words listed there are not reserved according to [1]
> >>
> >> Does anyone know where these reserved words came from and when they got
> >> into the java file?
> >> It seems to me that a big brush was used to get to the list, and not
> >> much
> >> consideration was given to the context (variations in database
> >> applicability).
> >>
> >> What are your thoughts on correcting this?
> >>
> >>
> >> https://www.postgresql.org/docs/8.1/sql-keywords-appendix.html
> >>
> >> Best regards,
> >> Pierre Smits
> >>
> >> ORRTIZ.COM <http://www.orrtiz.com>
> >> OFBiz based solutions & services
> >>
>

Reply via email to