populating arrays with default values

Поиск
Список
Период
Сортировка
От G. J. Walsh
Тема populating arrays with default values
Дата
Msg-id 1195070977.17701.20.camel@www.dscdirectionalservices.com
обсуждение исходный текст
Ответы Re: populating arrays with default values  (Kenneth Porter <shiva@sewingwitch.com>)
Список pgsql-novice
I come from a long background with C and isam. Moving into php and
postgresql is therefore not all that strange, but I suffer with the
comparative lack of structure at times.

I deal with a lot of psych scoring and am establishing tables which will
contain the response patterns for each individual test within a battery.
In defining this, I plan on something like: ans CHAR(1) ARRAY[192]

But I learned that PostgreSQL does not 'enforce' this. I would rather
have an '?' placed in each of the 192 array elements (and thereby
constrain with NOT NULL) to indicate lack of a response (the default)
when the test records are first established for the client.

Because the client does not need to complete a test at one sitting, but
must do so before tackling another test in his or her battery, I need to
'see' where things stand test by test at each login.

I can certainly write php script to fill the array as each record is
established - clumsy the first time around, but pretty efficient after
that - just an include function. There is apparently no other way of
defining (inserting) a default value for array elements.

Am I correct in my approach to this?

Thanks for any insight .....

George



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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: Precision of time types
Следующее
От: "Rodrigo De León"
Дата:
Сообщение: Re: array indizes in SQL