RAISE STATEMENT

Description

Use the RAISE statement to report messages and raise errors.

Click here to navigate to the PostgreSQL documentation page for this syntax.

Notice that this translation spec applies only to RAISE statements that have level with the value of NOTICE and EXCEPTION.

Grammar Syntax

RAISE [ level ] 'format' [, expression [, ... ]] [ USING option = expression [, ... ] ];
RAISE [ level ] condition_name [ USING option = expression [, ... ] ];
RAISE [ level ] SQLSTATE 'sqlstate' [ USING option = expression [, ... ] ];
RAISE [ level ] USING option = expression [, ... ];
RAISE ;

Sample Source Patterns with RAISE NOTICE

Greenplum

CREATE FUNCTION FunctionName1() RETURNS void
    AS $$
declare 
	v_var1        	character varying(50);
	v_var2        	character varying(50);
BEGIN
	v_var1 := 'First';
	v_var2 := 'Second';
	RAISE NOTICE '% - Current schema is %',v_var1, v_var2;
END;
$$
    LANGUAGE plpgsql NO SQL;

Snowflake

Sample Source Patterns with RAISE EXCEPTION

Greenplum

Snowflake

  1. MSCINF0040: Raise notice translated to user-defined stored procedure.

  2. MSC-PG0013: Unsupported Raise Exception.

  3. MSCINF0042: Raise Exception translated to user-defined stored procedure call and raise stat.

Last updated

Was this helpful?