diff options
author | Tom Lane | 2011-06-02 22:37:57 +0000 |
---|---|---|
committer | Tom Lane | 2011-06-02 22:37:57 +0000 |
commit | aff97b1f4e3630069a370be663b847c777b58319 (patch) | |
tree | 4c57371240a863cb9e1a5a83762334a108e8629c /src/test | |
parent | 680ea6a6df345218f655eaad2c25f98900487438 (diff) |
Handle domains when checking for recursive inclusion of composite types.
We need this now because we allow domains over arrays, and we'll probably
allow domains over composites pretty soon, which makes the problem even
more obvious.
Although domains over arrays also exist in previous versions, this does not
need to be back-patched, because the coding used in older versions
successfully "looked through" domains over arrays. The problem is exposed
by not treating a domain as having a typelem.
Problem identified by Noah Misch, though I did not use his patch, since
it would require additional work to handle domains over composites that
way. This approach is more future-proof.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/regress/expected/alter_table.out | 3 | ||||
-rw-r--r-- | src/test/regress/sql/alter_table.sql | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out index 26e7bfd8c2f..f84da45de65 100644 --- a/src/test/regress/expected/alter_table.out +++ b/src/test/regress/expected/alter_table.out @@ -1516,6 +1516,9 @@ alter table recur1 add column f2 recur1; -- fails ERROR: composite type recur1 cannot be made a member of itself alter table recur1 add column f2 recur1[]; -- fails ERROR: composite type recur1 cannot be made a member of itself +create domain array_of_recur1 as recur1[]; +alter table recur1 add column f2 array_of_recur1; -- fails +ERROR: composite type recur1 cannot be made a member of itself create temp table recur2 (f1 int, f2 recur1); alter table recur1 add column f2 recur2; -- fails ERROR: composite type recur1 cannot be made a member of itself diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql index 0ed16fb7cf9..b5d76ea68e3 100644 --- a/src/test/regress/sql/alter_table.sql +++ b/src/test/regress/sql/alter_table.sql @@ -1128,6 +1128,8 @@ alter table tab1 alter column b type varchar; -- fails create temp table recur1 (f1 int); alter table recur1 add column f2 recur1; -- fails alter table recur1 add column f2 recur1[]; -- fails +create domain array_of_recur1 as recur1[]; +alter table recur1 add column f2 array_of_recur1; -- fails create temp table recur2 (f1 int, f2 recur1); alter table recur1 add column f2 recur2; -- fails alter table recur1 add column f2 int; |