Search Postgresql Archives

Re: [offtopic] How do you name a table...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/8/2010 9:30 AM, Bill Moran wrote:
> In response to Ognjen Blagojevic<ognjen@xxxxxxxxxxxx>:
>    
>>
>> Is this:
>> a. Lookup table
>> b. Classifier
>> c. Cypher(er)?
>>
>> I'm looking for the appropriate term in English.
>>      
> I try to make it an ENUM when it's very unlikely to change, i.e. day of
> the week is a good candidate for an enum ... when's the last time that
> changed?
>
> For lookup tables that aren't static enough to be an enum, it usually
> ends up appended with _list (i.e. gender_list, county_list, etc)
>
>    
As  others have said enum for things that are static like day, week, 
month etc..
For things that are not static and change like system/application 
settings  i do something like this

CREATE TABLE syssettings
(
   sys_id serial primary key,
   sys_group text,
   sys_value text,
   sys_displayvalue text,
   sys_datatype text DEFAULT 'text'
)

This allows for easy grouping values together and assigning the data 
type for casting, along with how the information is to be displayed in 
the user interface.

example what the data looks like:  the below data is used to create 
<option> pull down list on a website.  So if the user of the application 
wants to add more options all they have is make an entry.

15;"ExamLevel";"1";"Level 1";"integer"
16;"ExamLevel";"2";"Level 2";"integer"
17;"ExamLevel";"3";"Level 3";"integer"
18;"QuestionOrder";"StandardList";"Standard not random";"text"
19;"QuestionOrder";"RandomList";"Random from List";"text"
20;"QuestionOrder";"Random";"Random From All Questions";"text"
21;"ExamType";"MPI";"MPI";"char(10)"
22;"ExamType";"RT";"RT";"char(10)"
23;"ExamType";"UT";"UT";"char(10)"
24;"ExamType";"ECT";"ECT";"char(10)"
25;"ExamType";"LPI";"LPI";"char(10)"



All legitimate Magwerks Corporation quotations are sent in a .PDF file attachment with a unique ID number generated by our proprietary quotation system. Quotations received via any other form of communication will not be honored.

CONFIDENTIALITY NOTICE: This e-mail, including attachments, may contain legally privileged, confidential or other information proprietary to Magwerks Corporation and is intended solely for the use of the individual to whom it addresses. If the reader of this e-mail is not the intended recipient or authorized agent, the reader is hereby notified that any unauthorized viewing, dissemination, distribution or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and destroy all occurrences of this e-mail immediately.
Thank you.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux