Re: add constraints to views

Поиск
Список
Период
Сортировка
От Gaetano Mendola
Тема Re: add constraints to views
Дата
Msg-id 3F6C3ACA.3020409@bigfoot.com
обсуждение исходный текст
Ответ на add constraints to views  (Andreas Fromm <Andreas.Fromm@physik.uni-erlangen.de>)
Ответы Re: add constraints to views  (Andreas Fromm <Andreas.Fromm@physik.uni-erlangen.de>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: 'order by' does "wrong" with unicode-chars (german umlauts)
Следующее
От: Gaetano Mendola
Дата:
Сообщение: Re: This mail list and its policies