--
-- This runs some common tests against the type
--
-- It's used just for development
--
-- XXX would be nice to turn this into a proper regression test
--

-- Check what is in pg_largeobject
SELECT count(DISTINCT loid) FROM pg_largeobject;
SELECT pg_relation_size('pg_largeobject');

-- create the test table
CREATE TABLE a (fname name,image lo);

-- insert a null object
INSERT INTO a VALUES ('empty');

-- insert a large object based on a file
INSERT INTO a VALUES ('jlo', lo_import('/tmp/jlo')::lo);
INSERT INTO a VALUES ('halo', lo_import('/tmp/jlo')::lo);

-- Check what is in pg_largeobject ... if different from original, trouble
SELECT count(DISTINCT loid) FROM pg_largeobject;
SELECT pg_relation_size('pg_largeobject');
-- end of tests
