Postgres module

locate_failing_statement

procedure · 1 overloadsince 0.27.0Source

For an error that came without a position: the first statement of the migration whole that fails the same way, as the failure's line. Runs inside the caller's open transaction, in the state the migration started from, and leaves it in that state (a savepoint is rolled back to). Gives failure back unchanged when no single statement reproduces the error, which happens when the file's ; splitting is not how the server saw it.

locate_failing_statement :: (
    c: *Connection,
    name: string,
    index: s64,
    whole: string,
    message: string,
    failure: Migration_Failure
) -> Migration_Failure

For an error that came without a position: the first statement of the migration whole that fails the same way, as the failure's line. Runs inside the caller's open transaction, in the state the migration started from, and leaves it in that state (a savepoint is rolled back to). Gives failure back unchanged when no single statement reproduces the error, which happens when the file's ; splitting is not how the server saw it.

Parameters

c: *Connection
the connection, inside the open transaction.
name: string
the migration's name.
index: s64
its place in the list, from 0.
whole: string
the migration's file.
message: string
the server's message to reproduce.
failure: Migration_Failure
what is returned when no statement reproduces it.

Returns

See also