File: omnidb_plpgsql_debugger--1.0.0.sql

package info (click to toggle)
omnidb-plpgsql-debugger 3.0.0.20201026-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: ansic: 420; sql: 215; sh: 81; makefile: 13
file content (48 lines) | stat: -rw-r--r-- 1,133 bytes parent folder | download | duplicates (3)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
\echo Use "CREATE EXTENSION omnidb_plpgsql_debugger" to load this file. \quit

CREATE SCHEMA omnidb;

CREATE FUNCTION omnidb.omnidb_enable_debugger(character varying)
RETURNS void AS '$libdir/omnidb_plpgsql_debugger'
LANGUAGE C IMMUTABLE STRICT;

CREATE TABLE omnidb.contexts
(
  pid           INTEGER NOT NULL PRIMARY KEY,
  function      TEXT,
  hook          TEXT,
  lineno        INTEGER,
  stmttype      TEXT,
  breakpoint    INTEGER NOT NULL,
  finished      BOOLEAN
);

CREATE TABLE omnidb.variables
(
  pid           INTEGER NOT NULL,
  name          TEXT,
  attribute     TEXT,
  vartype       TEXT,
  value         TEXT
);

ALTER TABLE omnidb.variables
ADD CONSTRAINT omnidb_variables_contexts_fk
FOREIGN KEY (pid)
REFERENCES omnidb.contexts (pid)
ON DELETE CASCADE;

CREATE TABLE omnidb.statistics
(
  pid           INTEGER NOT NULL,
  lineno        INTEGER,
  step          INTEGER,
  tstart        TIMESTAMP WITHOUT TIME ZONE,
  tend          TIMESTAMP WITHOUT TIME ZONE
);

ALTER TABLE omnidb.statistics
ADD CONSTRAINT omnidb_statistics_contexts_fk
FOREIGN KEY (pid)
REFERENCES omnidb.contexts (pid)
ON DELETE CASCADE;