diff options
| author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2014-12-23 09:06:44 -0300 |
|---|---|---|
| committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2014-12-23 09:06:44 -0300 |
| commit | 7eca575d1c28f6eee2bf4564f3d458d10c4a8f47 (patch) | |
| tree | b76301d5241e8720d23ae9020fac1b48d0af7c0e /src/test/regress/input/constraints.source | |
| parent | 584e35d17c00b69d598522d3cf321fbd9b7dbd03 (diff) | |
| download | postgresql-7eca575d1c28f6eee2bf4564f3d458d10c4a8f47.tar.gz | |
get_object_address: separate domain constraints from table constraints
Apart from enabling comments on domain constraints, this enables a
future project to replicate object dropping to remote servers: with the
current mechanism there's no way to distinguish between the two types of
constraints, so there's no way to know what to drop.
Also added support for the domain constraint comments in psql's \dd and
pg_dump.
Catalog version bumped due to the change in ObjectType enum.
Diffstat (limited to 'src/test/regress/input/constraints.source')
| -rw-r--r-- | src/test/regress/input/constraints.source | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/regress/input/constraints.source b/src/test/regress/input/constraints.source index 16d38f6d1e..8ec00543fb 100644 --- a/src/test/regress/input/constraints.source +++ b/src/test/regress/input/constraints.source @@ -478,3 +478,24 @@ UPDATE deferred_excl SET f1 = 3; ALTER TABLE deferred_excl ADD EXCLUDE (f1 WITH =); DROP TABLE deferred_excl; + +-- Comments +CREATE TABLE constraint_comments_tbl (a int CONSTRAINT the_constraint CHECK (a > 0)); +CREATE DOMAIN constraint_comments_dom AS int CONSTRAINT the_constraint CHECK (value > 0); + +COMMENT ON CONSTRAINT the_constraint ON constraint_comments_tbl IS 'yes, the comment'; +COMMENT ON CONSTRAINT the_constraint ON DOMAIN constraint_comments_dom IS 'yes, another comment'; + +-- no such constraint +COMMENT ON CONSTRAINT no_constraint ON constraint_comments_tbl IS 'yes, the comment'; +COMMENT ON CONSTRAINT no_constraint ON DOMAIN constraint_comments_dom IS 'yes, another comment'; + +-- no such table/domain +COMMENT ON CONSTRAINT the_constraint ON no_comments_tbl IS 'bad comment'; +COMMENT ON CONSTRAINT the_constraint ON DOMAIN no_comments_dom IS 'another bad comment'; + +COMMENT ON CONSTRAINT the_constraint ON constraint_comments_tbl IS NULL; +COMMENT ON CONSTRAINT the_constraint ON DOMAIN constraint_comments_dom IS NULL; + +DROP TABLE constraint_comments_tbl; +DROP DOMAIN constraint_comments_dom; |
