Project

General

Profile

« Previous | Next » 

Revision 14232

bugfix: schemas/util.sql: explain(): need to restore NOTICEs in verbose mode

View differences:

trunk/schemas/util.sql
2535 2535
--
2536 2536

  
2537 2537
CREATE FUNCTION explain(sql text, verbose_ boolean DEFAULT false) RETURNS SETOF text
2538
    LANGUAGE sql
2538
    LANGUAGE plpgsql
2539 2539
    SET client_min_messages TO 'error'
2540 2540
    AS $_$
2541
/* `client_min_messages = ERROR`: EXPLAIN apparently runs IMMUTABLE functions in
2542
the query, so this prevents displaying any log messages printed by them */
2543
SELECT util.eval2set($$EXPLAIN $$||$1, verbose_ := verbose_)
2541
/* `SET client_min_messages = ERROR`: EXPLAIN apparently runs IMMUTABLE
2542
functions in the query, so this prevents displaying any log messages printed by
2543
them. note that this *must* be set as a function option, so that the effects
2544
will be limited to the function. */
2545
BEGIN
2546
	IF verbose_ THEN SET client_min_messages = NOTICE; END IF;
2547
	
2548
	RETURN QUERY
2549
		SELECT * FROM util.eval2set($$EXPLAIN $$||$1, verbose_ := verbose_);
2550
END;
2544 2551
$_$;
2545 2552

  
2546 2553

  

Also available in: Unified diff