Merge large_object.sql test into largeobject.source.
authorTom Lane
Mon, 17 Jul 2017 19:28:17 +0000 (15:28 -0400)
committerTom Lane
Mon, 17 Jul 2017 19:28:17 +0000 (15:28 -0400)
It seems pretty confusing to have tests named both largeobject and
large_object.  The latter is of very recent vintage (commit ff992c074),
so get rid of it in favor of merging into the former.

Also, enable the LO comment test that was added by commit 70ad7ed4e,
since the later commit added the then-missing pg_upgrade functionality.
The large_object.sql test case is almost completely redundant with that,
but not quite: it seems like creating a user-defined LO with an OID in
the system range might be an interesting case for pg_upgrade, so let's
keep it.

Like the earlier patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/18665.1500306372@sss.pgh.pa.us

src/test/regress/expected/large_object.out [deleted file]
src/test/regress/input/largeobject.source
src/test/regress/output/largeobject.source
src/test/regress/output/largeobject_1.source
src/test/regress/parallel_schedule
src/test/regress/serial_schedule
src/test/regress/sql/large_object.sql [deleted file]

diff --git a/src/test/regress/expected/large_object.out b/src/test/regress/expected/large_object.out
deleted file mode 100644 (file)
index b00d47c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
--- This is more-or-less DROP IF EXISTS LARGE OBJECT 3001;
-WITH unlink AS (SELECT lo_unlink(loid) FROM pg_largeobject WHERE loid = 3001) SELECT 1;
- ?column? 
-----------
-        1
-(1 row)
-
--- Test creation of a large object and leave it for testing pg_upgrade
-SELECT lo_create(3001);
- lo_create 
------------
-      3001
-(1 row)
-
-COMMENT ON LARGE OBJECT 3001 IS 'testing comments';
index a19959a1b8757782b4752aed7de54e227ee9d662..50c13eb4f3ce4192bc27bcd263e2dfdf572f885a 100644 (file)
@@ -86,10 +86,8 @@ END;
 SELECT lo_from_bytea(0, lo_get(loid)) AS newloid FROM lotest_stash_values
 \gset
 
--- Ideally we'd put a comment on this object for pg_dump testing purposes.
--- But since pg_upgrade fails to preserve large object comments, doing so
--- would break pg_upgrade's regression test.
--- COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
+-- Add a comment to it, as well, for pg_dump/pg_upgrade testing.
+COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
 
 -- Read out a portion
 BEGIN;
@@ -253,6 +251,13 @@ SELECT lo_from_bytea(0, E'\\xdeadbeef') AS newloid
 SET bytea_output TO hex;
 SELECT lo_get(:newloid);
 
+-- Create one more object that we leave behind for testing pg_dump/pg_upgrade;
+-- this one intentionally has an OID in the system range
+SELECT lo_create(3001);
+
+COMMENT ON LARGE OBJECT 3001 IS 'testing comments';
+
+-- Clean up
 DROP TABLE lotest_stash_values;
 
 DROP ROLE regresslo;
index 8b34ac491b4fc77d2cd1a46174ab43e177791caf..afdcb4b7dd01ace288151ace59df67714f7662db 100644 (file)
@@ -90,10 +90,8 @@ END;
 -- it's left behind to help test pg_dump.
 SELECT lo_from_bytea(0, lo_get(loid)) AS newloid FROM lotest_stash_values
 \gset
--- Ideally we'd put a comment on this object for pg_dump testing purposes.
--- But since pg_upgrade fails to preserve large object comments, doing so
--- would break pg_upgrade's regression test.
--- COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
+-- Add a comment to it, as well, for pg_dump/pg_upgrade testing.
+COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
 -- Read out a portion
 BEGIN;
 UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer));
@@ -469,5 +467,15 @@ SELECT lo_get(:newloid);
  \xdeadbeef
 (1 row)
 
+-- Create one more object that we leave behind for testing pg_dump/pg_upgrade;
+-- this one intentionally has an OID in the system range
+SELECT lo_create(3001);
+ lo_create 
+-----------
+      3001
+(1 row)
+
+COMMENT ON LARGE OBJECT 3001 IS 'testing comments';
+-- Clean up
 DROP TABLE lotest_stash_values;
 DROP ROLE regresslo;
index 5167a0141834ee4e5073702f5a9e6fcf04adc9a2..86aa3c003224756630662358d5bce206f3fd0e4a 100644 (file)
@@ -90,10 +90,8 @@ END;
 -- it's left behind to help test pg_dump.
 SELECT lo_from_bytea(0, lo_get(loid)) AS newloid FROM lotest_stash_values
 \gset
--- Ideally we'd put a comment on this object for pg_dump testing purposes.
--- But since pg_upgrade fails to preserve large object comments, doing so
--- would break pg_upgrade's regression test.
--- COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
+-- Add a comment to it, as well, for pg_dump/pg_upgrade testing.
+COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
 -- Read out a portion
 BEGIN;
 UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer));
@@ -469,5 +467,15 @@ SELECT lo_get(:newloid);
  \xdeadbeef
 (1 row)
 
+-- Create one more object that we leave behind for testing pg_dump/pg_upgrade;
+-- this one intentionally has an OID in the system range
+SELECT lo_create(3001);
+ lo_create 
+-----------
+      3001
+(1 row)
+
+COMMENT ON LARGE OBJECT 3001 IS 'testing comments';
+-- Clean up
 DROP TABLE lotest_stash_values;
 DROP ROLE regresslo;
index a2c9da16ad523733ae53837037e295e27ca6b280..8031489bd099eba2ed94b3873ef02447d4666d72 100644 (file)
@@ -83,7 +83,7 @@ test: select_into select_distinct select_distinct_on select_implicit select_havi
 # ----------
 # Another group of parallel tests
 # ----------
-test: privileges security_label collate matview lock replica_identity large_object
+test: privileges security_label collate matview lock replica_identity
 
 # ----------
 # Another group of parallel tests
index 8f3e9c0f3e4069350949c60cb374532f13b17eba..a04dc91ffe9577e308ef27c304aabef8947a5886 100644 (file)
@@ -101,7 +101,6 @@ test: collate
 test: matview
 test: lock
 test: replica_identity
-test: large_object
 test: alter_generic
 test: misc
 test: psql
diff --git a/src/test/regress/sql/large_object.sql b/src/test/regress/sql/large_object.sql
deleted file mode 100644 (file)
index c06b393..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
--- This is more-or-less DROP IF EXISTS LARGE OBJECT 3001;
-WITH unlink AS (SELECT lo_unlink(loid) FROM pg_largeobject WHERE loid = 3001) SELECT 1;
-
--- Test creation of a large object and leave it for testing pg_upgrade
-SELECT lo_create(3001);
-
-COMMENT ON LARGE OBJECT 3001 IS 'testing comments';