-- start_matchsubs
m/ \(plpy_elog\.c:\d+\)/
s/ \(plpy_elog\.c:\d+\)//
m/ \(plpy_exec\.c:\d+\)/
s/ \(plpy_exec\.c:\d+\)//
m/ \(plpython\.c:\d+\)/
s/ \(plpython\.c:\d+\)//

# TODO: Move these to init_file_python3
m/"subtransaction_exit_subtransaction_in_with", line \d+/
s/"subtransaction_exit_subtransaction_in_with", line \d+//
m/with plpy\.subtransaction\(\) as s:/
s/with plpy\.subtransaction\(\) as s:/s.__exit__(None, None, None)/

# new add for plpython3
m/ERROR:  invalid input syntax for integer:.*/
s/ERROR:  invalid input syntax for integer:.*//
m/ERROR:  length of returned sequence did not match number of columns in row.*/
s/ERROR:  length of returned sequence did not match number of columns in row.*//
m/(seg\d+.*)/
s/(seg\d+.*)//
# for python3 different version have different SyntaxError so we ignore it.
m/ERROR:  SyntaxError:.*/
s/ERROR:  SyntaxError:.*/SyntaxError/

-- end_matchsubs

# Copied from src/test/regress/init_file:
#
# There are a number of NOTICE and HINT messages around table distribution,
# for example to inform the user that the database will pick a particular
# column in order to distribute the data. Merging tests from postgres will
# cause the tests to output these messages and we would need to manually
# modify the corresponding expected output. Hence we want to ignore these.
# Some of the messages include:
#
# NOTICE:  Table doesn't have 'DISTRIBUTED BY' clause -- Using column named '<colname>' as the Greenplum Database data distribution key for this table.
# NOTICE:  Table doesn't have 'DISTRIBUTED BY' clause, defaulting to distribution columns from LIKE table
# HINT:  The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
#
# The following regex is intended to cover all permutations of the above set
# of messages.
-- start_matchignore
m/^(?:HINT|NOTICE):\s+.+\'DISTRIBUTED BY\' clause.*/
-- end_matchignore
