-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpglog--1.0.sql
55 lines (49 loc) · 1.08 KB
/
pglog--1.0.sql
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
49
50
51
52
53
54
55
/* pglog/pglog--1.0.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pglog" to load this file. \quit
CREATE FUNCTION pglog_handler()
RETURNS fdw_handler
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
CREATE FOREIGN DATA WRAPPER pglog
HANDLER pglog_handler
NO VALIDATOR;
CREATE SERVER pglog_server
FOREIGN DATA WRAPPER pglog;
CREATE TYPE pglog_severity AS ENUM (
'DEBUG',
'INFO',
'NOTICE',
'WARNING',
'ERROR',
'LOG',
'FATAL',
'PANIC',
'???'
);
CREATE FOREIGN TABLE pglog
(
log_time timestamp(3) with time zone,
user_name text,
database_name text,
process_id integer,
connection_from text,
session_id text,
session_line_num bigint,
command_tag text,
session_start_time timestamp with time zone,
virtual_transaction_id text,
transaction_id bigint,
error_severity pglog_severity,
sql_state_code text,
message text,
detail text,
hint text,
internal_query text,
internal_query_pos integer,
context text,
query text,
query_pos integer,
location text,
application_name text
) SERVER pglog_server;