Re: [HACKERS] Query in SQL statement

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Roger Hand <RHand(at)kailea(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, "R, Rajesh (STSD)" <rajesh(dot)r2(at)hp(dot)com>, pgsql-hackers(at)postgresql(dot)org, pgsql-performance(at)postgresql(dot)org
Subject: Re: [HACKERS] Query in SQL statement
Date: 2005-10-04 20:43:43
Message-ID: 20051004204343.GW40138@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

On Sat, Oct 01, 2005 at 12:51:08PM -0700, Roger Hand wrote:
> > -----Original Message-----
> > From: pgsql-performance-owner(at)postgresql(dot)org
> > [mailto:pgsql-performance-owner(at)postgresql(dot)org]On Behalf Of Jim C. Nasby
> > Sent: Friday, September 30, 2005 4:49 PM
> > Subject: Re: [PERFORM] [HACKERS] Query in SQL statement
>
> > I suggest ditching the CamelCase and going with underline_seperators.
> > I'd also not use the bareword id, instead using bad_user_id. And I'd
> > name the table bad_user. But that's just me. :)
>
> I converted a db from MS SQL, where tables and fields were CamelCase, and
> just lowercased the ddl to create the tables.
>
> So table and fields names were all created in lowercase, but I didn't have to change
> any of the application code: the SELECT statements worked fine with mixed case.
>
> -- sample DDL
> CREATE TABLE testtable
> (
> fieldone int4
> )
> insert into TestTable (fieldone) values (11);

That will usually work (see Tom's reply), but fieldone is a heck of a
lot harder to read than field_one. But like I said, this is the coding
conventions I've found work well; YMMV.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-10-04 20:54:17 Re: Inherited indexes.
Previous Message Jim C. Nasby 2005-10-04 17:06:15 Re: Inherited indexes.

Browse pgsql-performance by date

  From Date Subject
Next Message Jim C. Nasby 2005-10-04 20:52:25 Re: SQL Function performance
Previous Message Jim C. Nasby 2005-10-04 20:41:22 Re: Comparative performance