citusdata / citusdata/citus

pg_regress_multi.pl additions in 23e43b6 need some cleanup

Open
#325 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

@onderkalaci @jasonmp85 :
The pg_regress_multi.pl changes from 23e43b6 appear to be slightly unbaked - the perl code doesn't look right, and the way the the additional objects are handled seems to be rather inflexible, leading to pg_regress_multi.pl containing way too much knowledge.

```
%dataTypes = ('dummy_type', '(i integer)',
'order_side', ' ENUM (\'buy\', \'sell\')',
'test_composite_type', '(i integer, i2 integer)',
'bug_status', ' ENUM (\'new\', \'open\', \'closed\')');
```

this should, based on the usage, be an array containing the entire statement and it should be local 'my ..'.. And if not, the elements should at least be declared like `'dummy_type' => '(i integer)',` to make this easier to read.

```
%dataTypes = ('dummy_type', '(i integer)',
'order_side', ' ENUM (\'buy\', \'sell\')',
'test_composite_type', '(i integer, i2 integer)',
'bug_status', ' ENUM (\'new\', \'open\', \'closed\')');

# define functions as signature->definition
%functions = ('fake_fdw_handler()', 'fdw_handler AS \'citusdb\' LANGUAGE C STRICT;');

#define fdws as name->handler name
%fdws = ('fake_fdw', 'fake_fdw_handler');

#define server_name->fdw
%fdwServers = ('fake_fdw_server', 'fake_fdw');
```

This seems to be too specific to be handled inside pg_regress_multi.pl - how about making it an 'citus_fdw_test' extension, that's then installed via the --load-extension mechanism?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.