VERBOSE

VERBOSE is an SQL command modifier that provides additional information regarding the output of a command. When VERBOSE is appended to a command, the SQL server returns more detailed messages that explain the operation process, giving the user further insight on what happened during the command execution. This modifier can aid in understanding issues or behaviors during SQL operations.

Example

EXPLAIN (VERBOSE true, FORMAT YAML)
SELECT * FROM customer;

Output

-
Plan:
Node Type: "Seq Scan"
Relation Name: "customer"
Alias: "customer"
Startup Cost: 0.00
Total Cost: 13.60
Plan Rows: 360
Plan Width: 36
Output:
- "customer_id"
- "customer_name"

Explanation

The VERBOSE option in PostgreSQL’s EXPLAIN command provides additional details about the query plan. The provided query uses VERBOSE to display the names of the output columns (customer_id and customer_name) in the execution plan for a sequential scan on the “customer” table. The FORMAT YAML formats the output in YAML (Yet Another Markup Language) for readability.

Example

BEGIN
DBMS_OUTPUT.ENABLE (buffer_size => NULL);
DBMS_OUTPUT.PUT_LINE ('Hello, World!');
END;
/
SET SERVEROUTPUT ON;
/

Output

Hello, World!

Explanation

This block of PL/SQL code starts with BEGIN and ends with END;. Inside this block, the DBMS_OUTPUT.ENABLE procedure is called to enable the output to the screen with buffer_size => NULL setting the buffer size to the maximum. DBMS_OUTPUT.PUT_LINE is then used to print ‘Hello, World!’ to the screen. To actually see the results, SET SERVEROUTPUT ON; has to be executed after the block. This will turn server output on allowing the results of the DBMS_OUTPUT.PUT_LINE to be seen.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.