Re: BUG #17465: Wrong error message while trying to change system column type.
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: r.zharkov@postgrespro.ru
Cc: pgsql-bugs@lists.postgresql.org
Date: 2022-04-18T15:36:51Z
Lists: pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes: > accidentally I tried to change a system column data type on Windows and got > a strange error message "no owned sequence found": > postgres=# alter table t1 alter column cmin type text; > ERROR: no owned sequence found > postgres=# alter table t1 alter column cmax type text; > ERROR: cannot alter system column "cmax" Yeah, same here. > I think the ATParseTransformCmd() function needs the same check as the check > in the ATPrepAlterColumnType() function. That seems pretty duplicative. I think it's sufficient to do something like - if (TupleDescAttr(tupdesc, attnum - 1)->attidentity) + if (attnum > 0 && + TupleDescAttr(tupdesc, attnum - 1)->attidentity) in the faulty code, and let the actual error message come out where it does now. Will fix, thanks for the report! regards, tom lane
Commits
-
Avoid invalid array reference in transformAlterTableStmt().
- e805735a83f7 14.3 landed
- 69cefb3fb837 13.7 landed
- 36d4efe779bf 15.0 landed
- 2ceec5bb396b 10.21 landed
- 20af44693c45 11.16 landed
- 0795da869544 12.11 landed
-
Fix second race condition in 002_archiving.pl with archive_cleanup_command
- 1a8b110539ef 15.0 cited