1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// Unified Query Algebra
//
// Copyright (c) 2023-2026 Cognica, Inc.
//
//! Procedural traceback names preserve the primary failure even when catalog lookup fails.
use super::{ColumnType, Interpreter};
impl Interpreter<'_> {
pub(super) fn statement_error_context(
&self,
line: i64,
statement: &super::PLpgSQLStmt,
) -> String {
let signature = self
.def
.catalog_oid
.and_then(|oid| {
self.services
.expressions
.resolve_regtype_output(&ColumnType::Regprocedure, i64::from(oid))
.ok()
.flatten()
})
.unwrap_or_else(|| {
uqa_sql::routines::lifecycle::routine_signature_label(
&self.def.name,
&uqa_sql::routines::routine_signature_types(self.def),
)
});
format!(
"PL/pgSQL function {signature} line {line} at {}",
statement.diagnostic_kind()
)
}
}