diff --git a/gpMgmt/bin/gpsd b/gpMgmt/bin/gpsd index d487b4af210583cc09ac398cb6abfa07fe2727aa..79b6f8c8a63fd4057f8194c2b45649cc341641ec 100755 --- a/gpMgmt/bin/gpsd +++ b/gpMgmt/bin/gpsd @@ -113,17 +113,26 @@ def dumpStats(cur): for vals in ResultIter(cur): rowVals = ["\t'%s.%s'::regclass" % tuple(vals[1::-1])] + i = 0 + hll = False if vals[3][0] == '_': rowTypes = types + [vals[3]] * 4 else: rowTypes = types + [vals[3] + '[]'] * 4 for val, typ in zip(vals[5:], rowTypes): + i = i + 1 + if i == 9 and (val == 5 or val == 6): + hll = True + if val is None: val = 'NULL' elif isinstance(val, (str, unicode)) and val[0] == '{': val = val.replace("'", "''").replace('\\', '\\\\') val = "E'" + val + "'" - rowVals.append('\t{0}::{1}'.format(val, typ)) + if i == 21 and hll == True: + rowVals.append('\t{0}::{1}'.format(val, 'bytea[]')) + else: + rowVals.append('\t{0}::{1}'.format(val, typ)) print pstring.format(vals[0], vals[2], ',\n'.join(rowVals)) diff --git a/gpMgmt/bin/minirepro b/gpMgmt/bin/minirepro index 56bd0b0adb512bb8a45c0ef6f7818f615a60c0cc..dcc85bf1e18e52c6992483a1df0f6771044f59fa 100755 --- a/gpMgmt/bin/minirepro +++ b/gpMgmt/bin/minirepro @@ -64,7 +64,7 @@ from optparse import OptionParser from pygresql import pgdb from datetime import datetime -version = '1.12' +version = '1.13' PATH_PREFIX = '/tmp/' PGDUMP_FILE = 'pg_dump_out.sql' sysnslist = "('pg_toast', 'pg_bitmapindex', 'pg_catalog', 'information_schema', 'gp_toolkit')" @@ -249,17 +249,26 @@ def dump_stats(cur, oid_str, f_out): starelid = "'%s.%s'::regclass" % (E(vals[1]), E(vals[0])) rowVals = ["\t%s" % (starelid)] schemaname = vals[1] + i = 0 + hll = False if vals[3][0] == '_': rowTypes = types + [vals[3]] * 4 else: rowTypes = types + [vals[3] + '[]'] * 4 for val, typ in zip(vals[5:], rowTypes): + i = i + 1 + if i == 9 and (val == 5 or val == 6): + hll = True + if val is None: val = 'NULL' elif isinstance(val, (str, unicode)) and val[0] == '{': val = "E'%s'" % E(val) - rowVals.append('\t{0}::{1}'.format(val, typ)) + if i == 21 and hll == True: + rowVals.append('\t{0}::{1}'.format(val, 'bytea[]')) + else: + rowVals.append('\t{0}::{1}'.format(val, typ)) # For non-catalog tables we don't need to delete stats first # stats need to be deleted only for catalog tables