[prev in list] [next in list] [prev in thread] [next in thread]
List: postgresql-sql
Subject: Re: [SQL] table constraint + INSERT
From: "Dirk Jagdmann" <jagdmann () gmail ! com>
Date: 2006-05-18 7:40:05
Message-ID: 5d0f60990605180040t4723b98bi54e3621285cb53aa () mail ! gmail ! com
[Download RAW message or body]
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 = (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
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic