|
64 | 64 | for port in ports: |
65 | 65 | portid_list.append(port) |
66 | 66 |
|
67 | | -SUPPORTED_PORTS = ('postgres', 'greenplum') |
| 67 | +SUPPORTED_PORTS = ('postgres', 'greenplum', 'cloudberry') |
68 | 68 |
|
69 | 69 | # Global variables |
70 | 70 | portid = None # Target port ID (eg: pg90, gp40) |
@@ -189,7 +189,8 @@ def _run_m4_and_append(schema, maddir_mod_py, module, sqlfile, |
189 | 189 | '-I' + maddir_madpack, |
190 | 190 | sqlfile] |
191 | 191 | if ( (portid == 'postgres') & |
192 | | - (is_rev_gte(get_rev_num(dbver), get_rev_num('14.0'))) ): |
| 192 | + (is_rev_gte(get_rev_num(dbver), get_rev_num('14.0'))) or |
| 193 | + (portid == 'cloudberry') ): |
193 | 194 | m4args = ['m4', |
194 | 195 | '-P', |
195 | 196 | '-DMADLIB_SCHEMA=' + schema, |
@@ -370,7 +371,7 @@ def _check_db_port(portid): |
370 | 371 | if portid == 'postgres': |
371 | 372 | if row[0]['version'].lower().find('greenplum') < 0: |
372 | 373 | return True |
373 | | - elif portid == 'greenplum': |
| 374 | + elif portid == 'greenplum' or portid == 'cloudberry': |
374 | 375 | return True |
375 | 376 | return False |
376 | 377 | # ------------------------------------------------------------------------------ |
@@ -1240,6 +1241,7 @@ def create_install_madlib_sqlfile(args, madpack_cmd): |
1240 | 1241 | def get_madlib_function_drop_str(schema): |
1241 | 1242 |
|
1242 | 1243 | if ((portid == 'greenplum' and is_rev_gte(get_rev_num(dbver), get_rev_num('7.0'))) or |
| 1244 | + (portid == 'cloudberry') or |
1243 | 1245 | (portid == 'postgres')): |
1244 | 1246 | case_str = """ |
1245 | 1247 | CASE p.prokind |
@@ -1350,8 +1352,8 @@ def set_dynamic_library_path_in_database(dbver_split, madlib_library_path): |
1350 | 1352 | paths.append(madlib_library_path) |
1351 | 1353 | dynamic_library_path = ':'.join(paths) |
1352 | 1354 |
|
1353 | | - if portid == 'greenplum': |
1354 | | - if is_rev_gte(dbver_split, get_rev_num('6.0')): |
| 1355 | + if portid == 'greenplum' or portid == 'cloudberry': |
| 1356 | + if is_rev_gte(dbver_split, get_rev_num('6.0')) or portid == 'cloudberry': |
1355 | 1357 | ret = os.system('gpconfig -c dynamic_library_path -v \'{0}\''.format(dynamic_library_path)) |
1356 | 1358 | else: |
1357 | 1359 | ret = os.system('gpconfig -c dynamic_library_path -v \'\\{0}\''.format(dynamic_library_path)) |
@@ -1482,6 +1484,9 @@ def main(argv): |
1482 | 1484 | else: |
1483 | 1485 | # only need the first two digits for <= 4.3.4 |
1484 | 1486 | dbver = '.'.join(map(str, dbver_split[:2])) |
| 1487 | + elif portid == 'cloudberry': |
| 1488 | + # Assume Cloudberry will stick to semantic versioning |
| 1489 | + dbver = str(dbver_split[0]) |
1485 | 1490 | elif portid == 'postgres': |
1486 | 1491 | if is_rev_gte(dbver_split, get_rev_num('10.0')): |
1487 | 1492 | # Postgres starting 10.0 uses semantic versioning. Hence, |
|
0 commit comments