This is an automated email from the ASF dual-hosted git repository.

chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/cbdb-postgres-merge by this 
push:
     new 3e3ec067697 Fix answer file for copy
3e3ec067697 is described below

commit 3e3ec067697b29658841de3a391f57217157e497
Author: Jinbao Chen <[email protected]>
AuthorDate: Thu Nov 6 21:49:46 2025 +0800

    Fix answer file for copy
---
 src/test/regress/expected/copy.out  |  15 +-
 src/test/regress/input/misc.source  | 266 ----------------
 src/test/regress/output/copy.source | 358 ---------------------
 src/test/regress/output/misc.source | 611 ------------------------------------
 src/test/regress/serial_schedule    |   2 +-
 src/test/regress/sql/copy.sql       | 181 -----------
 6 files changed, 9 insertions(+), 1424 deletions(-)

diff --git a/src/test/regress/expected/copy.out 
b/src/test/regress/expected/copy.out
index b48365ec981..a727d17eb8a 100644
--- a/src/test/regress/expected/copy.out
+++ b/src/test/regress/expected/copy.out
@@ -18,7 +18,7 @@ insert into copytest 
values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',4);
 copy copytest to :'filename' csv;
 create temp table copytest2 (like copytest);
 copy copytest2 from :'filename' csv;
-select * from copytest except select * from copytest2;
+select * from copytest except select * from copytest2 order by 1,2,3;
  style | test | filler 
 -------+------+--------
 (0 rows)
@@ -27,7 +27,7 @@ truncate copytest2;
 --- same test but with an escape char different from quote char
 copy copytest to :'filename' csv quote '''' escape E'\\';
 copy copytest2 from :'filename' csv quote '''' escape E'\\';
-select * from copytest except select * from copytest2;
+select * from copytest except select * from copytest2 order by 1,2,3;
  style | test | filler 
 -------+------+--------
 (0 rows)
@@ -36,7 +36,7 @@ select * from copytest except select * from copytest2;
 create temp table copytest3 (
        c1 int,
        "col with , comma" text,
-       "col with "" quote"  int);
+       "col with "" quote"  int) distributed by (c1);
 copy copytest3 from stdin csv header;
 copy copytest3 to stdout csv header;
 c1,"col with , comma","col with "" quote"
@@ -47,9 +47,9 @@ create temp table copytest4 (
        "colname with tab:      " text);
 copy copytest4 from stdin (header);
 copy copytest4 to stdout (header);
-c1     colname with tab: \t
-1      a
+c1     "colname with tab:      "
 2      b
