-----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-----



---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
     joining column's datatypes do not match

Reply via email to