8000 add pgaudit tests (#1160) · cepro/postgres@24e1af5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 24e1af5

Browse files
authored
add pgaudit tests (supabase#1160)
1 parent b0cb83b commit 24e1af5

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

nix/tests/expected/pgaudit.out

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
-- Note: there is no test that the logs were correctly output. Only checking for exceptions
2+
set pgaudit.log = 'write, ddl';
3+
set pgaudit.log_relation = on;
4+
set pgaudit.log_level = notice;
5+
create schema v;
6+
create table v.account(
7+
id int,
8+
name text,
9+
password text,
10+
description text
11+
);
12+
insert into v.account (id, name, password, description)
13+
values (1, 'user1', 'HASH1', 'blah, blah');
14+
select
15+
*
16+
from
17+
v.account;
18+
id | name | password | description
19+
----+-------+----------+-------------
20+
1 | user1 | HASH1 | blah, blah
21+
(1 row)
22+
23+
drop schema v cascade;
24+
NOTICE: drop cascades to table v.account

nix/tests/sql/pgaudit.sql

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
-- Note: there is no test that the logs were correctly output. Only checking for exceptions
2+
set pgaudit.log = 'write, ddl';
3+
set pgaudit.log_relation = on;
4+
set pgaudit.log_level = notice;
5+
6+
create schema v;
7+
8+
create table v.account(
9+
id int,
10+
name text,
11+
password text,
12+
description text
13+
);
14+
15+
insert into v.account (id, name, password, description)
16+
values (1, 'user1', 'HASH1', 'blah, blah');
17+
18+
select
19+
*
20+
from
21+
v.account;
22+
23+
drop schema v cascade;

0 commit comments

Comments
 (0)
0