Table and Field namestyle best practices?

From: novnov <novnovice(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Table and Field namestyle best practices?
Date: 2006-11-08 17:49:21
Message-ID: 7243332.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I'm new to pgsql, mostly coming from MSSQL. It sounds like it's simplest to
keep field names lowercase with pgsql, so I will have to change some habits
I've developed over the years. I would like to glean whatever collective
wisdom I can here from experienced pgsql devs.

I've been using namestyles with mixed case like OrgID. That is much more
readable than orgid. Probably a good convention to adopt would be to use
namestyles like org_id. That change I can live with.

But another issue is the way that I've been naming foreign key references. I
tend to prefix field names with a table based acronym. So names like
OrgName, OrgCity. Foreign key fields incorporate the ref'd pk. So, if I have
a table tblEmployee, fk to the org table would be like EmpOrgID. I know many
would simply use OrgID as the fk in tblEmployee, but I have liked
compounding the names because is results in completely unambiguous field
names throughout the db. If I'm giving up the mixed case naming, I could use
emp_fname, emp_lname, emp_org_id, but I'm not sure if that's best.

I am very curious to hear the various conventions folks here have arrived
at. I don't expect there to be consensus, but the various rationales might
help me arrive at an approach that works well for me.
--
View this message in context: http://www.nabble.com/Table-and-Field-namestyle-best-practices--tf2596761.html#a7243332
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma Jr 2006-11-08 18:18:36 Re: Table and Field namestyle best practices?
Previous Message Ed L. 2006-11-08 17:18:02 8.1.2 postmaster died