|
| 1 | +CREATE SERVER re2_svr FOREIGN DATA WRAPPER clickhouse_fdw OPTIONS(dbname 're2_test'); |
| 2 | +CREATE USER MAPPING FOR CURRENT_USER SERVER re2_svr; |
| 3 | +SELECT clickhouse_raw_query('DROP DATABASE IF EXISTS re2_test'); |
| 4 | + clickhouse_raw_query |
| 5 | +---------------------- |
| 6 | + |
| 7 | +(1 row) |
| 8 | + |
| 9 | +SELECT clickhouse_raw_query('CREATE DATABASE re2_test'); |
| 10 | + clickhouse_raw_query |
| 11 | +---------------------- |
| 12 | + |
| 13 | +(1 row) |
| 14 | + |
| 15 | +SELECT clickhouse_raw_query($$ |
| 16 | + CREATE TABLE re2_test.t1 ( |
| 17 | + id Int32, |
| 18 | + val String |
| 19 | + ) ENGINE = MergeTree ORDER BY id |
| 20 | +$$); |
| 21 | + clickhouse_raw_query |
| 22 | +---------------------- |
| 23 | + |
| 24 | +(1 row) |
| 25 | + |
| 26 | +SELECT clickhouse_raw_query($$ |
| 27 | + INSERT INTO re2_test.t1 VALUES |
| 28 | + (1, 'POSIX uses BRE and ERE'), |
| 29 | + (2, 're2 uses finite automata'), |
| 30 | + (3, 'PCRE supports backtracking') |
| 31 | +$$); |
| 32 | + clickhouse_raw_query |
| 33 | +---------------------- |
| 34 | + |
| 35 | +(1 row) |
| 36 | + |
| 37 | +CREATE SCHEMA re2_test; |
| 38 | +IMPORT FOREIGN SCHEMA re2_test FROM SERVER re2_svr INTO re2_test; |
| 39 | +SET search_path = re2_test, public; |
| 40 | +CREATE EXTENSION re2; |
| 41 | +ERROR: extension "re2" is not available |
| 42 | +HINT: The extension must first be installed on the system where PostgreSQL is running. |
| 43 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2match(val, 're2'); |
| 44 | +ERROR: function re2match(text, unknown) does not exist |
| 45 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2match(v... |
| 46 | + ^ |
| 47 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 48 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2extract(val, '(re2)') = 're2'; |
| 49 | +ERROR: function re2extract(text, unknown) does not exist |
| 50 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2extract... |
| 51 | + ^ |
| 52 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 53 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2extractall(val, '[A-Z]+') = ARRAY['POSIX','BRE','ERE']; |
| 54 | +ERROR: function re2extractall(text, unknown) does not exist |
| 55 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2extract... |
| 56 | + ^ |
| 57 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 58 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2regexpextract(val, '(re2)', 1) = 're2'; |
| 59 | +ERROR: function re2regexpextract(text, unknown, integer) does not exist |
| 60 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2regexpe... |
| 61 | + ^ |
| 62 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 63 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2extractgroups(val, '(POSIX) uses (BRE)') = ARRAY['POSIX','BRE']; |
| 64 | +ERROR: function re2extractgroups(text, unknown) does not exist |
| 65 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2extract... |
| 66 | + ^ |
| 67 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 68 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2replaceregexpone(val, 'POSIX', 're2') = 're2 uses BRE and ERE'; |
| 69 | +ERROR: function re2replaceregexpone(text, unknown, unknown) does not exist |
| 70 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2replace... |
| 71 | + ^ |
| 72 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 73 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2replaceregexpall(val, ' ', '-') = 're2-uses-finite-automata'; |
| 74 | +ERROR: function re2replaceregexpall(text, unknown, unknown) does not exist |
| 75 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2replace... |
| 76 | + ^ |
| 77 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 78 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2countmatches(val, 'e') > 0; |
| 79 | +ERROR: function re2countmatches(text, unknown) does not exist |
| 80 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2countma... |
| 81 | + ^ |
| 82 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 83 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2countmatchescaseinsensitive(val, 'E') > 0; |
| 84 | +ERROR: function re2countmatchescaseinsensitive(text, unknown) does not exist |
| 85 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2countma... |
| 86 | + ^ |
| 87 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 88 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2multimatchany(val, ARRAY['POSIX','PCRE']); |
| 89 | +ERROR: function re2multimatchany(text, text[]) does not exist |
| 90 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2multima... |
| 91 | + ^ |
| 92 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 93 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2multimatchanyindex(val, ARRAY['POSIX','PCRE']) > 0; |
| 94 | +ERROR: function re2multimatchanyindex(text, text[]) does not exist |
| 95 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2multima... |
| 96 | + ^ |
| 97 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 98 | +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2multimatchallindices(val, ARRAY['POSIX','PCRE']) = ARRAY[1]; |
| 99 | +ERROR: function re2multimatchallindices(text, text[]) does not exist |
| 100 | +LINE 1: ...PLAIN (VERBOSE, COSTS OFF) SELECT * FROM t1 WHERE re2multima... |
| 101 | + ^ |
| 102 | +HINT: No function matches the given name and argument types. You might need to add explicit type casts. |
| 103 | +DROP EXTENSION re2; |
| 104 | +ERROR: extension "re2" does not exist |
| 105 | +DROP USER MAPPING FOR CURRENT_USER SERVER re2_svr; |
| 106 | +SELECT clickhouse_raw_query('DROP DATABASE re2_test'); |
| 107 | + clickhouse_raw_query |
| 108 | +---------------------- |
| 109 | + |
| 110 | +(1 row) |
| 111 | + |
| 112 | +DROP SERVER re2_svr CASCADE; |
| 113 | +NOTICE: drop cascades to foreign table t1 |
0 commit comments