Re: newbie table design question - Mailing list pgsql-general

From Merlin Moncure
Subject Re: newbie table design question
Date
Msg-id b42b73150906020636g113b5f48s30a7b9d06b548288@mail.gmail.com
Whole thread Raw
In response to Re: newbie table design question  (Andrew Smith <laconical@gmail.com>)
List pgsql-general
2009/6/1 Andrew Smith <laconical@gmail.com>:
> 2009/6/2 björn lundin <b.f.lundin@gmail.com>
>>
>> > CREATE TABLE "DataImport"
>> > (
>> >   "DataImportID" serial NOT NULL PRIMARY KEY,
>> >   "Time" timestamp without time zone NOT NULL,
>> >   "ID_ABC" integer NOT NULL,
>> >   "ID_DEF" integer NOT NULL,
>> >   "ID_HIJ" integer NOT NULL,
>> >   etc
>> > );
>>
>> Perhaps you want to not use the "" around the table and column names.
>> It makes them case sensitive
>
> Yes, that's exactly why I've got them there. I can't stand lowercase field
> names in tables.

well, beauty is in the eye of the beholder and all that, but I'd
advise rethinking your style.  On technical grounds I'd argue that you
may run into 3rd party software that is not aware of postgresql case
folding conventions that could lead to trouble.

On style grounds I'd argue that forcing all your field names to be
explicitly cases is basically crazy.  It's problematic for some client
languages requiring extra escaping when you otherwise wouldn't need
it.  Style and conventions are supposed to make things easier for the
programmer, not harder.  I'd also advise moving 'ID' and all other
name clarifying names from the prefix to the suffix.  Good for you
though and spelling out DataImportID and not using 'ID' which is
problematic for other reasons.

merlin

pgsql-general by date:

Previous
From: Grzegorz Jaśkiewicz
Date:
Subject: Re: newbie table design question
Next
From: Tom Lane
Date:
Subject: Re: How can I manually alter the statistics for a column?