1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

lo: Add test suite

Reviewed-by: David Steele <david@pgmasters.net>
This commit is contained in:
Peter Eisentraut
2017-08-11 21:04:04 -04:00
parent 6141123a82
commit 4cb89d8306
5 changed files with 74 additions and 1 deletions

25
contrib/lo/sql/lo.sql Normal file
View File

@ -0,0 +1,25 @@
CREATE EXTENSION lo;
CREATE TABLE image (title text, raster lo);
CREATE TRIGGER t_raster BEFORE UPDATE OR DELETE ON image
FOR EACH ROW EXECUTE PROCEDURE lo_manage(raster);
SELECT lo_create(43213);
SELECT lo_create(43214);
INSERT INTO image (title, raster) VALUES ('beautiful image', 43213);
SELECT lo_get(43213);
SELECT lo_get(43214);
UPDATE image SET raster = 43214 WHERE title = 'beautiful image';
SELECT lo_get(43213);
SELECT lo_get(43214);
DELETE FROM image;
SELECT lo_get(43214);
DROP TABLE image;