Re: Using a preprocessor for constants in SQL

Поиск
Список
Период
Сортировка
От Frank Bax
Тема Re: Using a preprocessor for constants in SQL
Дата
Msg-id 5.2.1.1.0.20050204084612.04090d90@pop6.sympatico.ca
обсуждение исходный текст
Ответ на Using a preprocessor for constants in SQL  (Arthur van Dorp <arthur_vd@gmx.net>)
Ответы Re: Using a preprocessor for constants in SQL  (Arthur van Dorp <arthur_vd@gmx.net>)
Список pgsql-novice
At 08:30 AM 2/4/05, Arthur van Dorp wrote:
>When defining records with varchar entries (and at some other places)
>something like constants would be useful. They could look something like this:
>
>DEFINE short = 20;
>DEFINE long = 2000;
>
>CREATE TABLE example (
>short_string varchar (short),
>long_string varchar (long),
>long_string2 varchar (long)
>);
>[...]
>CREATE TABLE example200 (
>short_name varchar (short),
>long_name varchar (long)
>);
>
>Like this you could easily change values between test setup and final
>deployment. Is there anything like this or is there some elegant way to
>achieve this? Or do you all use some sort of preprocessors?


If you change the length of fields between testing and production, it would
invalidate your boundary testing!  What if there is a bug in your code that
presents itself when a field is 200 characters, but not when it is 50
characters long?  There is no difference in disk usage with the example you
gave, so I can see no reason to have different lengths for varchar fields
between test and prod environments.

Frank


В списке pgsql-novice по дате отправления:

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Storing latitude and longitude
Следующее
От: Arthur van Dorp
Дата:
Сообщение: Re: Using a preprocessor for constants in SQL