Naming conventions - Mailing list pgsql-general

From Mark Walker
Subject Naming conventions
Date
Msg-id 45CFCAA1.8060605@omnicode.com
Whole thread Raw
List 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.


pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: getting postgres to emulate mysql/sqlserver bit datatype
Next
From: "Joshua D. Drake"
Date:
Subject: Re: "no value found for parameter 1" error for query with no parameters