On 31/07/2007 17:26, jo wrote:
I would like to know if there's a simple way to customize the range for
dates,
to avoid people insert dates before 1900 and after 2020, for example.
How about a check constraint on the date column? Something like -
create table the_table (
the_date date,
....etc...
check (the_date >= '1900-01-01' and the_date <= '2020-12-31')
);
Then you just need to handle in your application the error raised when
someone enters an incorrect date.
HTH,
Ray.
---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@xxxxxx
---------------------------------------------------------------
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend