(ctx *tree.FmtCtx)
| 21 | } |
| 22 | |
| 23 | func (s *Exception) Format(ctx *tree.FmtCtx) { |
| 24 | ctx.WriteString("WHEN ") |
| 25 | for i, cond := range s.Conditions { |
| 26 | if i > 0 { |
| 27 | ctx.WriteString(" OR ") |
| 28 | } |
| 29 | if cond.SqlErrState != "" { |
| 30 | ctx.WriteString("SQLSTATE ") |
| 31 | formatStringQuotes(ctx, cond.SqlErrState) |
| 32 | } else { |
| 33 | formatString(ctx, cond.SqlErrName) |
| 34 | } |
| 35 | } |
| 36 | ctx.WriteString(" THEN\n") |
| 37 | for _, stmt := range s.Action { |
| 38 | ctx.FormatNode(stmt) |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | func (s *Exception) PlpgSQLStatementTag() string { |
| 43 | return "proc_exception" |
nothing calls this directly
no test coverage detected