Fix misleading iceberg catalog option error messages#368
Open
sfc-gh-npuka wants to merge 1 commit into
Open
Conversation
The FDW validator in pg_lake_iceberg used error messages that said options were "only valid for writable catalog=\"rest\"" when they are actually valid for read-only external catalog tables (both catalog=rest and catalog=object_store). Similarly, "required for catalog=\"rest\"" omitted that the same options are required for catalog=object_store read-only tables. The error raised for an unknown "catalog" value also listed only "rest" and "postgres", omitting "object_store". Changes: - Reword all "only valid for" / "required for" error messages for catalog_name, catalog_namespace, catalog_table_name, and read_only to accurately describe which catalog types they apply to. - Update the "invalid catalog option" errdetail and surrounding block comment to include object_store alongside rest and postgres. - Remove a dead "catalog_namespace required" check: it only applied to REST read-only (object_store excluded), but the REST ALTER whitelist never allows touching catalog_namespace and CREATE auto-fills a default, so the path was unreachable. - Rework the comments in ProcessAlterTable: the outer block comment now describes external catalog handling (was "rest" only) and the validator interaction, and each per-branch comment accurately describes which options that catalog type allows changing (the previous object_store branch comment was a stale copy-paste of the rest branch comment). - Add a comment in option.c noting that the remaining "required" checks act as a safety net for ALTER DROP scenarios. Tests: - test_iceberg_catalog_option_validation_errors (test_writable_iceberg.py): exercises the four "only valid for read-only external catalog tables" rejection paths plus the "invalid catalog option" path without needing external infrastructure. - test_object_store_read_only_alter_drop_required_options (test_object_store_catalog.py): exercises the two "required" paths via ALTER FOREIGN TABLE OPTIONS (DROP ...) on an object_store read-only table. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: sfc-gh-npuka <naisila.puka@snowflake.com>
b08defb to
50e10ad
Compare
sfc-gh-mslot
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The FDW validator in pg_lake_iceberg used error messages that said options were "only valid for writable catalog="rest"" when they are actually valid for read-only external catalog tables (both catalog=rest and catalog=object_store). Similarly, "required for catalog="rest"" omitted that the same options are required for catalog=object_store read-only tables.
Changes:
Tests:
Checklist
DCO Reminder (important)
This project uses the Developer Certificate of Origin (DCO).
DCO is a simple way for you to confirm that you wrote your code and that you have the right to contribute it.
If the DCO check fails, please sign off your commits.
How to sign off
For your last commit:
git commit --amend -s
git push --force
For multiple commits:
git rebase --signoff main
git push --force
More info: https://developercertificate.org/