tests: Add tests for the pg-safeupdate library

This commit is contained in:
Laurence Isla
2022-08-10 11:50:57 -05:00
committed by GitHub
parent 57bc3d805c
commit 4ac47df528
8 changed files with 151 additions and 24 deletions
+27
View File
@@ -2689,3 +2689,30 @@ $$ LANGUAGE sql;
CREATE TABLE do$llar$s (
a$num$ numeric
);
-- Tables and functions to test the pg-safeupdate library
CREATE TABLE test.safe_update(
id INT PRIMARY KEY,
name TEXT
);
CREATE TABLE test.safe_delete(
id INT PRIMARY KEY,
name TEXT
);
CREATE TABLE test.unsafe_update(
id INT PRIMARY KEY,
name TEXT
);
CREATE TABLE test.unsafe_delete(
id INT PRIMARY KEY,
name TEXT
);
CREATE OR REPLACE FUNCTION test.load_safeupdate() RETURNS VOID AS $$
BEGIN
LOAD 'safeupdate';
END; $$ LANGUAGE plpgsql SECURITY DEFINER;