Skip to content

Conversation

@danolivo
Copy link
Contributor

This series of commits makes 'make installcheck' visually clear.

danolivo and others added 5 commits December 22, 2025 07:58
Add spock.enable_quiet_mode GUC parameter to reduce message verbosity
for cleaner output. When enabled, this parameter:

1. Downgrades DDL replication messages from INFO/WARNING to LOG level
   - "DDL statement replicated" (INFO → LOG)
   - "DDL statement replicated, but could be unsafe" (WARNING → LOG)
   - "This DDL statement will not be replicated" (WARNING → LOG)

2. Suppresses dependent object reporting in DROP CASCADE operations
   to reduce NOTICE message clutter

The parameter defaults to false (disabled) for normal verbose output.
Enable it by setting:
  spock.enable_quiet_mode = true

This is useful for regression tests and production environments where
less verbose output is desired. All diagnostic messages are preserved
in the server log.
These two changes to the Spock initial script are intended to make
‘make installcheck’ clearer by avoiding false-positive errors.

There is no evidence of the md5_agg_sfunc and md5_agg usage anywhere in
the code - it seems it was an attempt at Spock objects naming. Also, add to
the spock_gen_slot_name declaration the ‘PARALLEL SAFE’ clause just to keep
regression tests quiet.
1. Bug. In the spock_repset.c module functions replication_set_add_table and
replication_set_add_seq should check locking on the table before calling
another lock-acquiring routine. It prevents unnecessary calls and reduces
the lock level.

2. Improvement. In the spock_queue.c module function queue_message insert
a tuple into the spock.queue table. The pattern of this table usage is quite
trivial and doesn’t include any concurrent updates. So, we may release
the table lock before commit without harm, and let ‘make installcheck’ be more
conventional.

author: Andrei Lepikhov
co-author: Claude
PostgreSQL Core Patch Enhancement (pgXX-015-attoptions.diff):

Added IsCatalogRelation() check in GetAttrDelta() function to prevent
delta_apply attribute options from being applied to catalog relations.

Rationale:
- Catalog relations are never replicated via Logical Replication
- No use case exists for delta_apply on system catalogs
- Applying delta_apply to catalog tables would be meaningless
- Early exit improves performance by avoiding unnecessary attribute scans

Implementation:
- Check added at the beginning of GetAttrDelta()
- Returns NULL immediately if relation is a catalog
- Includes clear comment explaining the rationale
- No functional change for user tables

Benefits:
- Prevents accidental misconfiguration
- Minor performance improvement for catalog operations
- Clearer code intent through explicit check
- Matches logical replication semantics

Note: This patch is applied to PostgreSQL core during build to
enable attribute-level options for delta_apply functionality.
In case of IF EXISTS / NOT EXISTS clause Postgres core utility call produces
an INFO message and lets utility hooks do their job as usual. In the Spock
case, we need to do the same and carefully process the clause so it doesn't
produce an ERROR that breaks the convention.
@danolivo danolivo requested a review from mason-sharp December 22, 2025 09:19
@danolivo danolivo self-assigned this Dec 22, 2025
@danolivo danolivo added the enhancement New feature or request label Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants