Array type and default values

From: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Array type and default values
Date: 2003-04-03 21:07:18
Message-ID: 3E8CA286.7070508@intransa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Lonni J Friedman 2003-04-03 21:18:42 Re: unable to dump database, toast errors
Previous Message Nigel J. Andrews 2003-04-03 21:01:57 Re: Single Byte values