Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: CHECK-Constraint mit WHERE ?



Martin Spott <Martin(dot)Spott(at)mgras(dot)net> schrieb am 22.06.2006 15:58:26:
> 
> Tobias Bußmann wrote:
> 
> > CONSTRAINT enforce_covertype CHECK ((geomtype LIKE 'POLYGON%') AND
> > (covertype >= 0 AND covertype < 6)) OR NOT (geomtype LIKE 'POLYGON%')
> 
> Fast!, die Klammerung hat 'nen Fehler, den der komplette Ausdruck
> hinter dem CHECK muss geklammert werden, die LIKE-Ausdruecke kommen
> hingegen auch ohne Klammer aus:
> 
>   CONSTRAINT enforce_covertype CHECK (
>     (geomtype LIKE 'POLYGON%' AND (covertype >= 0 AND covertype < 6))
>     OR geomtype NOT LIKE 'POLYGON%'
>   )
> 
> .... funktioniert,
> 	Martin.
> -- 

Hallo,
geht das nicht einfacher:

 CONSTRAINT enforce_covertype CHECK (
         geomtype NOT LIKE 'POLYGON%' 
         OR  (covertype >= 0 AND covertype < 6)
     )


??
Christoph
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000071




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group