1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Fix ALTER TABLE error message

This bogus error message was introduced in 2013 by commit f177cbfe67,
because of misunderstanding the processCASbits() API; at the time, no
test cases were added that would be affected by this change.  Only in
ca87c415e2 was one added (along with a couple of typos), with an XXX
note that the error message was bogus.  Fix the whole, add some test
cases.

Backpatch all the way back.

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://postgr.es/m/202503041822.aobpqke3igvb@alvherre.pgsql
This commit is contained in:
Álvaro Herrera
2025-03-04 20:07:30 +01:00
parent bacbc4863b
commit 7bbc46213d
5 changed files with 17 additions and 9 deletions

View File

@ -2663,7 +2663,7 @@ alter_table_cmd:
n->def = (Node *) c;
c->conname = $3;
c->alterDeferrability = true;
processCASbits($4, @4, "ALTER CONSTRAINT statement",
processCASbits($4, @4, "FOREIGN KEY",
&c->deferrable,
&c->initdeferred,
NULL, NULL, NULL, yyscanner);