You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Thomas Fox (JIRA)" <ji...@apache.org> on 2012/05/14 06:05:57 UTC

[jira] [Created] (TORQUE-203) Quote table names in creation

Thomas Fox created TORQUE-203:
---------------------------------

             Summary: Quote table names in creation
                 Key: TORQUE-203
                 URL: https://issues.apache.org/jira/browse/TORQUE-203
             Project: Torque
          Issue Type: Improvement
            Reporter: Thomas Fox


For some databases, table names can be quoted in the sql create scripts to avoid collisions with predefined names. Where possible, such quotation should be used.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] [Commented] (TORQUE-203) Quote table names in creation

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291525#comment-13291525 ] 

Thomas Fox commented on TORQUE-203:
-----------------------------------

All databases we support in 4.0 support quoting.
But as always, different database vendors implement things different. E.g.
MySQL: create table `book` (id integer not null); 
  select * from `book`; ->OK
  select * fron book; ->OK
Oracle: create table "book" (id number not null); 
  select * from "book"; ->OK
  select * fron book; -> Table not found
So quoting is not a solution IMHO.
As a user I'd not accept defining a table book and then find the table name to be "book" (with double quotes, as in Oracle).
                
> Quote table names in creation
> -----------------------------
>
>                 Key: TORQUE-203
>                 URL: https://issues.apache.org/jira/browse/TORQUE-203
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>
> For some databases, table names can be quoted in the sql create scripts to avoid collisions with predefined names. Where possible, such quotation should be used.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] [Commented] (TORQUE-203) Quote table names in creation

Posted by "Thomas Vandahl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13274733#comment-13274733 ] 

Thomas Vandahl commented on TORQUE-203:
---------------------------------------

Maybe this issue should be generalized a bit. Is it actually doable to keep a list of reserved words for each supported DBMS? We regularly run into the problem that identifiers that are perfectly legal in MySQL cause Oracle to barf. I don't think that quoting is a good solution unless it is provided at all places in the generator and the runtime. As an alternative, the generator could issue a warning like "identifier is a reserved word for Oracle". WDYT?
                
> Quote table names in creation
> -----------------------------
>
>                 Key: TORQUE-203
>                 URL: https://issues.apache.org/jira/browse/TORQUE-203
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>
> For some databases, table names can be quoted in the sql create scripts to avoid collisions with predefined names. Where possible, such quotation should be used.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] [Commented] (TORQUE-203) Quote table names in creation

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294716#comment-13294716 ] 

Thomas Fox commented on TORQUE-203:
-----------------------------------

I do not see a solution for transporting the message that a word is reserved to the user. Unless someone can come up with an idea which will work in practice, I propose to not fix this issue.
                
> Quote table names in creation
> -----------------------------
>
>                 Key: TORQUE-203
>                 URL: https://issues.apache.org/jira/browse/TORQUE-203
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>
> For some databases, table names can be quoted in the sql create scripts to avoid collisions with predefined names. Where possible, such quotation should be used.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] [Comment Edited] (TORQUE-203) Quote table names in creation

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291525#comment-13291525 ] 

Thomas Fox edited comment on TORQUE-203 at 6/8/12 3:16 AM:
-----------------------------------------------------------

All databases we support in 4.0 support quoting.
But as always, different database vendors implement things different. E.g.
MySQL: create table `book` (id integer not null); 
  select * from `book`; ->OK
  select * from book; ->OK
Oracle: create table "book" (id number not null); 
  select * from "book"; ->OK
  select * from book; -> Table not found
So quoting is not a solution IMHO.
As a user I'd not accept defining a table book and then find the table name to be "book" (with double quotes, as in Oracle).
                
      was (Author: tfischer):
    All databases we support in 4.0 support quoting.
But as always, different database vendors implement things different. E.g.
MySQL: create table `book` (id integer not null); 
  select * from `book`; ->OK
  select * fron book; ->OK
Oracle: create table "book" (id number not null); 
  select * from "book"; ->OK
  select * from book; -> Table not found
So quoting is not a solution IMHO.
As a user I'd not accept defining a table book and then find the table name to be "book" (with double quotes, as in Oracle).
                  
> Quote table names in creation
> -----------------------------
>
>                 Key: TORQUE-203
>                 URL: https://issues.apache.org/jira/browse/TORQUE-203
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>
> For some databases, table names can be quoted in the sql create scripts to avoid collisions with predefined names. Where possible, such quotation should be used.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] [Commented] (TORQUE-203) Quote table names in creation

Posted by "Thomas Vandahl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291589#comment-13291589 ] 

