List:General Discussion« Previous MessageNext Message »
From:João Cândido de Souza Neto Date:February 24 2011 12:30pm
Subject:Re: I can't have "group" as a column name in a table?
View as plain text  
LOL

-- 

"Johan De Meersman" <vegivamp@stripped> escreveu na mensagem 
news:AANLkTikPeVuTpj9E0iepFncCJZQOF6sn_dbrhp0=pTDF@ style="color:#666">stripped...
> On Thu, Feb 24, 2011 at 12:06 PM, Dave M G <dave@stripped> wrote:
>
>> Should I never use the word "group" for column names? Seems a little
>> silly. Is there a way to protect column names to that there is no
>> confusion?
>>
>
> As several people already pointed out, simply use backticks. Simple quotes
> have started to work in more and more places in newer versions of MySQL.
>
> However, it is considered bad form to name columns for reserved words - 
> even
> ones as obvious as "group" or "index". Bad form in the same way that you
> wouldn't name any variables "define" or "if" while programming; or in a 
> very
> similar way that you wouldn't put a box of TNT next to a burning candle -
> it's an accident waiting to happen.
>
> The escapes are there in case an upgrade creates new reserved words that
> you've already used in column names - "partition" comes to mind - but if 
> you
> are still in a phase where you can avoid using reserved words, please 
> spare
> yourself and others a lot of trouble and do so; even if only because while
> you can fix your code, you can't fix someone else's - think management
> tools, backup scripts, whatever may touch the db in the future.
>
>
> -- 
> Bier met grenadyn
> Is als mosterd by den wyn
> Sy die't drinkt, is eene kwezel
> Hy die't drinkt, is ras een ezel
> 


Thread
I can't have "group" as a column name in a table?Dave M G24 Feb
  • Re: I can't have "group" as a column name in a table?Aveek Misra24 Feb
    • Re: I can't have "group" as a column name in a table?Simcha Younger24 Feb
    • Re: I can't have "group" as a column name in a table?mos24 Feb
    • Re: I can't have "group" as a column name in a table? [SOLVED]Dave M G25 Feb
  • Re: I can't have "group" as a column name in a table?joao24 Feb
  • Re: I can't have "group" as a column name in a table?Johan De Meersman24 Feb
  • Re: I can't have "group" as a column name in a table?joao24 Feb
  • Re: I can't have "group" as a column name in a table?joao24 Feb