File: 55_raise_message.sql

package info (click to toggle)
pgl-ddl-deploy 2.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,780 kB
  • sloc: sql: 47,586; ansic: 364; python: 282; sh: 72; makefile: 63
file content (20 lines) | stat: -rw-r--r-- 701 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
SET client_min_messages TO WARNING;
ALTER EXTENSION pgl_ddl_deploy UPDATE;

-- Simple example
SELECT pgl_ddl_deploy.raise_message('WARNING', 'foo');

-- Test case that needs % escapes
SELECT pgl_ddl_deploy.raise_message('WARNING', $$SELECT foo FROM bar WHERE baz LIKE 'foo%'$$);
/*** Failing message on 1.5 read:
ERROR:  too few parameters specified for RAISE
CONTEXT:  compilation of PL/pgSQL function "inline_code_block" near line 3
SQL statement "
DO $block$
BEGIN
RAISE WARNING $pgl_ddl_deploy_msg$SELECT foo FROM bar WHERE baz LIKE 'foo%'$pgl_ddl_deploy_msg$;
END$block$;
"
PL/pgSQL function pgl_ddl_deploy.raise_message(text,text) line 4 at EXECUTE
***/
SELECT * FROM pgl_ddl_deploy.exceptions;