Re: Table and Field namestyle best practices?

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


Yes, I've already pretty much decided to use lowercase for all namestyles, I
mentioned that in the first post. Using lowercase invokes a set of other
issues, which I'm asking for options on...namely, conventions like org_id,
and emp_org_id, or simply using org_id as the fk pointer.

Richard Broersma Jr wrote:
>
>> 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.
>
> According to recommended practice you have a choice to make. Here is what
> is described from the following link:
> http://www.postgresql.org/docs/8.1/interactive/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS
>
> Quoting an identifier also makes it case-sensitive, whereas unquoted names
> are always folded to
> lower case. For example, the identifiers FOO, foo, and "foo" are
> considered the same by
> PostgreSQL, but "Foo" and "FOO" are different from these three and each
> other. (The folding of
> unquoted names to lower case in PostgreSQL is incompatible with the SQL
> standard, which says that
> unquoted names should be folded to upper case. Thus, foo should be
> equivalent to "FOO" not "foo"
> according to the standard. If you want to write portable applications you
> are advised to always
> quote a particular name or never quote it.)
>
> Make note of the last sentence.
>
> Regards,
>
> Richard Broersma Jr.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>
>

--
View this message in context: http://www.nabble.com/Table-and-Field-namestyle-best-practices--tf2596761.html#a7244110
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Staubo 2006-11-08 18:37:32 Re: Table and Field namestyle best practices?
Previous Message Richard Broersma Jr 2006-11-08 18:18:36 Re: Table and Field namestyle best practices?