File: pre_prepare.sql

package info (click to toggle)
preprepare 0.9-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 168 kB
  • sloc: ansic: 216; makefile: 40; sql: 37; sh: 10
file content (25 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (4)
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
---
--- pre_prepare exports only a prepare_all() function.
---
CREATE OR REPLACE FUNCTION prepare_all()
RETURNS void
AS '$libdir/pre_prepare', 'prepare_all'
LANGUAGE C STRICT VOLATILE;

CREATE OR REPLACE FUNCTION prepare_all(text)
RETURNS void
AS '$libdir/pre_prepare', 'prepare_all'
LANGUAGE C STRICT VOLATILE;

CREATE OR REPLACE FUNCTION discard()
RETURNS void
LANGUAGE SQL
AS $$
  SET SESSION AUTHORIZATION DEFAULT;
  RESET ALL;
  CLOSE ALL;
  UNLISTEN *;
  SELECT pg_advisory_unlock_all();
  DISCARD PLANS;
  DISCARD TEMP;
$$;