Skip to content

Commit a6de8d0

Browse files
committed
Merge large_object.sql test into largeobject.source.
It seems pretty confusing to have tests named both largeobject and large_object. The latter is of very recent vintage (commit ff992c0), so get rid of it in favor of merging into the former. Also, enable the LO comment test that was added by commit 70ad7ed, 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
1 parent f5b2f27 commit a6de8d0

File tree

7 files changed

+34
-36
lines changed

7 files changed

+34
-36
lines changed

src/test/regress/expected/large_object.out

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/test/regress/input/largeobject.source

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,8 @@ END;
8686
SELECT lo_from_bytea(0, lo_get(loid)) AS newloid FROM lotest_stash_values
8787
\gset
8888

89-
-- Ideally we'd put a comment on this object for pg_dump testing purposes.
90-
-- But since pg_upgrade fails to preserve large object comments, doing so
91-
-- would break pg_upgrade's regression test.
92-
-- COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
89+
-- Add a comment to it, as well, for pg_dump/pg_upgrade testing.
90+
COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
9391

9492
-- Read out a portion
9593
BEGIN;
@@ -253,6 +251,13 @@ SELECT lo_from_bytea(0, E'\\xdeadbeef') AS newloid
253251
SET bytea_output TO hex;
254252
SELECT lo_get(:newloid);
255253

254+
-- Create one more object that we leave behind for testing pg_dump/pg_upgrade;
255+
-- this one intentionally has an OID in the system range
256+
SELECT lo_create(3001);
257+
258+
COMMENT ON LARGE OBJECT 3001 IS 'testing comments';
259+
260+
-- Clean up
256261
DROP TABLE lotest_stash_values;
257262

258263
DROP ROLE regresslo;

src/test/regress/output/largeobject.source

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ END;
9090
-- it's left behind to help test pg_dump.
9191
SELECT lo_from_bytea(0, lo_get(loid)) AS newloid FROM lotest_stash_values
9292
\gset
93-
-- Ideally we'd put a comment on this object for pg_dump testing purposes.
94-
-- But since pg_upgrade fails to preserve large object comments, doing so
95-
-- would break pg_upgrade's regression test.
96-
-- COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
93+
-- Add a comment to it, as well, for pg_dump/pg_upgrade testing.
94+
COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
9795
-- Read out a portion
9896
BEGIN;
9997
UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer));
@@ -469,5 +467,15 @@ SELECT lo_get(:newloid);
469467
\xdeadbeef
470468
(1 row)
471469

470+
-- Create one more object that we leave behind for testing pg_dump/pg_upgrade;
471+
-- this one intentionally has an OID in the system range
472+
SELECT lo_create(3001);
473+
lo_create
474+
-----------
475+
3001
476+
(1 row)
477+
478+
COMMENT ON LARGE OBJECT 3001 IS 'testing comments';
479+
-- Clean up
472480
DROP TABLE lotest_stash_values;
473481
DROP ROLE regresslo;

src/test/regress/output/largeobject_1.source

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ END;
9090
-- it's left behind to help test pg_dump.
9191
SELECT lo_from_bytea(0, lo_get(loid)) AS newloid FROM lotest_stash_values
9292
\gset
93-
-- Ideally we'd put a comment on this object for pg_dump testing purposes.
94-
-- But since pg_upgrade fails to preserve large object comments, doing so
95-
-- would break pg_upgrade's regression test.
96-
-- COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
93+
-- Add a comment to it, as well, for pg_dump/pg_upgrade testing.
94+
COMMENT ON LARGE OBJECT :newloid IS 'I Wandered Lonely as a Cloud';
9795
-- Read out a portion
9896
BEGIN;
9997
UPDATE lotest_stash_values SET fd=lo_open(loid, CAST(x'20000' | x'40000' AS integer));
@@ -469,5 +467,15 @@ SELECT lo_get(:newloid);
469467
\xdeadbeef
470468
(1 row)
471469

470+
-- Create one more object that we leave behind for testing pg_dump/pg_upgrade;
471+
-- this one intentionally has an OID in the system range
472+
SELECT lo_create(3001);
473+
lo_create
474+
-----------
475+
3001
476+
(1 row)
477+
478+
COMMENT ON LARGE OBJECT 3001 IS 'testing comments';
479+
-- Clean up
472480
DROP TABLE lotest_stash_values;
473481
DROP ROLE regresslo;

src/test/regress/parallel_schedule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ test: select_into select_distinct select_distinct_on select_implicit select_havi
8383
# ----------
8484
# Another group of parallel tests
8585
# ----------
86-
test: privileges security_label collate matview lock replica_identity large_object
86+
test: privileges security_label collate matview lock replica_identity
8787

8888
# ----------
8989
# Another group of parallel tests

src/test/regress/serial_schedule

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ test: collate
101101
test: matview
102102
test: lock
103103
test: replica_identity
104-
test: large_object
105104
test: alter_generic
106105
test: misc
107106
test: psql

src/test/regress/sql/large_object.sql

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)