A breakpoint tells the debugger that execution should break, or pause, at a certain point. When a break occurs, you can use the debugger windows to evaluate the variables of the routine. A breakpoint stops the code on the statement that would be executed next.
When the debugger breaks execution, the routine stays paused until you use the Continue, Step Into, Step Over, or Step Out command to continue execution. For more information, see Control execution while debugging.
Note
Conditional breakpoints and hit-count breakpoints aren’t supported.
You can set a breakpoint only on an executable PL/pgSQL statement inside the body of a routine, that is, between BEGIN and END.
You can’t set a working breakpoint on:
DECLARE section of a block.CREATE FUNCTION / CREATE PROCEDURE header and the closing dollar quote.If you try to set a breakpoint on such a line, no breakpoint icon appears.
A breakpoint set in a routine that hasn’t been compiled for debugging never fires. This also applies to routines that are called from the one you’re debugging: to break inside a called routine, compile it for debugging too.
A breakpoint set while a routine is running doesn’t take effect immediately. It becomes active the next time the debugger enters break mode.
Icons in the gray margin of the editor indicate the status of a breakpoint.
| Icon | Status | Description |
|---|---|---|
| Enabled | Execution will be interrupted at this breakpoint. | |
| Disabled | The debugger ignores this breakpoint. | |
| Warning | The debugger can’t bind the breakpoint to this line because either the line isn’t executable, or the debug engine hasn’t finished deploying yet. |
For more icons, see Icon reference.
You can set a breakpoint in the following ways:
The breakpoint icon appears in the editor margin.
You can delete a breakpoint in the following ways:
To delete every breakpoint at once, use one of these ways:
To turn off a breakpoint without deleting it, clear the checkbox next to it in the Breakpoints window. Select the checkbox to turn it on again.
Click
to toggle all breakpoints at once. This action turns on all breakpoints if at least one of them is turned off, and turns off all breakpoints if all of them are turned on.
The table describes the icons used in the debugger.
| Icon | Description | Triggering event |
|---|---|---|
| A breakpoint is active. Execution pauses when this line is reached. |
Appears when you insert a breakpoint. | |
| A breakpoint exists but is inactive, and the debugger ignores it during execution. | Appears when you turn off a breakpoint. | |
| The breakpoint is in a warning state, indicating it can’t be executed. | Appears when you try to set a breakpoint on a line that can’t be executed, or before the debug engine has finished deploying. | |
| Indicates the line of code currently being executed or shows the call stack location in the Call Stack window. | Appears when execution is paused and helps you identify where the debugger is currently positioned. | |
| Execution stops at the breakpoint. | Appears when the debugger has paused on the line where the breakpoint is set. | |
| Execution passed through an inactive breakpoint without pausing. | Appears when execution reaches a line that contains an inactive breakpoint; the debugger marks the line but doesn’t pause there. | |
| Steps into the function that’s called from the code currently being debugged. | Appears when the debugger is paused and marks the exact line of code that will run next when execution continues. It also appears when you step through code. |