Re: design question - newbie
От | Richard Huxton |
---|---|
Тема | Re: design question - newbie |
Дата | |
Msg-id | 200208070924.12868.dev@archonet.com обсуждение исходный текст |
Ответ на | design question - newbie (rob@benefitscheckup.org) |
Список | pgsql-general |
On Friday 02 Aug 2002 8:59 pm, rob@benefitscheckup.org wrote: > Obviously the problem with storing the results in this manner is that > there is no way to check the integrity of 'response' field. I would > have to store them all as strings. So if something messed up I could > easily have a situation where it looked like a user had seen Batman true > times or enjoyed the '15' batman movies. This seems very very bad. > > What am I missing? Well - you're going to want to check things in your application anyway. You could have seen batman -3.12 times, a valid number but not a valid answer. After that, you could: 1. Define a new type that takes something like ('number','1') and checks that '1' is a number. 2. Define a function to parse and check the supplied string for the right format 3. Have multiple response fields: response_int, response_bool, response_text etc. and try to put the value into the expected slot. Since you say you're a newbie I'd probably check it all in the application - easier. - Richard Huxton
В списке pgsql-general по дате отправления: