@@ -354,13 +354,13 @@ def test_foreign_table(self):
354354 master .psql ('postgres' , 'create extension pg_pathman' )
355355 master .psql ('postgres' , 'create extension postgres_fdw' )
356356
357- # RANGE partitioning test with FDW:
358- # - create range partitioned table in master
359- # - create foreign server
360- # - create foreign table and insert some data into it
361- # - attach foreign table to partitioned one
362- # - try inserting data into foreign partition via parent
363- # - drop partitions
357+ # RANGE partitioning test with FDW:
358+ # - create range partitioned table in master
359+ # - create foreign server
360+ # - create foreign table and insert some data into it
361+ # - attach foreign table to partitioned one
362+ # - try inserting data into foreign partition via parent
363+ # - drop partitions
364364 master .psql (
365365 'postgres' ,
366366 '''create table abc(id serial, name text);
@@ -413,33 +413,33 @@ def test_foreign_table(self):
413413 # Testing drop partitions (including foreign partitions)
414414 master .safe_psql ('postgres' , 'select drop_partitions(\' abc\' )' )
415415
416- # HASH partitioning with FDW:
417- # - create hash partitioned table in master
418- # - create foreign table
419- # - replace local partition with foreign one
420- # - insert data
421- # - drop partitions
422- master .psql (
423- 'postgres' ,
424- '''create table hash_test(id serial, name text);
425- select create_hash_partitions('hash_test', 'id', 2)''' )
426- fserv .safe_psql ('postgres' , 'create table f_hash_test(id serial, name text)' )
427-
428- master .safe_psql (
429- 'postgres' ,
430- '''import foreign schema public limit to (f_hash_test)
431- from server fserv into public'''
432- )
433- master .safe_psql (
434- 'postgres' ,
435- 'select replace_hash_partition(\' hash_test_1\' , \' f_hash_test\' )' )
436- master .safe_psql ('postgres' , 'insert into hash_test select generate_series(1,10)' )
437-
438- self .assertEqual (
439- master .safe_psql ('postgres' , 'select * from hash_test' ),
440- '1|\n 2|\n 5|\n 6|\n 8|\n 9|\n 3|\n 4|\n 7|\n 10|\n '
441- )
442- master .safe_psql ('postgres' , 'select drop_partitions(\' hash_test\' )' )
416+ # HASH partitioning with FDW:
417+ # - create hash partitioned table in master
418+ # - create foreign table
419+ # - replace local partition with foreign one
420+ # - insert data
421+ # - drop partitions
422+ master .psql (
423+ 'postgres' ,
424+ '''create table hash_test(id serial, name text);
425+ select create_hash_partitions('hash_test', 'id', 2)''' )
426+ fserv .safe_psql ('postgres' , 'create table f_hash_test(id serial, name text)' )
427+
428+ master .safe_psql (
429+ 'postgres' ,
430+ '''import foreign schema public limit to (f_hash_test)
431+ from server fserv into public'''
432+ )
433+ master .safe_psql (
434+ 'postgres' ,
435+ 'select replace_hash_partition(\' hash_test_1\' , \' f_hash_test\' )' )
436+ master .safe_psql ('postgres' , 'insert into hash_test select generate_series(1,10)' )
437+
438+ self .assertEqual (
439+ master .safe_psql ('postgres' , 'select * from hash_test' ),
440+ '1|\n 2|\n 5|\n 6|\n 8|\n 9|\n 3|\n 4|\n 7|\n 10|\n '
441+ )
442+ master .safe_psql ('postgres' , 'select drop_partitions(\' hash_test\' )' )
443443
444444 def test_parallel_nodes (self ):
445445 """Test parallel queries under partitions"""
0 commit comments