[Pulp-dev] 'id' versus 'pulp_id' on Content

Jeff Ortel jortel at redhat.com
Tue May 29 16:46:25 UTC 2018

On 05/29/2018 08:24 AM, Brian Bouterse wrote:
> On Fri, May 25, 2018 at 7:39 PM, Dana Walker <dawalker at redhat.com 
> <mailto:dawalker at redhat.com>> wrote:
>     I'm basically -1 for the reasons Jeff enumerated but if he is ok
>     with this, I'm happy to go ahead with it.
>         [Jeff]:
>         In classic relational modeling, using ID as the primary key is
>         common practice.  Especially when ORMs are involved.  The "id"
>         added by plugin writers is a natural key so naming it ID goes
>         against convention.
>     This is echoed here, for further reading (though perhaps this
>     article is overly simplified for our needs) in the sections "Key
>     Fields" and "Prefixes and Suffixes (are bad)":
>     https://launchbylunch.com/posts/2014/Feb/16/sql-naming-conventions/
>     <https://launchbylunch.com/posts/2014/Feb/16/sql-naming-conventions/>
> That is true, but this article also talks about avoiding reserved 
> words as well. I think we're hearing 'id' is a commonly reserved word 
> for content types being modeled by plugin writers.

The article[1] you mentioned states that 'ID' /should/ be used for the 
PK which means it is inappropriate for natural key fields defined by 
plugin writers.  The reserved words caution in the article are DDL/DML 
reserved words "Ex: Avoid using words like |user|, |lock|, or |table|." 
not reserved by plugins.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-dev/attachments/20180529/87d8d7d9/attachment.htm>

More information about the Pulp-dev mailing list