add constraints to views
| От | Andreas Fromm |
|---|---|
| Тема | add constraints to views |
| Дата | |
| Msg-id | 3F6C29C9.5040607@physik.uni-erlangen.de обсуждение исходный текст |
| Ответы |
Re: add constraints to views
|
| Список | pgsql-general |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Please consider the following situation. CREATE TABLE test_table ( ~ id SERIAL PRIMARY_KEY, ~ tag BOOLEAN, ~ field1 INTEGER ); 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. ALTER TABLE test_view ADD CONSTRAINT isit CHECK ( field1 IS NOT NULL); ALTER TABLE test_view ALTER field1 SET NOT NULL; How can I do this? Regards Andreas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Using GnuPG with Debian - http://enigmail.mozdev.org iD8DBQE/bCnEPkvkZVZzNY0RAgiBAKChAPbr+RV1bTYX5+2vnCg/KU6k5ACfeGmd /tbh47tLhPee5mAkFLzODZU= =LDWj -----END PGP SIGNATURE-----
В списке pgsql-general по дате отправления: