agora inbox for pgsql-committers@postgresql.orghelp / color / mirror / Atom feed
pgsql: Disallow renaming a rule to "_RETURN". 7+ messages / 1 participants [nested] [flat]
* pgsql: Disallow renaming a rule to "_RETURN". @ 2026-07-04 15:34 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-07-04 15:34 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow renaming a rule to "_RETURN". ON SELECT rules must be named "_RETURN", while other kinds of rules must not be; this ancient restriction is depended on by various client code. We successfully enforced this convention in most places, but ALTER RULE allowed renaming a non-SELECT rule to "_RETURN". Notably, that would break dump/restore, since the eventual CREATE RULE command would reject the name. While at it, remove DefineQueryRewrite's hack to substitute "_RETURN" for the convention that was used before 7.3. We dropped other server-side code that supported restoring pre-7.3 dumps some time ago (notably in e58a59975 and nearby commits), but this bit was missed. Bug: #19543 Reported-by: Adam Pickering <adamkpickering@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/19543-461228e77f3b32fc@postgresql.org Backpatch-through: 14 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/a8c2547eaac73cd6d499a4ab151f0401bf647f56 Modified Files -------------- src/backend/rewrite/rewriteDefine.c | 36 ++++++++++++++++-------------------- src/test/regress/expected/rules.out | 2 ++ src/test/regress/sql/rules.sql | 1 + 3 files changed, 19 insertions(+), 20 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Disallow renaming a rule to "_RETURN". @ 2026-07-04 15:34 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-07-04 15:34 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow renaming a rule to "_RETURN". ON SELECT rules must be named "_RETURN", while other kinds of rules must not be; this ancient restriction is depended on by various client code. We successfully enforced this convention in most places, but ALTER RULE allowed renaming a non-SELECT rule to "_RETURN". Notably, that would break dump/restore, since the eventual CREATE RULE command would reject the name. While at it, remove DefineQueryRewrite's hack to substitute "_RETURN" for the convention that was used before 7.3. We dropped other server-side code that supported restoring pre-7.3 dumps some time ago (notably in e58a59975 and nearby commits), but this bit was missed. Bug: #19543 Reported-by: Adam Pickering <adamkpickering@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/19543-461228e77f3b32fc@postgresql.org Backpatch-through: 14 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/80c7f5467d9e14595688ceceba62b8b784595d1e Modified Files -------------- src/backend/rewrite/rewriteDefine.c | 36 ++++++++++++++++-------------------- src/test/regress/expected/rules.out | 2 ++ src/test/regress/sql/rules.sql | 1 + 3 files changed, 19 insertions(+), 20 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Disallow renaming a rule to "_RETURN". @ 2026-07-04 15:34 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-07-04 15:34 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow renaming a rule to "_RETURN". ON SELECT rules must be named "_RETURN", while other kinds of rules must not be; this ancient restriction is depended on by various client code. We successfully enforced this convention in most places, but ALTER RULE allowed renaming a non-SELECT rule to "_RETURN". Notably, that would break dump/restore, since the eventual CREATE RULE command would reject the name. While at it, remove DefineQueryRewrite's hack to substitute "_RETURN" for the convention that was used before 7.3. We dropped other server-side code that supported restoring pre-7.3 dumps some time ago (notably in e58a59975 and nearby commits), but this bit was missed. Bug: #19543 Reported-by: Adam Pickering <adamkpickering@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/19543-461228e77f3b32fc@postgresql.org Backpatch-through: 14 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a7f7958ab6bf368236334ce52e45be5e7502d2e7 Modified Files -------------- src/backend/rewrite/rewriteDefine.c | 36 ++++++++++++++++-------------------- src/test/regress/expected/rules.out | 2 ++ src/test/regress/sql/rules.sql | 1 + 3 files changed, 19 insertions(+), 20 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Disallow renaming a rule to "_RETURN". @ 2026-07-04 15:34 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-07-04 15:34 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow renaming a rule to "_RETURN". ON SELECT rules must be named "_RETURN", while other kinds of rules must not be; this ancient restriction is depended on by various client code. We successfully enforced this convention in most places, but ALTER RULE allowed renaming a non-SELECT rule to "_RETURN". Notably, that would break dump/restore, since the eventual CREATE RULE command would reject the name. While at it, remove DefineQueryRewrite's hack to substitute "_RETURN" for the convention that was used before 7.3. We dropped other server-side code that supported restoring pre-7.3 dumps some time ago (notably in e58a59975 and nearby commits), but this bit was missed. Bug: #19543 Reported-by: Adam Pickering <adamkpickering@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/19543-461228e77f3b32fc@postgresql.org Backpatch-through: 14 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e99fb3262441b47d88632b2857f03083be67f3e3 Modified Files -------------- src/backend/rewrite/rewriteDefine.c | 36 ++++++++++++++++-------------------- src/test/regress/expected/rules.out | 2 ++ src/test/regress/sql/rules.sql | 1 + 3 files changed, 19 insertions(+), 20 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Disallow renaming a rule to "_RETURN". @ 2026-07-04 15:34 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-07-04 15:34 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow renaming a rule to "_RETURN". ON SELECT rules must be named "_RETURN", while other kinds of rules must not be; this ancient restriction is depended on by various client code. We successfully enforced this convention in most places, but ALTER RULE allowed renaming a non-SELECT rule to "_RETURN". Notably, that would break dump/restore, since the eventual CREATE RULE command would reject the name. While at it, remove DefineQueryRewrite's hack to substitute "_RETURN" for the convention that was used before 7.3. We dropped other server-side code that supported restoring pre-7.3 dumps some time ago (notably in e58a59975 and nearby commits), but this bit was missed. Bug: #19543 Reported-by: Adam Pickering <adamkpickering@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/19543-461228e77f3b32fc@postgresql.org Backpatch-through: 14 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a69503fb1e26ae95d90fd1b9ddfb57cdf2081a14 Modified Files -------------- src/backend/rewrite/rewriteDefine.c | 36 ++++++++++++++++-------------------- src/test/regress/expected/rules.out | 2 ++ src/test/regress/sql/rules.sql | 1 + 3 files changed, 19 insertions(+), 20 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Disallow renaming a rule to "_RETURN". @ 2026-07-04 15:34 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-07-04 15:34 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow renaming a rule to "_RETURN". ON SELECT rules must be named "_RETURN", while other kinds of rules must not be; this ancient restriction is depended on by various client code. We successfully enforced this convention in most places, but ALTER RULE allowed renaming a non-SELECT rule to "_RETURN". Notably, that would break dump/restore, since the eventual CREATE RULE command would reject the name. While at it, remove DefineQueryRewrite's hack to substitute "_RETURN" for the convention that was used before 7.3. We dropped other server-side code that supported restoring pre-7.3 dumps some time ago (notably in e58a59975 and nearby commits), but this bit was missed. Bug: #19543 Reported-by: Adam Pickering <adamkpickering@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/19543-461228e77f3b32fc@postgresql.org Backpatch-through: 14 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/eada45dd846d4324c33e3ae357fb4c8fbf01bc6b Modified Files -------------- src/backend/rewrite/rewriteDefine.c | 36 ++++++++++++++++-------------------- src/test/regress/expected/rules.out | 2 ++ src/test/regress/sql/rules.sql | 1 + 3 files changed, 19 insertions(+), 20 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Disallow renaming a rule to "_RETURN". @ 2026-07-04 15:34 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2026-07-04 15:34 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow renaming a rule to "_RETURN". ON SELECT rules must be named "_RETURN", while other kinds of rules must not be; this ancient restriction is depended on by various client code. We successfully enforced this convention in most places, but ALTER RULE allowed renaming a non-SELECT rule to "_RETURN". Notably, that would break dump/restore, since the eventual CREATE RULE command would reject the name. While at it, remove DefineQueryRewrite's hack to substitute "_RETURN" for the convention that was used before 7.3. We dropped other server-side code that supported restoring pre-7.3 dumps some time ago (notably in e58a59975 and nearby commits), but this bit was missed. Bug: #19543 Reported-by: Adam Pickering <adamkpickering@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/19543-461228e77f3b32fc@postgresql.org Backpatch-through: 14 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1b17a6e3cd89f76ea5db6260c79db620d5a7793b Modified Files -------------- src/backend/rewrite/rewriteDefine.c | 36 ++++++++++++++++-------------------- src/test/regress/expected/rules.out | 2 ++ src/test/regress/sql/rules.sql | 1 + 3 files changed, 19 insertions(+), 20 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2026-07-04 15:34 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-07-04 15:34 pgsql: Disallow renaming a rule to "_RETURN". Tom Lane <tgl@sss.pgh.pa.us> 2026-07-04 15:34 pgsql: Disallow renaming a rule to "_RETURN". Tom Lane <tgl@sss.pgh.pa.us> 2026-07-04 15:34 pgsql: Disallow renaming a rule to "_RETURN". Tom Lane <tgl@sss.pgh.pa.us> 2026-07-04 15:34 pgsql: Disallow renaming a rule to "_RETURN". Tom Lane <tgl@sss.pgh.pa.us> 2026-07-04 15:34 pgsql: Disallow renaming a rule to "_RETURN". Tom Lane <tgl@sss.pgh.pa.us> 2026-07-04 15:34 pgsql: Disallow renaming a rule to "_RETURN". Tom Lane <tgl@sss.pgh.pa.us> 2026-07-04 15:34 pgsql: Disallow renaming a rule to "_RETURN". Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox