From: | Scott Ribe <scott_ribe(at)elevated-dev(dot)com> |
---|---|
To: | pgsql-general General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: rationale behind quotes for camel case? |
Date: | 2011-06-28 21:02:09 |
Message-ID: | 988FBF56-8C36-491C-8183-E265918E9270@elevated-dev.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> On Tue, Jun 28, 2011 at 11:09:52AM -0500, dennis jenkins wrote:
>
>> Any suggestions on how to name tables when table names contain both
>> multi-word nouns and mutli-table "many-many" mappings?
>>
>> Example: Suppose that I have a table called "foo" and another table called
>> "barBiz" (or "bar_biz" if you prefer). Further, both of these tables have a
>> "serial" primary key. Now I want to create a third table that represents a
>> many-to-many relationship between "foo" and "barBiz". So far I have been
>> keeping compound-noun table names in camel case, but mapping tables separate
>> the base table names with underscores. Thus the table name would be
>> "foo_barBiz".
>>
>> However, I find the above distasteful, for many of the reasons that Merlin
>> and others have outlined. Yet naming the table "foo_bar_biz" seems
>> ambiguous to me, as does using just lower-case "foo_barbiz" / "barbiz".
>> These examples are contrived. The real table names are normal English words
>> with subjective meaning.
>>
>> I'd like in ask the pgsql community for suggestions on how they name tables.
Well, when I avoid camel case, then I use _ to separate words in a table name, and __ to separate table names.
Likewise with column names for foreign keys, __ between table and column name.
--
Scott Ribe
scott_ribe(at)elevated-dev(dot)com
http://www.elevated-dev.com/
(303) 722-0567 voice
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Smith | 2011-06-28 21:03:54 | Re: Multi-tenancy in Postgres |
Previous Message | Grace Batumbya | 2011-06-28 20:57:43 | Windows x64 : How do I get OSSP-UUID.sql contrib for postgresql x64 |