]> granicus.if.org Git - postgresql/commitdiff
Merge large_object.sql test into largeobject.source.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 17 Jul 2017 19:28:16 +0000 (15:28 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 17 Jul 2017 19:28:16 +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 96d75bccfbb091b45ec0e119b3b9a2f868d479ab..b7a9d052bde84aef41d805ec5b82752f049fcdf4 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 regress_lo_user;
index 906a24eac4212199aaf0672e0152df0b5e38c96f..e29f5423aa3991bd6d51e49392c87c3a599987c2 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 regress_lo_user;
index cec35d70d597f57c7656ae8eb5e31948c0a192a8..6fd8cbe09800f460dca4e0f9469ae1d4ba610737 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 regress_lo_user;
index 0d68bcf9a4fa2863bc424e218c0a9807d7b8e942..3815182fe7a8b14b3d89bd0d052ddc342aeb9939 100644 (file)
@@ -84,7 +84,7 @@ test: select_into select_distinct select_distinct_on select_implicit select_havi
 # ----------
 # Another group of parallel tests
 # ----------
-test: brin gin gist spgist privileges init_privs security_label collate matview lock replica_identity rowsecurity object_address tablesample groupingsets drop_operator large_object
+test: brin gin gist spgist privileges init_privs security_label collate matview lock replica_identity rowsecurity object_address tablesample groupingsets drop_operator
 
 # ----------
 # Another group of parallel tests
index 17f1d855bcf2722daf63321974bce599abaca150..8958d8cdb9d29a46f6bc21a6b0069390794c41e1 100644 (file)
@@ -116,7 +116,6 @@ test: object_address
 test: tablesample
 test: groupingsets
 test: drop_operator
-test: large_object
 test: alter_generic
 test: alter_operator
 test: misc
diff --git a/src/test/regress/sql/large_object.sql b/src/test/regress/sql/large_object.sql
deleted file mode 100644 (file)
index a9e18b7..0000000
+++ /dev/null
@@ -1,8 +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';