10000 add pg-safeupdate tests · archiveproject/postgres@7d289ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d289ba

Browse files
oliricedarora
authored andcommitted
add pg-safeupdate tests
1 parent ab1aeca commit 7d289ba

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

nix/tests/expected/pg-safeupdate.out

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
load 'safeupdate';
2+
set safeupdate.enabled=1;
3+
create schema v;
4+
create table v.foo(
5+
id int,
6+
val text
7+
);
8+
update v.foo
9+
set val = 'bar';
10+
ERROR: UPDATE requires a WHERE clause
11+
drop schema v cascade;
12+
NOTICE: drop cascades to table v.foo

nix/tests/sql/pg-safeupdate.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
load 'safeupdate';
2+
3+
set safeupdate.enabled=1;
4+
5+
create schema v;
6+
7+
create table v.foo(
8+
id int,
9+
val text
10+
);
11+
12+
update v.foo
13+
set val = 'bar';
14+
15+
drop schema v cascade;

0 commit comments

Comments
 (0)
0