X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 42962EFEA7 for ; Wed, 4 Jun 2003 15:01:55 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 81876-10 for ; Wed, 4 Jun 2003 15:01:53 +0000 (GMT) Received: from latvestn (mail.vestnesis.lv [80.232.239.6]) by svr1.postgresql.org (Postfix) with ESMTP id C670FEFE9B for ; Wed, 4 Jun 2003 15:01:52 +0000 (GMT) Received: (from mail@localhost) by latvestn (8.12.9/8.11.1) id h54FLTfG092123 for pgsql-admin@postgresql.org; Wed, 4 Jun 2003 18:21:29 +0300 (EEST) (envelope-from mark@vestnesis.lv) X-Authentication-Warning: latvestn: mail set sender to mark@vestnesis.lv using -f Received: from 10.11.12.15 by 64.117.224.193 id FjuETsUA ; 4 Jun 2003 18:21:27 EEST Received: from varde (ws.vestnesis.lv [10.11.12.30] (may be forged)) by vestnesis.lv (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h54E1Ec25150 for ; Wed, 4 Jun 2003 17:01:15 +0300 Content-Type: text/plain; charset="iso-8859-13" From: Martins Zarins To: pgsql-admin@postgresql.org Subject: ALTER TABLE Date: Wed, 4 Jun 2003 18:05:10 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200306041805.10202.mark@vestnesis.lv> X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=SUBJ_ALL_CAPS, USER_AGENT_KMAIL, X_AUTH_WARNING X-Spam-Level: * X-Archive-Number: 200306/15 X-Sequence-Number: 9006 Hello! Can someone explain me, why last ALTER fails? work=3D# \d rdu Table "rdu" Column | Type | Modifiers=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 -------------+-----------------------------+-------------------------------= ----------------- id | integer | not null default=20 nextval('"rdu_id_seq"'::text) numurs | integer |=20 versija | integer |=20 klients_id | integer |=20 pasutitajs | text |=20 agents_id | integer |=20 pasut_nr | integer |=20 status_id | character varying(1) | default 'S' start_time | timestamp without time zone | not null default now() end_time | timestamp without time zone |=20 finish_time | timestamp without time zone |=20 apraksts | text |=20 Indexes: rdu_agents_id, rdu_klients_id Unique keys: rdu_id_key Triggers: RI_ConstraintTrigger_1187649, RI_ConstraintTrigger_1187655, RI_ConstraintTrigger_1187673, RI_ConstraintTrigger_1187675 work=3D# ALTER TABLE rdu ADD CONSTRAINT rdu_end_time CHECK ((start_time <= =3D=20 end_time) OR end_time IS NULL); ALTER work=3D# ALTER TABLE rdu ADD CONSTRAINT rdu_finish_time CHECK ((start_time = <=3D=20 finish_time) OR finish_time IS NULL); ERROR: AlterTableAddConstraint: rejected due to CHECK constraint=20 rdu_finish_time psql (PostgreSQL) 7.2.3 Mark