Naming conventions

From: Mark Walker <furface(at)omnicode(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Naming conventions
Date: 2007-02-12 02:02:09
Message-ID: 45CFCAA1.8060605@omnicode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sorry if this may be a bit off topic. I'm curious what naming
conventions people use for column names. After trying quit a few
different conventions I've come to use differing cases and the
underscore to identify and delimit variables. A lot of it has to do
with sql and Postgresql reserved words, for instance "password" would be
"_password" for a column name. "Invoice Number" would be
"_invoiceNumber" Hmm, is sql case sensitive? I don't think so. It's
mainly for my own benefit as well as code generators I use.

Also, if I have to identify different modules within the same database
I'd use something like "accounting_invoiceNumber"

It's similar to a commonly used c++ convention for variable names. I
know it looks a little weird, but sql reserved words is a very real
problem that needs to be dealt with, and having strange spellings like
"dte" for "date" or an unnatural addition like "invoice_date" creates
confusion when coding for me. It's better to just have something like
"_date" which is unambiguous if you're using table "invoice" and column
"_date".

Just wondering what other approaches there are for this. Variable,
class, function naming, I think, is one of most important issues in
programming.

Thanks.

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2007-02-12 02:18:47 Re: "no value found for parameter 1" error for query with no parameters
Previous Message Joshua D. Drake 2007-02-12 00:35:36 Re: getting postgres to emulate mysql/sqlserver bit datatype