Re: add constraints to views

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: "pgsql-general(at)postgresql(dot)org"(at)svr1(dot)postgresql(dot)org
Cc: Andreas Fromm <Andreas(dot)Fromm(at)physik(dot)uni-erlangen(dot)de>
Subject: Re: add constraints to views
Date: 2003-09-20 11:32:26
Message-ID: 3F6C3ACA.3020409@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andreas Fromm wrote:

> CREATE VIEW test_view (
> ~ SELECT * FROM test_table WHERE tag
> );
>
> Now I want ad a NOT NULL constraint to the view on field1. I tryed the
> following, but neither works.

what does mean add a null constrain to a view ? Do you mean
filter out the records with the field1 null ?

CREATE OR REPLACE test_view AS
SELECT *
FROM test_table
WHERE field1 IS NOT NULL AND
tag;

Regards
Gaetano Mendola

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-09-20 11:48:54 PG + PHP, was Re: Zend survey result about dbms...
Previous Message Andreas Fromm 2003-09-20 10:19:53 add constraints to views