Error Code Registry

A13-03 (v0.86.0): this page is the authoritative registry for all PT error codes used in pg_ripple. Every production error path must reference a code from this list. CI enforces PT codes on production error paths.

pg_ripple uses structured error codes in the range PT001–PT799 (extension) and PT400–PT503 (HTTP companion). Error messages follow PostgreSQL conventions: lowercase first word, no trailing period.

See also: Error Message Catalog for the full list of error messages by subsystem.


Code Ranges

RangeSubsystem
PT001–PT099Dictionary encoding
PT100–PT199VP storage
PT200–PT299SPARQL query engine
PT300–PT399Datalog inference
PT400–PT499Input validation / HTTP
PT500–PT599Internal execution
PT600–PT699SHACL validation
PT700–PT799External services (LLM, federation)

Uncertain Knowledge (v0.87.0) — PT0301–PT0307

CodeFeatureCondition
PT0301Uncertain KnowledgeFuzzy SPARQL input exceeds pg_ripple.fuzzy_max_input_length characters
PT0302Uncertain Knowledgepg_trgm extension is not installed
PT0303Uncertain KnowledgeInvalid confidence value (NaN, Inf, or outside [0.0, 1.0])
PT0304Uncertain Knowledgepg:confidence() called with all three arguments unbound
PT0305Uncertain Knowledgepg:confidence() used inside a SERVICE clause (not supported)
PT0306Uncertain KnowledgeSHACL score-log table _pg_ripple.shacl_score_log does not exist
PT0307Uncertain KnowledgeConfidence bulk-loader: file path outside allowed directory

PageRank (v0.88.0) — PT0401–PT0423

CodeFeatureCondition
PT0401PageRankInvalid damping factor — must be in (0, 1) exclusive
PT0402PageRankmax_iterations must be a positive integer
PT0403PageRanktopic label exceeds pg_ripple.pagerank_max_topic_length characters
PT0404PageRankseed_nodes list exceeds pg_ripple.pagerank_max_seeds limit
PT0405PageRankedge_predicates list is empty (at least one required)
PT0406PageRankconvergence_threshold must be positive and finite
PT0407PageRankNo pagerank scores found — run pagerank_run() first
PT0408PageRankpagerank_scores table does not exist — run pagerank_run() first
PT0409PageRankpagerank_dirty_edges table does not exist
PT0410PageRankExport format unsupported — valid values: turtle, jsonld, csv, ntriples
PT0411PageRankCentrality metric unsupported — valid values: betweenness, closeness, eigenvector, katz
PT0412PageRankkatz_beta (attenuation factor) must be positive
PT0413PageRankexplain_pagerank top_k must be a positive integer
PT0414PageRankPageRank run aborted — convergence not achieved within max_iterations
PT0415PageRankConcurrent PageRank run already in progress for this topic
PT0416PageRankIRI escaping error in export (malformed IRI in pagerank_scores)
PT0417PageRankpg:pagerank() in SPARQL query triggered on-demand run; timed out
PT0418PageRankBetweenness centrality requires at least 3 nodes
PT0419PageRankpagerank_partition value out of range [1, 1024]
PT0420PageRankk_hop_depth for incremental refresh is out of range [1, 20]
PT0421PageRankConfidence-weighted PageRank requested but no confidence scores exist
PT0422PageRankTemporal decay half_life_days must be positive
PT0423PageRankfederation_minimum_confidence outside [0.0, 1.0]

HTTP Companion PT Codes

CodeHTTP StatusMeaningSource
PT400400Missing or malformed query parameterrouting/sparql_handlers.rs
PT400_SPARQL_PARSE400SPARQL syntax error — parse failedrouting/sparql_handlers.rs, spi_bridge.rs
PT401401Unauthorized — missing or invalid Bearer tokencommon.rs
PT403403Forbidden — path outside allowed directorybulk_load.rs
PT404413Request body exceeds maximum allowed sizerouting/sparql_handlers.rs
PT413413Arrow Flight export result is too largearrow_encode.rs
PT503503Database connection unavailablecommon.rs, stream.rs

Extension PT Codes (selected)

CodeMessageSubsystem
PT001dictionary encode failed: hash collision detectedDictionary
PT002dictionary decode failed: id not foundDictionary
PT003invalid term kind: expected 0/1/2Dictionary
PT008malformed IRI: <detail>Dictionary
PT400SPARQL parse error: <detail>SPARQL
PT403file path outside allowed directoryBulk load
PT501deprecated GUC: use <replacement>Storage GUC
PT512strict_dictionary: unknown dictionary idDictionary
PT600SHACL constraint violation: <detail>SHACL
PT700LLM endpoint unreachable or returned HTTP errorLLM

CI Enforcement

The CI job check-pt-codes (added in v0.86.0) scans all pgrx::error! and tracing::error! call sites in production code to verify that each one references a PT code in either:

  • The error message body (e.g., "... (PT400)"), or
  • The error code argument (e.g., json_error("PT400", ..., StatusCode::BAD_REQUEST)).

Internal-only errors that use "internal: <description> — please report" format are exempted.

To add a new error code, update this file first, then reference the code in the implementation.