+1      a
 -- test copy from with a partitioned table
 create table parted_copytest (
        a int,
@@ -58,6 +58,7 @@ create table parted_copytest (
 ) partition by list (b);
 create table parted_copytest_a1 (c text, b int, a int);
 create table parted_copytest_a2 (a int, c text, b int);
+alter table parted_copytest_a1 set distributed by (a);
 alter table parted_copytest attach partition parted_copytest_a1 for values 
in(1);
 alter table parted_copytest attach partition parted_copytest_a2 for values 
in(2);
 -- We must insert enough rows to trigger multi-inserts.  These are only
@@ -164,16 +165,16 @@ create trigger check_after_tab_progress_reporting
        after insert on tab_progress_reporting
        for each statement
        execute function notice_after_tab_progress_reporting();
+ERROR:  Triggers for statements are not yet supported
 -- Generate COPY FROM report with PIPE.
 copy tab_progress_reporting from stdin;
-INFO:  progress: {"type": "PIPE", "command": "COPY FROM", "relname": 
"tab_progress_reporting", "has_bytes_total": false, "tuples_excluded": 0, 
"tuples_processed": 3, "has_bytes_processed": true}
 -- Generate COPY FROM report with FILE, with some excluded tuples.
 truncate tab_progress_reporting;
 \set filename :abs_srcdir '/data/emp.data'
 copy tab_progress_reporting from :'filename'
        where (salary < 2000);
-INFO:  progress: {"type": "FILE", "command": "COPY FROM", "relname": 
"tab_progress_reporting", "has_bytes_total": true, "tuples_excluded": 1, 
"tuples_processed": 2, "has_bytes_processed": true}
 drop trigger check_after_tab_progress_reporting on tab_progress_reporting;
+ERROR:  trigger "check_after_tab_progress_reporting" for table 
"tab_progress_reporting" does not exist
 drop function notice_after_tab_progress_reporting();
 drop table tab_progress_reporting;
 -- Test header matching feature
diff --git a/src/test/regress/input/misc.source 
b/src/test/regress/input/misc.source
deleted file mode 100644
index 331499a2aba..00000000000
--- a/src/test/regress/input/misc.source
+++ /dev/null
@@ -1,266 +0,0 @@
---
--- MISC
---
-
---
--- BTREE
---
---UPDATE onek
---   SET unique1 = onek.unique1 + 1;
-
---UPDATE onek
---   SET unique1 = onek.unique1 - 1;
-
---
--- BTREE partial
---
--- UPDATE onek2
---   SET unique1 = onek2.unique1 + 1;
-
---UPDATE onek2
---   SET unique1 = onek2.unique1 - 1;
-
---
--- BTREE shutting out non-functional updates
---
--- the following two tests seem to take a long time on some
--- systems.    This non-func update stuff needs to be examined
--- more closely.                       - jolly (2/22/96)
---
-/* GPDB TODO: This test is disabled for now, because when running with ORCA,
-   you get an error:
-     ERROR:  multiple updates to a row by the same query is not allowed
-UPDATE tmp
-   SET stringu1 = reverse_name(onek.stringu1)
-   FROM onek
-   WHERE onek.stringu1 = 'JBAAAA' and
-         onek.stringu1 = tmp.stringu1;
-
-UPDATE tmp
-   SET stringu1 = reverse_name(onek2.stringu1)
-   FROM onek2
-   WHERE onek2.stringu1 = 'JCAAAA' and
-         onek2.stringu1 = tmp.stringu1;
-*/
-
-DROP TABLE tmp;
-
---UPDATE person*
---   SET age = age + 1;
-
---UPDATE person*
---   SET age = age + 3
---   WHERE name = 'linda';
-
---
--- copy
---
-COPY onek TO '@abs_builddir@/results/onek.data';
-
-DELETE FROM onek;
-
-COPY onek FROM '@abs_builddir@/results/onek.data';
-
-SELECT unique1 FROM onek WHERE unique1 < 2 ORDER BY unique1;
-
-DELETE FROM onek2;
-
-COPY onek2 FROM '@abs_builddir@/results/onek.data';
-
-SELECT unique1 FROM onek2 WHERE unique1 < 2 ORDER BY unique1;
-
-COPY BINARY stud_emp TO '@abs_builddir@/results/stud_emp.data';
-
-DELETE FROM stud_emp;
-
-COPY BINARY stud_emp FROM '@abs_builddir@/results/stud_emp.data';
-
-SELECT * FROM stud_emp;
-
--- COPY aggtest FROM stdin;
--- 56  7.8
--- 100 99.097
--- 0   0.09561
--- 42  324.78
--- .
--- COPY aggtest TO stdout;
-
-
---
--- inheritance stress test
---
-SELECT * FROM a_star*;
-
-SELECT *
-   FROM b_star* x
-   WHERE x.b = text 'bumble' or x.a < 3;
-
-SELECT class, a
-   FROM c_star* x
-   WHERE x.c ~ text 'hi';
-
-SELECT class, b, c
-   FROM d_star* x
-   WHERE x.a < 100;
-
-SELECT class, c FROM e_star* x WHERE x.c NOTNULL;
-
-SELECT * FROM f_star* x WHERE x.c ISNULL;
-
--- grouping and aggregation on inherited sets have been busted in the past...
-
-SELECT sum(a) FROM a_star*;
-
-SELECT class, sum(a) FROM a_star* GROUP BY class ORDER BY class;
-
-
-ALTER TABLE f_star RENAME COLUMN f TO ff;
-
-ALTER TABLE e_star* RENAME COLUMN e TO ee;
-
-ALTER TABLE d_star* RENAME COLUMN d TO dd;
-
-ALTER TABLE c_star* RENAME COLUMN c TO cc;
-
-ALTER TABLE b_star* RENAME COLUMN b TO bb;
-
-ALTER TABLE a_star* RENAME COLUMN a TO aa;
-
-SELECT class, aa
-   FROM a_star* x
-   WHERE aa ISNULL;
-
--- As of Postgres 7.1, ALTER implicitly recurses,
--- so this should be same as ALTER a_star*
-
-ALTER TABLE a_star RENAME COLUMN aa TO foo;
-
-SELECT class, foo
-   FROM a_star* x
-   WHERE x.foo >= 2;
-
-ALTER TABLE a_star RENAME COLUMN foo TO aa;
-
-SELECT *
-   from a_star*
-   WHERE aa < 1000;
-
-ALTER TABLE f_star ADD COLUMN f int4;
-
-UPDATE f_star SET f = 10;
-
-ALTER TABLE e_star* ADD COLUMN e int4;
-
---UPDATE e_star* SET e = 42;
-
-SELECT * FROM e_star*;
-
-ALTER TABLE a_star* ADD COLUMN a text;
-
--- That ALTER TABLE should have added TOAST tables.
-SELECT relname, reltoastrelid <> 0 AS has_toast_table
-   FROM pg_class
-   WHERE oid::regclass IN ('a_star', 'c_star')
-   ORDER BY 1;
-
---UPDATE b_star*
---   SET a = text 'gazpacho'
---   WHERE aa > 4;
-
-SELECT class, aa, a FROM a_star*;
-
-
---
--- versions
---
-
---
--- postquel functions
---
---
--- mike does post_hacking,
--- joe and sally play basketball, and
--- everyone else does nothing.
---
-SELECT p.name, name(p.hobbies) FROM ONLY person p;
-
---
--- as above, but jeff also does post_hacking.
---
-SELECT p.name, name(p.hobbies) FROM person* p;
-
---
--- the next two queries demonstrate how functions generate bogus duplicates.
--- this is a "feature" ..
---
-SELECT DISTINCT hobbies_r.name, name(hobbies_r.equipment) FROM hobbies_r
-  ORDER BY 1,2;
-
-SELECT hobbies_r.name, (hobbies_r.equipment).name FROM hobbies_r;
-
---
--- mike needs advil and peet's coffee,
--- joe and sally need hightops, and
--- everyone else is fine.
---
-SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM ONLY person p;
-
---
--- as above, but jeff needs advil and peet's coffee as well.
---
-SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM person* p;
-
---
--- just like the last two, but make sure that the target list fixup and
--- unflattening is being done correctly.
---
-SELECT name(equipment(p.hobbies)), p.name, name(p.hobbies) FROM ONLY person p;
-
-SELECT (p.hobbies).equipment.name, p.name, name(p.hobbies) FROM person* p;
-
-SELECT (p.hobbies).equipment.name, name(p.hobbies), p.name FROM ONLY person p;
-
-SELECT name(equipment(p.hobbies)), name(p.hobbies), p.name FROM person* p;
-
-SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer')));
-
-SELECT name(equipment(hobby_construct_named(text 'skywalking', text 'mer')));
-
-SELECT name(equipment_named(hobby_construct_named(text 'skywalking', text 
'mer')));
-
-SELECT name(equipment_named_ambiguous_1a(hobby_construct_named(text 
'skywalking', text 'mer')));
-
-SELECT name(equipment_named_ambiguous_1b(hobby_construct_named(text 
'skywalking', text 'mer')));
-
-SELECT name(equipment_named_ambiguous_1c(hobby_construct_named(text 
'skywalking', text 'mer')));
-
-SELECT name(equipment_named_ambiguous_2a(text 'skywalking'));
-
-SELECT name(equipment_named_ambiguous_2b(text 'skywalking'));
-
-SELECT hobbies_by_name('basketball');
-
-SELECT name, overpaid(emp.*) FROM emp;
-
---
--- Try a few cases with SQL-spec row constructor expressions
---
-SELECT * FROM equipment(ROW('skywalking', 'mer'));
-
-SELECT name(equipment(ROW('skywalking', 'mer')));
-
-SELECT *, name(equipment(h.*)) FROM hobbies_r h;
-
-SELECT *, (equipment(CAST((h.*) AS hobbies_r))).name FROM hobbies_r h;
-
---
--- functional joins
---
-
---
--- instance rules
---
-
---
--- rewrite rules
---
diff --git a/src/test/regress/output/copy.source 
b/src/test/regress/output/copy.source
deleted file mode 100644
index 5e037d77ecc..00000000000
--- a/src/test/regress/output/copy.source
+++ /dev/null
@@ -1,358 +0,0 @@
---
--- COPY
---
--- CLASS POPULATION
---     (any resemblance to real life is purely coincidental)
---
-COPY aggtest FROM '@abs_srcdir@/data/agg.data';
-COPY onek FROM '@abs_srcdir@/data/onek.data';
-COPY onek TO '@abs_builddir@/results/onek.data';
-DELETE FROM onek;
-COPY onek FROM '@abs_builddir@/results/onek.data';
-COPY tenk1 FROM '@abs_srcdir@/data/tenk.data';
--- Create a table that's identical to 'tenk1', but all the data is in a single
--- segment. This comes handy in making some PostgreSQL tests pass on GPDB,
--- where data distribution might make a difference to a test result.
-CREATE SCHEMA singleseg;
-create table singleseg.tenk1 (like tenk1, distkey int4) distributed by 
(distkey);
-COPY singleseg.tenk1 
(unique1,unique2,two,four,ten,twenty,hundred,thousand,twothousand,fivethous,tenthous,odd,even,stringu1,stringu2,string4)
 FROM '@abs_srcdir@/data/tenk.data';
-COPY slow_emp4000 FROM '@abs_srcdir@/data/rect.data';
-COPY person FROM '@abs_srcdir@/data/person.data';
-COPY emp FROM '@abs_srcdir@/data/emp.data';
-COPY student FROM '@abs_srcdir@/data/student.data';
-COPY stud_emp FROM '@abs_srcdir@/data/stud_emp.data';
-COPY road FROM '@abs_srcdir@/data/streets.data';
-COPY real_city FROM '@abs_srcdir@/data/real_city.data';
-COPY hash_i4_heap FROM '@abs_srcdir@/data/hash.data';
-COPY hash_name_heap FROM '@abs_srcdir@/data/hash.data';
-COPY hash_txt_heap FROM '@abs_srcdir@/data/hash.data';
-COPY hash_f8_heap FROM '@abs_srcdir@/data/hash.data';
-COPY test_tsvector FROM '@abs_srcdir@/data/tsearch.data';
-COPY testjsonb FROM '@abs_srcdir@/data/jsonb.data';
--- the data in this file has a lot of duplicates in the index key
--- fields, leading to long bucket chains and lots of table expansion.
--- this is therefore a stress test of the bucket overflow code (unlike
--- the data in hash.data, which has unique index keys).
---
--- COPY hash_ovfl_heap FROM '@abs_srcdir@/data/hashovfl.data';
-COPY bt_i4_heap FROM '@abs_srcdir@/data/desc.data';
-COPY bt_name_heap FROM '@abs_srcdir@/data/hash.data';
-COPY bt_txt_heap FROM '@abs_srcdir@/data/desc.data';
-COPY bt_f8_heap FROM '@abs_srcdir@/data/hash.data';
-COPY array_op_test FROM '@abs_srcdir@/data/array.data';
-COPY array_index_op_test FROM '@abs_srcdir@/data/array.data';
--- analyze all the data we just loaded, to ensure plan consistency
--- in later tests
--- Force pgstat_report_stat() to send tabstat before pgstat_report_analyze.
--- Nomally this is no needed, but ORCA is very sensitive for statistics.
--- If analyze msg recevied first, n_mod_since_analyze will not be 0.
--- And since we create index for some tables later, the triggered auto-ANALYZE
--- will cause table's index statstics change and ORCA may generate different
--- plans for some queries.
-select pg_sleep(0.77);
- pg_sleep 
-----------
- 
-(1 row)
-
-ANALYZE aggtest;
-ANALYZE onek;
-ANALYZE tenk1;
-ANALYZE slow_emp4000;
-ANALYZE person;
-ANALYZE emp;
-ANALYZE student;
-ANALYZE stud_emp;
-ANALYZE road;
-ANALYZE real_city;
-ANALYZE hash_i4_heap;
-ANALYZE hash_name_heap;
-ANALYZE hash_txt_heap;
-ANALYZE hash_f8_heap;
-ANALYZE test_tsvector;
-ANALYZE testjsonb;
-ANALYZE bt_i4_heap;
-ANALYZE bt_name_heap;
-ANALYZE bt_txt_heap;
-ANALYZE bt_f8_heap;
-ANALYZE array_op_test;
-ANALYZE array_index_op_test;
---- test copying in CSV mode with various styles
---- of embedded line ending characters
-create temp table copytest (
-       style   text,
-       test    text,
-       filler  int);
-insert into copytest values('DOS',E'abc\r\ndef',1);
-insert into copytest values('Unix',E'abc\ndef',2);
-insert into copytest values('Mac',E'abc\rdef',3);
-insert into copytest values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',4);
-copy copytest to '@abs_builddir@/results/copytest.csv' csv;
-create temp table copytest2 (like copytest);
-copy copytest2 from '@abs_builddir@/results/copytest.csv' csv;
-copy copytest2 from '@abs_builddir@/results/copytest.csv' csv LOG ERRORS 
SEGMENT REJECT LIMIT 10 ROWS;
-select * from copytest except select * from copytest2 order by 1,2,3;
- style | test | filler 
--------+------+--------
-(0 rows)
-
-truncate copytest2;
---- same test but with an escape char different from quote char
-copy copytest to '@abs_builddir@/results/copytest.csv' csv quote '''' escape 
E'\\';
-copy copytest2 from '@abs_builddir@/results/copytest.csv' csv quote '''' 
escape E'\\';
-select * from copytest except select * from copytest2 order by 1,2,3;
- style | test | filler 
--------+------+--------
-(0 rows)
-
--- test header line feature
-create temp table copytest3 (
-       c1 int,
-       "col with , comma" text,
-       "col with "" quote"  int) distributed by (c1);
-copy copytest3 from stdin csv header;
-copy copytest3 to stdout csv header;
-c1,"col with , comma","col with "" quote"
-1,a,1
-2,b,2
--- test copy force quote
-create temp table copytest4 (id int, id1 int);
-insert into copytest4 values (1,2);
-insert into copytest4 values (1,3);
-insert into copytest4 values (1,4);
-copy (select * from copytest4) to stdout csv delimiter ',' force quote id, 
id1, id2;
-ERROR:  column "id2" does not exist
-copy (select * from copytest4) to stdout csv delimiter ',' force quote id, id1;
-"1","2"
-"1","3"
-"1","4"
--- test null string with CRLF for text mode
-CREATE TEMP TABLE venue(
-    venueid smallint not null,
-    venuename varchar(100),
-    venuecity varchar(30),
-    venuestate char(2),
-    venueseats integer) DISTRIBUTED BY (venueid);
-COPY venue FROM '@abs_srcdir@/data/venue_pipe.txt' WITH DELIMITER AS '|';
-SELECT count(*) FROM venue;
- count 
--------
-    10
-(1 row)
-
--- test copy from with a partitioned table
-create table parted_copytest (
-       a int,
-       b int,
-       c text
-) partition by list (b);
-create table parted_copytest_a1 (c text, b int, a int);
-create table parted_copytest_a2 (a int, c text, b int);
-alter table parted_copytest_a1 set distributed by (a);
-alter table parted_copytest attach partition parted_copytest_a1 for values 
in(1);
-alter table parted_copytest attach partition parted_copytest_a2 for values 
in(2);
--- We must insert enough rows to trigger multi-inserts.  These are only
--- enabled adaptively when there are few enough partition changes.
-insert into parted_copytest select x,1,'One' from generate_series(1,1000) x;
-insert into parted_copytest select x,2,'Two' from generate_series(1001,1010) x;
-insert into parted_copytest select x,1,'One' from generate_series(1011,1020) x;
-copy (select * from parted_copytest order by a) to 
'@abs_builddir@/results/parted_copytest.csv';
-truncate parted_copytest;
-copy parted_copytest from '@abs_builddir@/results/parted_copytest.csv';
--- Ensure COPY FREEZE errors for partitioned tables.
-begin;
-truncate parted_copytest;
-copy parted_copytest from '@abs_builddir@/results/parted_copytest.csv' 
(freeze);
-ERROR:  cannot perform COPY FREEZE on a partitioned table
-rollback;
-select tableoid::regclass,count(*),sum(a) from parted_copytest
-group by tableoid order by tableoid::regclass::name;
-      tableoid      | count |  sum   
---------------------+-------+--------
- parted_copytest_a1 |  1010 | 510655
- parted_copytest_a2 |    10 |  10055
-(2 rows)
-
-truncate parted_copytest;
--- create before insert row trigger on parted_copytest_a2
-create function part_ins_func() returns trigger language plpgsql as $$
-begin
-  return new;
-end;
-$$;
-create trigger part_ins_trig
-       before insert on parted_copytest_a2
-       for each row
-       execute procedure part_ins_func();
-copy parted_copytest from '@abs_builddir@/results/parted_copytest.csv';
-select tableoid::regclass,count(*),sum(a) from parted_copytest
-group by tableoid order by tableoid::regclass::name;
-      tableoid      | count |  sum   
---------------------+-------+--------
- parted_copytest_a1 |  1010 | 510655
- parted_copytest_a2 |    10 |  10055
-(2 rows)
-
-truncate table parted_copytest;
-create index on parted_copytest (b);
-drop trigger part_ins_trig on parted_copytest_a2;
-copy parted_copytest from stdin;
--- Ensure index entries were properly added during the copy.
-select * from parted_copytest where b = 1;
- a | b |  c   
----+---+------
- 1 | 1 | str1
-(1 row)
-
-select * from parted_copytest where b = 2;
- a | b |  c   
----+---+------
- 2 | 2 | str2
-(1 row)
-
-drop table parted_copytest;
---
--- Progress reporting for COPY
---
-create table tab_progress_reporting (
-       name text,
-       age int4,
-       location point,
-       salary int4,
-       manager name
-);
--- Add a trigger to catch and print the contents of the catalog view
--- pg_stat_progress_copy during data insertion.  This allows to test
--- the validation of some progress reports for COPY FROM where the trigger
--- would fire.
-create function notice_after_tab_progress_reporting() returns trigger AS
-$$
-declare report record;
-begin
-  -- The fields ignored here are the ones that may not remain
-  -- consistent across multiple runs.  The sizes reported may differ
-  -- across platforms, so just check if these are strictly positive.
-  with progress_data as (
-    select
-       relid::regclass::text as relname,
-       command,
-       type,
-       bytes_processed > 0 as has_bytes_processed,
-       bytes_total > 0 as has_bytes_total,
-       tuples_processed,
-       tuples_excluded
-      from pg_stat_progress_copy
-      where pid = pg_backend_pid())
-  select into report (to_jsonb(r)) as value
-    from progress_data r;
-
-  raise info 'progress: %', report.value::text;
-  return new;
-end;
-$$ language plpgsql;
-create trigger check_after_tab_progress_reporting
-       after insert on tab_progress_reporting
-       for each statement
-       execute function notice_after_tab_progress_reporting();
-ERROR:  Triggers for statements are not yet supported
--- Generate COPY FROM report with PIPE.
-copy tab_progress_reporting from stdin;
--- Generate COPY FROM report with FILE, with some excluded tuples.
-truncate tab_progress_reporting;
-copy tab_progress_reporting from '@abs_srcdir@/data/emp.data'
-       where (salary < 2000);
-drop trigger check_after_tab_progress_reporting on tab_progress_reporting;
-ERROR:  trigger "check_after_tab_progress_reporting" for table 
"tab_progress_reporting" does not exist
-drop function notice_after_tab_progress_reporting();
-drop table tab_progress_reporting;
--- check COPY behavior
--- there are 2 fields in copy.data
--- table_1_col_dist_c1: 1 col in table < 2 fields in file
--- table_2_cols_dist_c1 and
--- table_2_cols_dist_c2: 2 cols in table = 2 fields in file
--- table_3_cols_dist_c1 and
--- table_3_cols_dist_c2 and
--- table_3_cols_dist_c3: 3 cols in table > 2 fields in file
-CREATE TABLE table_1_col_dist_c1(c1 text) distributed by (c1);
-CREATE TABLE table_2_cols_dist_c1(c1 text, c2 text) distributed by (c1);
-CREATE TABLE table_2_cols_dist_c2(c1 text, c2 text) distributed by (c2);
-CREATE TABLE table_3_cols_dist_c1(c1 text, c2 text, c3 text) distributed by 
(c1);
-CREATE TABLE table_3_cols_dist_c2(c1 text, c2 text, c3 text) distributed by 
(c2);
-CREATE TABLE table_3_cols_dist_c3(c1 text, c2 text, c3 text) distributed by 
(c3);
-COPY table_1_col_dist_c1 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-ERROR:  extra data after last expected column
-CONTEXT:  COPY table_1_col_dist_c1, line 1: "1,text1"
-COPY table_2_cols_dist_c1 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-COPY table_2_cols_dist_c2 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-COPY table_3_cols_dist_c1 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-ERROR:  missing data for column "c3"
-CONTEXT:  COPY table_3_cols_dist_c1, line 1: "1,text1"
-COPY table_3_cols_dist_c2 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-ERROR:  missing data for column "c3"
-CONTEXT:  COPY table_3_cols_dist_c2, line 1: "1,text1"
-COPY table_3_cols_dist_c3 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-ERROR:  missing data for column "c3"
-CONTEXT:  COPY table_3_cols_dist_c3, line 1: "1,text1"
-SELECT count(*) FROM table_1_col_dist_c1;
- count 
--------
-     0
-(1 row)
-
-SELECT count(*) FROM table_2_cols_dist_c1;
- count 
--------
-     1
-(1 row)
-
-SELECT count(*) FROM table_2_cols_dist_c2;
- count 
--------
-     1
-(1 row)
-
-SELECT count(*) FROM table_3_cols_dist_c1;
- count 
--------
-     0
-(1 row)
-
-SELECT count(*) FROM table_3_cols_dist_c2;
- count 
--------
-     0
-(1 row)
-
-SELECT count(*) FROM table_3_cols_dist_c3;
- count 
--------
-     0
-(1 row)
-
-DROP TABLE table_1_col_dist_c1;
-DROP TABLE table_2_cols_dist_c1;
-DROP TABLE table_2_cols_dist_c2;
-DROP TABLE table_3_cols_dist_c1;
-DROP TABLE table_3_cols_dist_c2;
-DROP TABLE table_3_cols_dist_c3;
--- special case, tables without columns
-CREATE TABLE table_no_cols();
-INSERT INTO table_no_cols DEFAULT VALUES;
-SELECT count(*) FROM table_no_cols;
- count 
--------
-     1
-(1 row)
-
-COPY table_no_cols TO '@abs_srcdir@/results/copy_no_cols.data' DELIMITER ',';
-COPY table_no_cols FROM '@abs_srcdir@/results/copy_no_cols.data' DELIMITER ',';
-SELECT count(*) FROM table_no_cols;
- count 
--------
-     2
-(1 row)
-
-COPY table_no_cols FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-ERROR:  extra data after last expected column
-CONTEXT:  COPY table_no_cols, line 1: "1,text1"
-DROP TABLE table_no_cols;
diff --git a/src/test/regress/output/misc.source 
b/src/test/regress/output/misc.source
deleted file mode 100644
index 18bcc227f0a..00000000000
--- a/src/test/regress/output/misc.source
+++ /dev/null
@@ -1,611 +0,0 @@
---
--- MISC
---
---
--- BTREE
---
---UPDATE onek
---   SET unique1 = onek.unique1 + 1;
---UPDATE onek
---   SET unique1 = onek.unique1 - 1;
---
--- BTREE partial
---
--- UPDATE onek2
---   SET unique1 = onek2.unique1 + 1;
---UPDATE onek2
---   SET unique1 = onek2.unique1 - 1;
---
--- BTREE shutting out non-functional updates
---
--- the following two tests seem to take a long time on some
--- systems.    This non-func update stuff needs to be examined
--- more closely.                       - jolly (2/22/96)
---
-/* GPDB TODO: This test is disabled for now, because when running with ORCA,
-   you get an error:
-     ERROR:  multiple updates to a row by the same query is not allowed
-UPDATE tmp
-   SET stringu1 = reverse_name(onek.stringu1)
-   FROM onek
-   WHERE onek.stringu1 = 'JBAAAA' and
-         onek.stringu1 = tmp.stringu1;
-
-UPDATE tmp
-   SET stringu1 = reverse_name(onek2.stringu1)
-   FROM onek2
-   WHERE onek2.stringu1 = 'JCAAAA' and
-         onek2.stringu1 = tmp.stringu1;
-*/
-DROP TABLE tmp;
---UPDATE person*
---   SET age = age + 1;
---UPDATE person*
---   SET age = age + 3
---   WHERE name = 'linda';
---
--- copy
---
-COPY onek TO '@abs_builddir@/results/onek.data';
-DELETE FROM onek;
-COPY onek FROM '@abs_builddir@/results/onek.data';
-SELECT unique1 FROM onek WHERE unique1 < 2 ORDER BY unique1;
- unique1 
----------
-       0
-       1
-(2 rows)
-
-DELETE FROM onek2;
-COPY onek2 FROM '@abs_builddir@/results/onek.data';
-SELECT unique1 FROM onek2 WHERE unique1 < 2 ORDER BY unique1;
- unique1 
----------
-       0
-       1
-(2 rows)
-
-COPY BINARY stud_emp TO '@abs_builddir@/results/stud_emp.data';
-DELETE FROM stud_emp;
-COPY BINARY stud_emp FROM '@abs_builddir@/results/stud_emp.data';
-SELECT * FROM stud_emp;
- name  | age |  location  | salary | manager | gpa | percent 
--------+-----+------------+--------+---------+-----+---------
- jeff  |  23 | (8,7.7)    |    600 | sharon  | 3.5 |        
- cim   |  30 | (10.5,4.7) |    400 |         | 3.4 |        
- linda |  19 | (0.9,6.1)  |    100 |         | 2.9 |        
-(3 rows)
-
--- COPY aggtest FROM stdin;
--- 56  7.8
--- 100 99.097
--- 0   0.09561
--- 42  324.78
--- .
--- COPY aggtest TO stdout;
---
--- inheritance stress test
---
-SELECT * FROM a_star*;
- class | a  
--------+----
- a     |  1
- a     |  2
- a     |   
- b     |  3
- b     |  4
- b     |   
- b     |   
- c     |  5
- c     |  6
- c     |   
- c     |   
- d     |  7
- d     |  8
- d     |  9
- d     | 10
- d     |   
- d     | 11
- d     | 12
- d     | 13
- d     |   
- d     |   
- d     |   
- d     | 14
- d     |   
- d     |   
- d     |   
- d     |   
- e     | 15
- e     | 16
- e     | 17
- e     |   
- e     | 18
- e     |   
- e     |   
- f     | 19
- f     | 20
- f     | 21
- f     | 22
- f     |   
- f     | 24
- f     | 25
- f     | 26
- f     |   
- f     |   
- f     |   
- f     | 27
- f     |   
- f     |   
- f     |   
- f     |   
-(50 rows)
-
-SELECT *
-   FROM b_star* x
-   WHERE x.b = text 'bumble' or x.a < 3;
- class | a |   b    
--------+---+--------
- b     |   | bumble
-(1 row)
-
-SELECT class, a
-   FROM c_star* x
-   WHERE x.c ~ text 'hi';
- class | a  
--------+----
- c     |  5
- c     |   
- d     |  7
- d     |  8
- d     | 10
- d     |   
- d     | 12
- d     |   
- d     |   
- d     |   
- e     | 15
- e     | 16
- e     |   
- e     |   
- f     | 19
- f     | 20
- f     | 21
- f     |   
- f     | 24
- f     |   
- f     |   
- f     |   
-(22 rows)
-
-SELECT class, b, c
-   FROM d_star* x
-   WHERE x.a < 100;
- class |    b    |     c      
--------+---------+------------
- d     | grumble | hi sunita
- d     | stumble | hi koko
- d     | rumble  | 
- d     |         | hi kristin
- d     | fumble  | 
- d     |         | hi avi
- d     |         | 
- d     |         | 
-(8 rows)
-
-SELECT class, c FROM e_star* x WHERE x.c NOTNULL;
- class |      c      
--------+-------------
- e     | hi carol
- e     | hi bob
- e     | hi michelle
- e     | hi elisa
- f     | hi claire
- f     | hi mike
- f     | hi marcel
- f     | hi keith
- f     | hi marc
- f     | hi allison
- f     | hi jeff
- f     | hi carl
-(12 rows)
-
-SELECT * FROM f_star* x WHERE x.c ISNULL;
- class | a  | c |  e  |                     f                     
--------+----+---+-----+-------------------------------------------
- f     | 22 |   |  -7 | ((111,555),(222,666),(333,777),(444,888))
- f     | 25 |   |  -9 | 
- f     | 26 |   |     | ((11111,33333),(22222,44444))
- f     |    |   | -11 | ((1111111,3333333),(2222222,4444444))
- f     | 27 |   |     | 
- f     |    |   | -12 | 
- f     |    |   |     | ((11111111,33333333),(22222222,44444444))
- f     |    |   |     | 
-(8 rows)
-
--- grouping and aggregation on inherited sets have been busted in the past...
-SELECT sum(a) FROM a_star*;
- sum 
------
- 355
-(1 row)
-
-SELECT class, sum(a) FROM a_star* GROUP BY class ORDER BY class;
- class | sum 
--------+-----
- a     |   3
- b     |   7
- c     |  11
- d     |  84
- e     |  66
- f     | 184
-(6 rows)
-
-ALTER TABLE f_star RENAME COLUMN f TO ff;
-ALTER TABLE e_star* RENAME COLUMN e TO ee;
-ALTER TABLE d_star* RENAME COLUMN d TO dd;
-ALTER TABLE c_star* RENAME COLUMN c TO cc;
-ALTER TABLE b_star* RENAME COLUMN b TO bb;
-ALTER TABLE a_star* RENAME COLUMN a TO aa;
-SELECT class, aa
-   FROM a_star* x
-   WHERE aa ISNULL;
- class | aa 
--------+----
- a     |   
- b     |   
- b     |   
- c     |   
- c     |   
- d     |   
- d     |   
- d     |   
- d     |   
- d     |   
- d     |   
- d     |   
- d     |   
- e     |   
- e     |   
- e     |   
- f     |   
- f     |   
- f     |   
- f     |   
- f     |   
- f     |   
- f     |   
- f     |   
-(24 rows)
-
--- As of Postgres 7.1, ALTER implicitly recurses,
--- so this should be same as ALTER a_star*
-ALTER TABLE a_star RENAME COLUMN aa TO foo;
-SELECT class, foo
-   FROM a_star* x
-   WHERE x.foo >= 2;
- class | foo 
--------+-----
- a     |   2
- b     |   3
- b     |   4
- c     |   5
- c     |   6
- d     |   7
- d     |   8
- d     |   9
- d     |  10
- d     |  11
- d     |  12
- d     |  13
- d     |  14
- e     |  15
- e     |  16
- e     |  17
- e     |  18
- f     |  19
- f     |  20
- f     |  21
- f     |  22
- f     |  24
- f     |  25
- f     |  26
- f     |  27
-(25 rows)
-
-ALTER TABLE a_star RENAME COLUMN foo TO aa;
-SELECT *
-   from a_star*
-   WHERE aa < 1000;
- class | aa 
--------+----
- a     |  1
- a     |  2
- b     |  3
- b     |  4
- c     |  5
- c     |  6
- d     |  7
- d     |  8
- d     |  9
- d     | 10
- d     | 11
- d     | 12
- d     | 13
- d     | 14
- e     | 15
- e     | 16
- e     | 17
- e     | 18
- f     | 19
- f     | 20
- f     | 21
- f     | 22
- f     | 24
- f     | 25
- f     | 26
- f     | 27
-(26 rows)
-
-ALTER TABLE f_star ADD COLUMN f int4;
-UPDATE f_star SET f = 10;
-ALTER TABLE e_star* ADD COLUMN e int4;
---UPDATE e_star* SET e = 42;
-SELECT * FROM e_star*;
- class | aa |     cc      | ee  | e 
--------+----+-------------+-----+---
- e     | 15 | hi carol    |  -1 |  
- e     | 16 | hi bob      |     |  
- e     | 17 |             |  -2 |  
- e     |    | hi michelle |  -3 |  
- e     | 18 |             |     |  
- e     |    | hi elisa    |     |  
- e     |    |             |  -4 |  
- f     | 19 | hi claire   |  -5 |  
- f     | 20 | hi mike     |  -6 |  
- f     | 21 | hi marcel   |     |  
- f     | 22 |             |  -7 |  
- f     |    | hi keith    |  -8 |  
- f     | 24 | hi marc     |     |  
- f     | 25 |             |  -9 |  
- f     | 26 |             |     |  
- f     |    | hi allison  | -10 |  
- f     |    | hi jeff     |     |  
- f     |    |             | -11 |  
- f     | 27 |             |     |  
- f     |    | hi carl     |     |  
- f     |    |             | -12 |  
- f     |    |             |     |  
- f     |    |             |     |  
-(23 rows)
-
-ALTER TABLE a_star* ADD COLUMN a text;
-NOTICE:  merging definition of column "a" for child "d_star"
--- That ALTER TABLE should have added TOAST tables.
-SELECT relname, reltoastrelid <> 0 AS has_toast_table
-   FROM pg_class
-   WHERE oid::regclass IN ('a_star', 'c_star')
-   ORDER BY 1;
- relname | has_toast_table 
----------+-----------------
- a_star  | t
- c_star  | t
-(2 rows)
-
---UPDATE b_star*
---   SET a = text 'gazpacho'
---   WHERE aa > 4;
-SELECT class, aa, a FROM a_star*;
- class | aa | a 
--------+----+---
- a     |  1 | 
- a     |  2 | 
- a     |    | 
- b     |  3 | 
- b     |  4 | 
- b     |    | 
- b     |    | 
- c     |  5 | 
- c     |  6 | 
- c     |    | 
- c     |    | 
- d     |  7 | 
- d     |  8 | 
- d     |  9 | 
- d     | 10 | 
- d     |    | 
- d     | 11 | 
- d     | 12 | 
- d     | 13 | 
- d     |    | 
- d     |    | 
- d     |    | 
- d     | 14 | 
- d     |    | 
- d     |    | 
- d     |    | 
- d     |    | 
- e     | 15 | 
- e     | 16 | 
- e     | 17 | 
- e     |    | 
- e     | 18 | 
- e     |    | 
- e     |    | 
- f     | 19 | 
- f     | 20 | 
- f     | 21 | 
- f     | 22 | 
- f     |    | 
- f     | 24 | 
- f     | 25 | 
- f     | 26 | 
- f     |    | 
- f     |    | 
- f     |    | 
- f     | 27 | 
- f     |    | 
- f     |    | 
- f     |    | 
- f     |    | 
-(50 rows)
-
---
--- versions
---
---
--- postquel functions
---
---
--- mike does post_hacking,
--- joe and sally play basketball, and
--- everyone else does nothing.
---
-SELECT p.name, name(p.hobbies) FROM ONLY person p;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.hobbies_r"
-CONTEXT:  SQL function "hobbies" during startup
---
--- as above, but jeff also does post_hacking.
---
-SELECT p.name, name(p.hobbies) FROM person* p;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.hobbies_r"
-CONTEXT:  SQL function "hobbies" during startup
---
--- the next two queries demonstrate how functions generate bogus duplicates.
--- this is a "feature" ..
---
-SELECT DISTINCT hobbies_r.name, name(hobbies_r.equipment) FROM hobbies_r
-  ORDER BY 1,2;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.equipment_r"
-CONTEXT:  SQL function "equipment" during startup
-SELECT hobbies_r.name, (hobbies_r.equipment).name FROM hobbies_r;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.equipment_r"
-CONTEXT:  SQL function "equipment" during startup
---
--- mike needs advil and peet's coffee,
--- joe and sally need hightops, and
--- everyone else is fine.
---
-SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM ONLY person p;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.hobbies_r"
-CONTEXT:  SQL function "hobbies" during startup
---
--- as above, but jeff needs advil and peet's coffee as well.
---
-SELECT p.name, name(p.hobbies), name(equipment(p.hobbies)) FROM person* p;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.hobbies_r"
-CONTEXT:  SQL function "hobbies" during startup
---
--- just like the last two, but make sure that the target list fixup and
--- unflattening is being done correctly.
---
-SELECT name(equipment(p.hobbies)), p.name, name(p.hobbies) FROM ONLY person p;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.hobbies_r"
-CONTEXT:  SQL function "hobbies" during startup
-SELECT (p.hobbies).equipment.name, p.name, name(p.hobbies) FROM person* p;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.hobbies_r"
-CONTEXT:  SQL function "hobbies" during startup
-SELECT (p.hobbies).equipment.name, name(p.hobbies), p.name FROM ONLY person p;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.hobbies_r"
-CONTEXT:  SQL function "hobbies" during startup
-SELECT name(equipment(p.hobbies)), name(p.hobbies), p.name FROM person* p;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.hobbies_r"
-CONTEXT:  SQL function "hobbies" during startup
-SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer')));
- name 
-------
- guts
-(1 row)
-
-SELECT name(equipment(hobby_construct_named(text 'skywalking', text 'mer')));
- name 
-------
- guts
-(1 row)
-
-SELECT name(equipment_named(hobby_construct_named(text 'skywalking', text 
'mer')));
- name 
-------
- guts
-(1 row)
-
-SELECT name(equipment_named_ambiguous_1a(hobby_construct_named(text 
'skywalking', text 'mer')));
- name 
-------
- guts
-(1 row)
-
-SELECT name(equipment_named_ambiguous_1b(hobby_construct_named(text 
'skywalking', text 'mer')));
- name 
-------
- guts
-(1 row)
-
-SELECT name(equipment_named_ambiguous_1c(hobby_construct_named(text 
'skywalking', text 'mer')));
- name 
-------
- guts
-(1 row)
-
-SELECT name(equipment_named_ambiguous_2a(text 'skywalking'));
- name 
-------
- guts
-(1 row)
-
-SELECT name(equipment_named_ambiguous_2b(text 'skywalking'));
-     name      
----------------
- advil
- peet's coffee
- hightops
- guts
-(4 rows)
-
-SELECT hobbies_by_name('basketball');
- hobbies_by_name 
------------------
- joe
-(1 row)
-
-SELECT name, overpaid(emp.*) FROM emp;
-  name  | overpaid 
---------+----------
- sharon | t
- sam    | t
- bill   | t
- jeff   | f
- cim    | f
- linda  | f
-(6 rows)
-
---
--- Try a few cases with SQL-spec row constructor expressions
---
-SELECT * FROM equipment(ROW('skywalking', 'mer'));
- name |   hobby    
-------+------------
- guts | skywalking
-(1 row)
-
-SELECT name(equipment(ROW('skywalking', 'mer')));
- name 
-------
- guts
-(1 row)
-
-SELECT *, name(equipment(h.*)) FROM hobbies_r h;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.equipment_r"
-CONTEXT:  SQL function "equipment" during startup
-SELECT *, (equipment(CAST((h.*) AS hobbies_r))).name FROM hobbies_r h;
-ERROR:  function cannot execute on a QE slice because it accesses relation 
"public.equipment_r"
-CONTEXT:  SQL function "equipment" during startup
---
--- functional joins
---
---
--- instance rules
---
---
--- rewrite rules
---
diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule
index 8805bdfe361..cbfe7e9aea8 100644
--- a/src/test/regress/serial_schedule
+++ b/src/test/regress/serial_schedule
@@ -57,7 +57,7 @@ test: unicode
 test: create_type
 test: create_table
 # test: create_function_2
-# test: copy
+test: copy
 # test: copyselect
 # test: copydml
 # test: insert
diff --git a/src/test/regress/sql/copy.sql b/src/test/regress/sql/copy.sql
index 2745080610b..d49f4f66f98 100644
--- a/src/test/regress/sql/copy.sql
+++ b/src/test/regress/sql/copy.sql
@@ -2,112 +2,9 @@
 -- COPY
 --
 
-<<<<<<< HEAD:src/test/regress/input/copy.source
--- CLASS POPULATION
---     (any resemblance to real life is purely coincidental)
---
-COPY aggtest FROM '@abs_srcdir@/data/agg.data';
-
-COPY onek FROM '@abs_srcdir@/data/onek.data';
-
-COPY onek TO '@abs_builddir@/results/onek.data';
-
-DELETE FROM onek;
-
-COPY onek FROM '@abs_builddir@/results/onek.data';
-
-COPY tenk1 FROM '@abs_srcdir@/data/tenk.data';
-
--- Create a table that's identical to 'tenk1', but all the data is in a single
--- segment. This comes handy in making some PostgreSQL tests pass on GPDB,
--- where data distribution might make a difference to a test result.
-CREATE SCHEMA singleseg;
-create table singleseg.tenk1 (like tenk1, distkey int4) distributed by 
(distkey);
-COPY singleseg.tenk1 
(unique1,unique2,two,four,ten,twenty,hundred,thousand,twothousand,fivethous,tenthous,odd,even,stringu1,stringu2,string4)
 FROM '@abs_srcdir@/data/tenk.data';
-
-COPY slow_emp4000 FROM '@abs_srcdir@/data/rect.data';
-
-COPY person FROM '@abs_srcdir@/data/person.data';
-
-COPY emp FROM '@abs_srcdir@/data/emp.data';
-
-COPY student FROM '@abs_srcdir@/data/student.data';
-
-COPY stud_emp FROM '@abs_srcdir@/data/stud_emp.data';
-
-COPY road FROM '@abs_srcdir@/data/streets.data';
-
-COPY real_city FROM '@abs_srcdir@/data/real_city.data';
-
-COPY hash_i4_heap FROM '@abs_srcdir@/data/hash.data';
-
-COPY hash_name_heap FROM '@abs_srcdir@/data/hash.data';
-
-COPY hash_txt_heap FROM '@abs_srcdir@/data/hash.data';
-
-COPY hash_f8_heap FROM '@abs_srcdir@/data/hash.data';
-
-COPY test_tsvector FROM '@abs_srcdir@/data/tsearch.data';
-
-COPY testjsonb FROM '@abs_srcdir@/data/jsonb.data';
-
--- the data in this file has a lot of duplicates in the index key
--- fields, leading to long bucket chains and lots of table expansion.
--- this is therefore a stress test of the bucket overflow code (unlike
--- the data in hash.data, which has unique index keys).
---
--- COPY hash_ovfl_heap FROM '@abs_srcdir@/data/hashovfl.data';
-
-COPY bt_i4_heap FROM '@abs_srcdir@/data/desc.data';
-
-COPY bt_name_heap FROM '@abs_srcdir@/data/hash.data';
-
-COPY bt_txt_heap FROM '@abs_srcdir@/data/desc.data';
-
-COPY bt_f8_heap FROM '@abs_srcdir@/data/hash.data';
-
-COPY array_op_test FROM '@abs_srcdir@/data/array.data';
-
-COPY array_index_op_test FROM '@abs_srcdir@/data/array.data';
-
--- analyze all the data we just loaded, to ensure plan consistency
--- in later tests
-
--- Force pgstat_report_stat() to send tabstat before pgstat_report_analyze.
--- Nomally this is no needed, but ORCA is very sensitive for statistics.
--- If analyze msg recevied first, n_mod_since_analyze will not be 0.
--- And since we create index for some tables later, the triggered auto-ANALYZE
--- will cause table's index statstics change and ORCA may generate different
--- plans for some queries.
-select pg_sleep(0.77);
-
-ANALYZE aggtest;
-ANALYZE onek;
-ANALYZE tenk1;
-ANALYZE slow_emp4000;
-ANALYZE person;
-ANALYZE emp;
-ANALYZE student;
-ANALYZE stud_emp;
-ANALYZE road;
-ANALYZE real_city;
-ANALYZE hash_i4_heap;
-ANALYZE hash_name_heap;
-ANALYZE hash_txt_heap;
-ANALYZE hash_f8_heap;
-ANALYZE test_tsvector;
-ANALYZE testjsonb;
-ANALYZE bt_i4_heap;
-ANALYZE bt_name_heap;
-ANALYZE bt_txt_heap;
-ANALYZE bt_f8_heap;
-ANALYZE array_op_test;
-ANALYZE array_index_op_test;
-=======
 -- directory paths are passed to us in environment variables
 \getenv abs_srcdir PG_ABS_SRCDIR
 \getenv abs_builddir PG_ABS_BUILDDIR
->>>>>>> REL_16_9:src/test/regress/sql/copy.sql
 
 --- test copying in CSV mode with various styles
 --- of embedded line ending characters
@@ -127,12 +24,7 @@ copy copytest to :'filename' csv;
 
 create temp table copytest2 (like copytest);
 
-<<<<<<< HEAD:src/test/regress/input/copy.source
-copy copytest2 from '@abs_builddir@/results/copytest.csv' csv;
-copy copytest2 from '@abs_builddir@/results/copytest.csv' csv LOG ERRORS 
SEGMENT REJECT LIMIT 10 ROWS;
-=======
 copy copytest2 from :'filename' csv;
->>>>>>> REL_16_9:src/test/regress/sql/copy.sql
 
 select * from copytest except select * from copytest2 order by 1,2,3;
 
@@ -162,30 +54,6 @@ this is just a line full of junk that would error out if 
parsed
 
 copy copytest3 to stdout csv header;
 
-<<<<<<< HEAD:src/test/regress/input/copy.source
--- test copy force quote
-
-create temp table copytest4 (id int, id1 int);
-
-insert into copytest4 values (1,2);
-insert into copytest4 values (1,3);
-insert into copytest4 values (1,4);
-
-copy (select * from copytest4) to stdout csv delimiter ',' force quote id, 
id1, id2;
-copy (select * from copytest4) to stdout csv delimiter ',' force quote id, id1;
-
--- test null string with CRLF for text mode
-
-CREATE TEMP TABLE venue(
-    venueid smallint not null,
-    venuename varchar(100),
-    venuecity varchar(30),
-    venuestate char(2),
-    venueseats integer) DISTRIBUTED BY (venueid);
-
-COPY venue FROM '@abs_srcdir@/data/venue_pipe.txt' WITH DELIMITER AS '|';
-SELECT count(*) FROM venue;
-=======
 create temp table copytest4 (
        c1 int,
        "colname with tab:      " text);
@@ -197,7 +65,6 @@ this is just a line full of junk that would error out if 
parsed
 \.
 
 copy copytest4 to stdout (header);
->>>>>>> REL_16_9:src/test/regress/sql/copy.sql
 
 -- test copy from with a partitioned table
 create table parted_copytest (
@@ -332,53 +199,6 @@ copy tab_progress_reporting from :'filename'
 drop trigger check_after_tab_progress_reporting on tab_progress_reporting;
 drop function notice_after_tab_progress_reporting();
 drop table tab_progress_reporting;
-<<<<<<< HEAD:src/test/regress/input/copy.source
--- check COPY behavior
--- there are 2 fields in copy.data
--- table_1_col_dist_c1: 1 col in table < 2 fields in file
--- table_2_cols_dist_c1 and
--- table_2_cols_dist_c2: 2 cols in table = 2 fields in file
--- table_3_cols_dist_c1 and
--- table_3_cols_dist_c2 and
--- table_3_cols_dist_c3: 3 cols in table > 2 fields in file
-CREATE TABLE table_1_col_dist_c1(c1 text) distributed by (c1);
-CREATE TABLE table_2_cols_dist_c1(c1 text, c2 text) distributed by (c1);
-CREATE TABLE table_2_cols_dist_c2(c1 text, c2 text) distributed by (c2);
-CREATE TABLE table_3_cols_dist_c1(c1 text, c2 text, c3 text) distributed by 
(c1);
-CREATE TABLE table_3_cols_dist_c2(c1 text, c2 text, c3 text) distributed by 
(c2);
-CREATE TABLE table_3_cols_dist_c3(c1 text, c2 text, c3 text) distributed by 
(c3);
-
-COPY table_1_col_dist_c1 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-COPY table_2_cols_dist_c1 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-COPY table_2_cols_dist_c2 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-COPY table_3_cols_dist_c1 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-COPY table_3_cols_dist_c2 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-COPY table_3_cols_dist_c3 FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-
-SELECT count(*) FROM table_1_col_dist_c1;
-SELECT count(*) FROM table_2_cols_dist_c1;
-SELECT count(*) FROM table_2_cols_dist_c2;
-SELECT count(*) FROM table_3_cols_dist_c1;
-SELECT count(*) FROM table_3_cols_dist_c2;
-SELECT count(*) FROM table_3_cols_dist_c3;
-
-DROP TABLE table_1_col_dist_c1;
-DROP TABLE table_2_cols_dist_c1;
-DROP TABLE table_2_cols_dist_c2;
-DROP TABLE table_3_cols_dist_c1;
-DROP TABLE table_3_cols_dist_c2;
-DROP TABLE table_3_cols_dist_c3;
-
--- special case, tables without columns
-CREATE TABLE table_no_cols();
-INSERT INTO table_no_cols DEFAULT VALUES;
-SELECT count(*) FROM table_no_cols;
-COPY table_no_cols TO '@abs_srcdir@/results/copy_no_cols.data' DELIMITER ',';
-COPY table_no_cols FROM '@abs_srcdir@/results/copy_no_cols.data' DELIMITER ',';
-SELECT count(*) FROM table_no_cols;
-COPY table_no_cols FROM '@abs_srcdir@/data/copy.data' DELIMITER ',';
-DROP TABLE table_no_cols;
-=======
 
 -- Test header matching feature
 create table header_copytest (
@@ -502,4 +322,3 @@ COPY parted_si(id, data) FROM :'filename';
 SELECT tableoid::regclass, id % 2 = 0 is_even, count(*) from parted_si GROUP 
BY 1, 2 ORDER BY 1;
 
 DROP TABLE parted_si;
->>>>>>> REL_16_9:src/test/regress/sql/copy.sql


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to