Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Syntax of PL/pgSQL
Function parameters
Handling exceptions


Great! You can display a message with arguments. In the string with the message, simply use the % character as many times as you need. Then, after a comma, list all the variables (arguments) you'd like to print.

For example, a function that displays a message passed as an argument may look like this:

CREATE FUNCTION show_message(message varchar)
RETURNS void AS $$
  RAISE NOTICE 'The show_message() function was called with the argument: %', message;
$$ LANGUAGE plpgsql;


Write the function hello() that takes one argument name of type varchar and displays the notice 'Hello, ' followed by the name provided as the argument.

For example hello('Roman') should display:

Hello, Roman

The function should return void.