File: storedproc.sql

package info (click to toggle)
postgresql-hll 2.18-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 58,720 kB
  • sloc: ansic: 2,805; sql: 2,160; cpp: 201; makefile: 22; sh: 1
file content (28 lines) | stat: -rw-r--r-- 765 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
-- ----------------------------------------------------------------
-- Establishes global setting behavior with stored procedures.
-- ----------------------------------------------------------------

-- Outside stored procedure.

SELECT hll_set_max_sparse(256);
SELECT hll_set_defaults(10,4,128,0);

-- When defining a stored procedure the global statements don't take
-- effect.

CREATE OR REPLACE FUNCTION testfunc_azfwygmg() RETURNS void AS $$
BEGIN
PERFORM hll_set_max_sparse(-1);
PERFORM hll_set_defaults(11,5,-1,1);
END;
$$ LANGUAGE plpgsql;

SELECT hll_set_max_sparse(256);
SELECT hll_set_defaults(10,4,128,0);

-- When invoking a stored procedure they work.

SELECT testfunc_azfwygmg();

SELECT hll_set_max_sparse(256);
SELECT hll_set_defaults(10,4,128,0);