X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9AFD59FA226 for ; Thu, 18 May 2006 04:40:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 32645-01 for ; Thu, 18 May 2006 04:40:10 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by postgresql.org (Postfix) with ESMTP id 039E69FA218 for ; Thu, 18 May 2006 04:40:10 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id y38so80901nfb for ; Thu, 18 May 2006 00:40:09 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jYp5YHuOkD0WQxP4EpTTYcgpmlbWic1oPe8QEXEBkM3l2FzWGuXYuwCOp/STrtX7bLtANWfyPp+F+f+veZgu5s8vGh0Y/VTPj3Ro9gPYmGjy1U4Ax+YwYwEOH4aZnL/npLMFXLwiES3CbcxmwtK1Qmn+pbhQXxV4BmoXCdl0I3o= Received: by 10.48.225.3 with SMTP id x3mr271145nfg; Thu, 18 May 2006 00:39:01 -0700 (PDT) Received: by 10.49.40.7 with HTTP; Thu, 18 May 2006 00:40:05 -0700 (PDT) Message-ID: <5d0f60990605180040t4723b98bi54e3621285cb53aa@mail.gmail.com> Date: Thu, 18 May 2006 09:40:05 +0200 From: "Dirk Jagdmann" To: "Risto Tamme" Subject: Re: table constraint + INSERT Cc: pgsql-sql@postgresql.org In-Reply-To: <5d0f60990605180037q5e612fdfja7df044136ac70a1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <5d0f60990605180037q5e612fdfja7df044136ac70a1@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/133 X-Sequence-Number: 25164 Too bad, some code got truncated... CREATE TABLE PART ( P_PARTKEY int4 NOT NULL, P_RETAILPRICE numeric, CONSTRAINT PART_PRIMARY PRIMARY KEY (P_PARTKEY), CONSTRAINT PART_check CHECK (P_RETAILPRICE =3D (90000 + P_PARTKEY::numeric / 10 + P_PARTKEY::numeric / 100 ); and the second code should read: create view PARTV as select P_PARTKEY, 90000 + P_PARTKEY::numeric / 10 + P_PARTKEY::numeric / 100 as P_RETAILPRICE from PART; --=20 ---> Dirk Jagdmann ----> http://cubic.org/~doj -----> http://llg.cubic.org