Re: table constraint + INSERT - Mailing list pgsql-sql

From Dirk Jagdmann
Subject Re: table constraint + INSERT
Date
Msg-id 5d0f60990605180040t4723b98bi54e3621285cb53aa@mail.gmail.com
Whole thread Raw
In response to Re: table constraint + INSERT  ("Dirk Jagdmann" <jagdmann@gmail.com>)
List pgsql-sql
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_checkCHECK (P_RETAILPRICE = (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;

--
---> Dirk Jagdmann
----> http://cubic.org/~doj
-----> http://llg.cubic.org


pgsql-sql by date:

Previous
From: "Dirk Jagdmann"
Date:
Subject: Re: table constraint + INSERT
Next
From: "Michael Artz"
Date:
Subject: Re: Question about SQL Control Structure(if then, for loop)