|
|
Choosing A Webhost: |
Re: CHECK-Constraint mit WHERE ?: msg#00041db.postgresql.german
Hallo Martin, Martin Spott wrote: > Ich moechte aber, dass der Constraint nur auf bestimmte Geometrien > angewendet wird und wuensche mir sinngemaess so etwas wie: > > CONSTRAINT enforce_covertype CHECK (covertype >= 0 AND covertype < > 6) WHERE geomtype LIKE 'POLYGON%' japp das Problem kenne ich. Ich habe folgende Lösung: CONSTRAINT name CHECK (Where-Bedingung AND Eigentliche-Prüfung) OR NOT Where-Bedingung also in Deinem Fall: CONSTRAINT enforce_covertype CHECK ((geomtype LIKE 'POLYGON%') AND (covertype >= 0 AND covertype < 6)) OR NOT (geomtype LIKE 'POLYGON%') so in dem Muster lassen sich sehr einfach bedingte Constraints realisieren. hth Tobias ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: CHECK-Constraint mit WHERE ?, Bernd Helmle |
|---|---|
| Next by Date: | Materialized Views, Andreas Seik |
| Previous by Thread: | Re: CHECK-Constraint mit WHERE ?, Bernd Helmle |
| Next by Thread: | Re: CHECK-Constraint mit WHERE ?, Martin Spott |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |