mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-03-20 11:07:00 +08:00
Add regression test for ALTER TABLE .. NO INHERIT on typed tables
This test addition has come up as a suggestion by me, while discussing a patch that manipulates the area of the code related to this command pattern. Author: Chao Li <li.evan.chao@gmail.com> Discussion: https://postgr.es/m/CAEoWx2kggo1N2kDH6OSfXHL_5gKg3DqQ0PdNuL4LH4XSTKJ3-g@mail.gmail.com
This commit is contained in:
@ -41,8 +41,10 @@ ERROR: cannot alter column type of typed table
|
||||
LINE 1: ALTER TABLE persons ALTER COLUMN name TYPE varchar;
|
||||
^
|
||||
CREATE TABLE stuff (id int);
|
||||
ALTER TABLE persons INHERIT stuff;
|
||||
ALTER TABLE persons INHERIT stuff; -- error
|
||||
ERROR: cannot change inheritance of typed table
|
||||
ALTER TABLE persons NO INHERIT stuff; -- error
|
||||
ERROR: relation "stuff" is not a parent of relation "persons"
|
||||
CREATE TABLE personsx OF person_type (myname WITH OPTIONS NOT NULL); -- error
|
||||
ERROR: column "myname" does not exist
|
||||
CREATE TABLE persons2 OF person_type (
|
||||
|
||||
@ -20,7 +20,8 @@ ALTER TABLE persons DROP COLUMN name;
|
||||
ALTER TABLE persons RENAME COLUMN id TO num;
|
||||
ALTER TABLE persons ALTER COLUMN name TYPE varchar;
|
||||
CREATE TABLE stuff (id int);
|
||||
ALTER TABLE persons INHERIT stuff;
|
||||
ALTER TABLE persons INHERIT stuff; -- error
|
||||
ALTER TABLE persons NO INHERIT stuff; -- error
|
||||
|
||||
CREATE TABLE personsx OF person_type (myname WITH OPTIONS NOT NULL); -- error
|
||||
|
||||
|
||||
Reference in New Issue
Block a user