Array type and default values

Поиск
Список
Период
Сортировка
От Medi Montaseri
Тема Array type and default values
Дата
Msg-id 3E8CA286.7070508@intransa.com
обсуждение исходный текст
Список pgsql-general
Can someone show me how to specify default values for array types..

For example...

create table grades
(
    name varchar(20),
    grades int[] default '{0}'
);

Is this how I should do this....?
Does this mean the first element of the array gets the default value on
insertion ?

How can I put some constaints for the max values of each element of the
array,
can/should I say,

grades int[] default '{0}' check ( grades[0] < 20 and grades[1] < 35 and
etc etc )

Thanks


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pgsql password when FreeBSD boots -- what's usual?
Следующее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: Single Byte values