On Jul 31, 2007, at 11: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.

You can use a check constraint on the date column, e.g.,

CREATE TABLE dates
(
    a_date date PRIMARY KEY
        CHECK(a_date BETWEEN '1900-01-01'::date AND '2020-12-31')
);

Michael Glaesemann
grzm seespotcode net



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to