Thomas Vandahl commented on TORQUE-203:
---------------------------------------

As a starting point, this is of course acceptable. Nevertheless, there are reserved words specific to a certain DBMS. See http://www.csee.umbc.edu/portal/help/oracle8/server.815/a42525/apb.htm for the Oracle-flavor. Example: COMMENT is a reserved word in Oracle but not in the Postgres table. Let's try to collect the lists for the supported DBMSs and look for a reasonable set.
                
> Quote table names in creation
> -----------------------------
>
>                 Key: TORQUE-203
>                 URL: https://issues.apache.org/jira/browse/TORQUE-203
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>
> For some databases, table names can be quoted in the sql create scripts to avoid collisions with predefined names. Where possible, such quotation should be used.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] [Commented] (TORQUE-203) Quote table names in creation

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291530#comment-13291530 ] 

Thomas Fox commented on TORQUE-203:
-----------------------------------

As to printing a warning for reserved words: who reads such warnings hidden in the output of, e.g., a maven build ? I'd guess in 95 % of all cases such warnings are not read and therefore not worth the trouble.
Alternatively, there is already a "strict" schema which tries to forbid (some) things which are not portable across databases.
We could forbid all SQL reserved words as table or column names in the strict schema. 
Do you think this would be an acceptable solution ?
(There is a good listof reserved words e.g. at http://www.postgresql.org/docs/9.1/static/sql-keywords-appendix.html)
                
> Quote table names in creation
> -----------------------------
>
>                 Key: TORQUE-203
>                 URL: https://issues.apache.org/jira/browse/TORQUE-203
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>
> For some databases, table names can be quoted in the sql create scripts to avoid collisions with predefined names. Where possible, such quotation should be used.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] [Comment Edited] (TORQUE-203) Quote table names in creation

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291525#comment-13291525 ] 

Thomas Fox edited comment on TORQUE-203 at 6/8/12 3:16 AM:
-----------------------------------------------------------

All databases we support in 4.0 support quoting.
But as always, different database vendors implement things different. E.g.
MySQL: create table `book` (id integer not null); 
  select * from `book`; ->OK
  select * fron book; ->OK
Oracle: create table "book" (id number not null); 
  select * from "book"; ->OK
  select * from book; -> Table not found
So quoting is not a solution IMHO.
As a user I'd not accept defining a table book and then find the table name to be "book" (with double quotes, as in Oracle).
                
      was (Author: tfischer):
    All databases we support in 4.0 support quoting.
But as always, different database vendors implement things different. E.g.
MySQL: create table `book` (id integer not null); 
  select * from `book`; ->OK
  select * fron book; ->OK
Oracle: create table "book" (id number not null); 
  select * from "book"; ->OK
  select * fron book; -> Table not found
So quoting is not a solution IMHO.
As a user I'd not accept defining a table book and then find the table name to be "book" (with double quotes, as in Oracle).
                  
> Quote table names in creation
> -----------------------------
>
>                 Key: TORQUE-203
>                 URL: https://issues.apache.org/jira/browse/TORQUE-203
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>
> For some databases, table names can be quoted in the sql create scripts to avoid collisions with predefined names. Where possible, such quotation should be used.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] [Commented] (TORQUE-203) Quote table names in creation

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13292509#comment-13292509 ] 

Thomas Fox commented on TORQUE-203:
-----------------------------------

My idea was to take all the words in the list as reserved ... Who knows what features will be built in tomorrow by database vendors ?
I do not feel up to the task to compare the list of reserved words for all database vendors we support. It is a huge list and building and maintaining it will take considerable effort.
                
> Quote table names in creation
> -----------------------------
>
>                 Key: TORQUE-203
>                 URL: https://issues.apache.org/jira/browse/TORQUE-203
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>
> For some databases, table names can be quoted in the sql create scripts to avoid collisions with predefined names. Where possible, such quotation should be used.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] [Commented] (TORQUE-203) Quote table names in creation

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294714#comment-13294714 ] 

Thomas Fox commented on TORQUE-203:
-----------------------------------

Forbidding words in the strict schema is not a workable solution, because the pattern involved would be far to complex and thus neither readable nor maintainable.
See http://stackoverflow.com/questions/812790/restrict-word-list-in-xml-schema
                
> Quote table names in creation
> -----------------------------
>
>                 Key: TORQUE-203
>                 URL: https://issues.apache.org/jira/browse/TORQUE-203
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>
> For some databases, table names can be quoted in the sql create scripts to avoid collisions with predefined names. Where possible, such quotation should be used.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org