Skip to content

Commit

Permalink
RELEASE_v2.1.1 (#34)
Browse files Browse the repository at this point in the history
Support Postgresql 14.0
Support check invalid options
  • Loading branch information
lamduongngoc authored Dec 21, 2021
1 parent bf8f926 commit 5dfaa13
Show file tree
Hide file tree
Showing 176 changed files with 770 additions and 62 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GridDB Foreign Data Wrapper for PostgreSQL

This PostgreSQL extension is a Foreign Data Wrapper (FDW) for [GridDB][1].
This version of griddb_fdw can work for PostgreSQL 10, 11, 12, 13 and 14. It is confirmed in GridDB 4.6.0.
This version of griddb_fdw can work for PostgreSQL 10, 11, 12, 13 and 14. It is confirmed in GridDB 4.6.1.

## 1. Installation
griddb_fdw requires GridDB's C client library. This library can be downloaded from the [GridDB][1] website on github[1].
Expand Down Expand Up @@ -187,6 +187,9 @@ Returning is way to obtain data if rows are modified by INSERT, UPDATE, and DELE
INSERT INTO ft1 (c0, c1) VALUES (1, 2) RETURNING c0, c1;
```

#### Don't support DIRECT MODIFICATION
#### Don't support IMPORT FOREIGN SCHEMA with option import_generated

## 5. License
Copyright (c) 2017-2021, TOSHIBA Corporation
Copyright (c) 2011-2016, EnterpriseDB Corporation
Expand Down
3 changes: 2 additions & 1 deletion deparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ typedef struct deparse_expr_cxt

StringInfo buf; /* output buffer to append to */
List **params_list; /* exprs that will become remote Params */
bool can_skip_cast; /* outer function can skip int2/int4/int8/float4/float8 cast */
bool can_skip_cast; /* outer function can skip
* int2/int4/int8/float4/float8 cast */
GridDBAggref *aggref;
} deparse_expr_cxt;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -687,14 +687,14 @@ ERROR: rowkey-column update is not supported
SELECT * FROM public.griddb_fdw_version();
griddb_fdw_version
--------------------
20100
20101
(1 row)

--Testcase 116:
SELECT griddb_fdw_version();
griddb_fdw_version
--------------------
20100
20101
(1 row)

--Test pushdown LIMIT...OFFSET
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9837,9 +9837,11 @@ FROM SERVER griddb_svr INTO import_grid4;
import_grid4 | FLOAT8_TBL | griddb_svr | |
import_grid4 | FLOAT8_TMP | griddb_svr | |
import_grid4 | INT2_TBL | griddb_svr | |
import_grid4 | INT2_TMP | griddb_svr | |
import_grid4 | INT4_TBL | griddb_svr | |
import_grid4 | INT4_TMP | griddb_svr | |
import_grid4 | INT8_TBL | griddb_svr | |
import_grid4 | INT8_TMP | griddb_svr | |
import_grid4 | J1_TBL | griddb_svr | |
import_grid4 | J2_TBL | griddb_svr | |
import_grid4 | T0 | griddb_svr | |
Expand Down Expand Up @@ -10097,7 +10099,7 @@ FROM SERVER griddb_svr INTO import_grid4;
import_grid4 | zt1 | griddb_svr | |
import_grid4 | zt2 | griddb_svr | |
import_grid4 | zt3 | griddb_svr | |
(264 rows)
(266 rows)

-- Assorted error cases
IMPORT FOREIGN SCHEMA griddb_schema FROM SERVER griddb_svr INTO import_grid4;
Expand Down Expand Up @@ -10290,6 +10292,7 @@ NOTICE: relation "nt3" already exists, skipping
NOTICE: relation "agg_t6" already exists, skipping
NOTICE: relation "loc2" already exists, skipping
NOTICE: relation "INT2_TBL" already exists, skipping
NOTICE: relation "INT2_TMP" already exists, skipping
NOTICE: relation "batch_table_p1" already exists, skipping
NOTICE: relation "tenk1" already exists, skipping
NOTICE: relation "innertab" already exists, skipping
Expand Down Expand Up @@ -10364,6 +10367,7 @@ NOTICE: relation "INT4_TMP" already exists, skipping
NOTICE: relation "bitwise_test" already exists, skipping
NOTICE: relation "agg_t1" already exists, skipping
NOTICE: relation "INT8_TBL" already exists, skipping
NOTICE: relation "INT8_TMP" already exists, skipping
NOTICE: relation "hpart13" already exists, skipping
IMPORT FOREIGN SCHEMA nonesuch FROM SERVER griddb_svr INTO import_grid4; -- same as 'public'
NOTICE: relation "aggtest" already exists, skipping
Expand Down Expand Up @@ -10556,6 +10560,7 @@ NOTICE: relation "nt3" already exists, skipping
NOTICE: relation "agg_t6" already exists, skipping
NOTICE: relation "loc2" already exists, skipping
NOTICE: relation "INT2_TBL" already exists, skipping
NOTICE: relation "INT2_TMP" already exists, skipping
NOTICE: relation "batch_table_p1" already exists, skipping
NOTICE: relation "tenk1" already exists, skipping
NOTICE: relation "innertab" already exists, skipping
Expand Down Expand Up @@ -10630,6 +10635,7 @@ NOTICE: relation "INT4_TMP" already exists, skipping
NOTICE: relation "bitwise_test" already exists, skipping
NOTICE: relation "agg_t1" already exists, skipping
NOTICE: relation "INT8_TBL" already exists, skipping
NOTICE: relation "INT8_TMP" already exists, skipping
NOTICE: relation "hpart13" already exists, skipping
IMPORT FOREIGN SCHEMA nonesuch FROM SERVER griddb_svr INTO notthere;
ERROR: schema "notthere" does not exist
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -687,14 +687,14 @@ ERROR: rowkey-column update is not supported
SELECT * FROM public.griddb_fdw_version();
griddb_fdw_version
--------------------
20100
20101
(1 row)

--Testcase 116:
SELECT griddb_fdw_version();
griddb_fdw_version
--------------------
20100
20101
(1 row)

--Test pushdown LIMIT...OFFSET
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9866,9 +9866,11 @@ FROM SERVER griddb_svr INTO import_grid4;
import_grid4 | FLOAT8_TBL | griddb_svr | |
import_grid4 | FLOAT8_TMP | griddb_svr | |
import_grid4 | INT2_TBL | griddb_svr | |
import_grid4 | INT2_TMP | griddb_svr | |
import_grid4 | INT4_TBL | griddb_svr | |
import_grid4 | INT4_TMP | griddb_svr | |
import_grid4 | INT8_TBL | griddb_svr | |
import_grid4 | INT8_TMP | griddb_svr | |
import_grid4 | J1_TBL | griddb_svr | |
import_grid4 | J2_TBL | griddb_svr | |
import_grid4 | T0 | griddb_svr | |
Expand Down Expand Up @@ -10126,7 +10128,7 @@ FROM SERVER griddb_svr INTO import_grid4;
import_grid4 | zt1 | griddb_svr | |
import_grid4 | zt2 | griddb_svr | |
import_grid4 | zt3 | griddb_svr | |
(264 rows)
(266 rows)

-- Assorted error cases
IMPORT FOREIGN SCHEMA griddb_schema FROM SERVER griddb_svr INTO import_grid4;
Expand Down Expand Up @@ -10319,6 +10321,7 @@ NOTICE: relation "nt3" already exists, skipping
NOTICE: relation "agg_t6" already exists, skipping
NOTICE: relation "loc2" already exists, skipping
NOTICE: relation "INT2_TBL" already exists, skipping
NOTICE: relation "INT2_TMP" already exists, skipping
NOTICE: relation "batch_table_p1" already exists, skipping
NOTICE: relation "tenk1" already exists, skipping
NOTICE: relation "innertab" already exists, skipping
Expand Down Expand Up @@ -10393,6 +10396,7 @@ NOTICE: relation "INT4_TMP" already exists, skipping
NOTICE: relation "bitwise_test" already exists, skipping
NOTICE: relation "agg_t1" already exists, skipping
NOTICE: relation "INT8_TBL" already exists, skipping
NOTICE: relation "INT8_TMP" already exists, skipping
NOTICE: relation "hpart13" already exists, skipping
IMPORT FOREIGN SCHEMA nonesuch FROM SERVER griddb_svr INTO import_grid4; -- same as 'public'
NOTICE: relation "aggtest" already exists, skipping
Expand Down Expand Up @@ -10585,6 +10589,7 @@ NOTICE: relation "nt3" already exists, skipping
NOTICE: relation "agg_t6" already exists, skipping
NOTICE: relation "loc2" already exists, skipping
NOTICE: relation "INT2_TBL" already exists, skipping
NOTICE: relation "INT2_TMP" already exists, skipping
NOTICE: relation "batch_table_p1" already exists, skipping
NOTICE: relation "tenk1" already exists, skipping
NOTICE: relation "innertab" already exists, skipping
Expand Down Expand Up @@ -10659,6 +10664,7 @@ NOTICE: relation "INT4_TMP" already exists, skipping
NOTICE: relation "bitwise_test" already exists, skipping
NOTICE: relation "agg_t1" already exists, skipping
NOTICE: relation "INT8_TBL" already exists, skipping
NOTICE: relation "INT8_TMP" already exists, skipping
NOTICE: relation "hpart13" already exists, skipping
IMPORT FOREIGN SCHEMA nonesuch FROM SERVER griddb_svr INTO notthere;
ERROR: schema "notthere" does not exist
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions expected/12.7/griddb_fdw.out → expected/12.8/griddb_fdw.out
Original file line number Diff line number Diff line change
Expand Up @@ -687,14 +687,14 @@ ERROR: rowkey-column update is not supported
SELECT * FROM public.griddb_fdw_version();
griddb_fdw_version
--------------------
20100
20101
(1 row)

--Testcase 116:
SELECT griddb_fdw_version();
griddb_fdw_version
--------------------
20100
20101
(1 row)

--Test pushdown LIMIT...OFFSET
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9889,9 +9889,11 @@ FROM SERVER griddb_svr INTO import_grid4;
import_grid4 | FLOAT8_TBL | griddb_svr | |
import_grid4 | FLOAT8_TMP | griddb_svr | |
import_grid4 | INT2_TBL | griddb_svr | |
import_grid4 | INT2_TMP | griddb_svr | |
import_grid4 | INT4_TBL | griddb_svr | |
import_grid4 | INT4_TMP | griddb_svr | |
import_grid4 | INT8_TBL | griddb_svr | |
import_grid4 | INT8_TMP | griddb_svr | |
import_grid4 | J1_TBL | griddb_svr | |
import_grid4 | J2_TBL | griddb_svr | |
import_grid4 | T0 | griddb_svr | |
Expand Down Expand Up @@ -10149,7 +10151,7 @@ FROM SERVER griddb_svr INTO import_grid4;
import_grid4 | zt1 | griddb_svr | |
import_grid4 | zt2 | griddb_svr | |
import_grid4 | zt3 | griddb_svr | |
(264 rows)
(266 rows)

-- Assorted error cases
IMPORT FOREIGN SCHEMA griddb_schema FROM SERVER griddb_svr INTO import_grid4;
Expand Down Expand Up @@ -10342,6 +10344,7 @@ NOTICE: relation "nt3" already exists, skipping
NOTICE: relation "agg_t6" already exists, skipping
NOTICE: relation "loc2" already exists, skipping
NOTICE: relation "INT2_TBL" already exists, skipping
NOTICE: relation "INT2_TMP" already exists, skipping
NOTICE: relation "batch_table_p1" already exists, skipping
NOTICE: relation "tenk1" already exists, skipping
NOTICE: relation "innertab" already exists, skipping
Expand Down Expand Up @@ -10416,6 +10419,7 @@ NOTICE: relation "INT4_TMP" already exists, skipping
NOTICE: relation "bitwise_test" already exists, skipping
NOTICE: relation "agg_t1" already exists, skipping
NOTICE: relation "INT8_TBL" already exists, skipping
NOTICE: relation "INT8_TMP" already exists, skipping
NOTICE: relation "hpart13" already exists, skipping
IMPORT FOREIGN SCHEMA nonesuch FROM SERVER griddb_svr INTO import_grid4; -- same as 'public'
NOTICE: relation "aggtest" already exists, skipping
Expand Down Expand Up @@ -10608,6 +10612,7 @@ NOTICE: relation "nt3" already exists, skipping
NOTICE: relation "agg_t6" already exists, skipping
NOTICE: relation "loc2" already exists, skipping
NOTICE: relation "INT2_TBL" already exists, skipping
NOTICE: relation "INT2_TMP" already exists, skipping
NOTICE: relation "batch_table_p1" already exists, skipping
NOTICE: relation "tenk1" already exists, skipping
NOTICE: relation "innertab" already exists, skipping
Expand Down Expand Up @@ -10682,6 +10687,7 @@ NOTICE: relation "INT4_TMP" already exists, skipping
NOTICE: relation "bitwise_test" already exists, skipping
NOTICE: relation "agg_t1" already exists, skipping
NOTICE: relation "INT8_TBL" already exists, skipping
NOTICE: relation "INT8_TMP" already exists, skipping
NOTICE: relation "hpart13" already exists, skipping
IMPORT FOREIGN SCHEMA nonesuch FROM SERVER griddb_svr INTO notthere;
ERROR: schema "notthere" does not exist
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions expected/13.3/griddb_fdw.out → expected/13.4/griddb_fdw.out
Original file line number Diff line number Diff line change
Expand Up @@ -687,14 +687,14 @@ ERROR: rowkey-column update is not supported
SELECT * FROM public.griddb_fdw_version();
griddb_fdw_version
--------------------
20100
20101
(1 row)

--Testcase 116:
SELECT griddb_fdw_version();
griddb_fdw_version
--------------------
20100
20101
(1 row)

--Test pushdown LIMIT...OFFSET
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9895,9 +9895,11 @@ FROM SERVER griddb_svr INTO import_grid4;
import_grid4 | FLOAT8_TBL | griddb_svr | |
import_grid4 | FLOAT8_TMP | griddb_svr | |
import_grid4 | INT2_TBL | griddb_svr | |
import_grid4 | INT2_TMP | griddb_svr | |
import_grid4 | INT4_TBL | griddb_svr | |
import_grid4 | INT4_TMP | griddb_svr | |
import_grid4 | INT8_TBL | griddb_svr | |
import_grid4 | INT8_TMP | griddb_svr | |
import_grid4 | J1_TBL | griddb_svr | |
import_grid4 | J2_TBL | griddb_svr | |
import_grid4 | T0 | griddb_svr | |
Expand Down Expand Up @@ -10155,7 +10157,7 @@ FROM SERVER griddb_svr INTO import_grid4;
import_grid4 | zt1 | griddb_svr | |
import_grid4 | zt2 | griddb_svr | |
import_grid4 | zt3 | griddb_svr | |
(264 rows)
(266 rows)

-- Assorted error cases
IMPORT FOREIGN SCHEMA griddb_schema FROM SERVER griddb_svr INTO import_grid4;
Expand Down Expand Up @@ -10348,6 +10350,7 @@ NOTICE: relation "nt3" already exists, skipping
NOTICE: relation "agg_t6" already exists, skipping
NOTICE: relation "loc2" already exists, skipping
NOTICE: relation "INT2_TBL" already exists, skipping
NOTICE: relation "INT2_TMP" already exists, skipping
NOTICE: relation "batch_table_p1" already exists, skipping
NOTICE: relation "tenk1" already exists, skipping
NOTICE: relation "innertab" already exists, skipping
Expand Down Expand Up @@ -10422,6 +10425,7 @@ NOTICE: relation "INT4_TMP" already exists, skipping
NOTICE: relation "bitwise_test" already exists, skipping
NOTICE: relation "agg_t1" already exists, skipping
NOTICE: relation "INT8_TBL" already exists, skipping
NOTICE: relation "INT8_TMP" already exists, skipping
NOTICE: relation "hpart13" already exists, skipping
IMPORT FOREIGN SCHEMA nonesuch FROM SERVER griddb_svr INTO import_grid4; -- same as 'public'
NOTICE: relation "aggtest" already exists, skipping
Expand Down Expand Up @@ -10614,6 +10618,7 @@ NOTICE: relation "nt3" already exists, skipping
NOTICE: relation "agg_t6" already exists, skipping
NOTICE: relation "loc2" already exists, skipping
NOTICE: relation "INT2_TBL" already exists, skipping
NOTICE: relation "INT2_TMP" already exists, skipping
NOTICE: relation "batch_table_p1" already exists, skipping
NOTICE: relation "tenk1" already exists, skipping
NOTICE: relation "innertab" already exists, skipping
Expand Down Expand Up @@ -10688,6 +10693,7 @@ NOTICE: relation "INT4_TMP" already exists, skipping
NOTICE: relation "bitwise_test" already exists, skipping
NOTICE: relation "agg_t1" already exists, skipping
NOTICE: relation "INT8_TBL" already exists, skipping
NOTICE: relation "INT8_TMP" already exists, skipping
NOTICE: relation "hpart13" already exists, skipping
IMPORT FOREIGN SCHEMA nonesuch FROM SERVER griddb_svr INTO notthere;
ERROR: schema "notthere" does not exist
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 38 additions & 2 deletions expected/14beta2/aggregates.out → expected/14.0/aggregates.out
Original file line number Diff line number Diff line change
Expand Up @@ -2405,6 +2405,42 @@ select aggfns(distinct a,b,c order by a,c using ~<~,b) filter (where a > 1) from
(1 row)

rollback;
-- check handling of bare boolean Var in FILTER
--Testcase 583:
select max(0) filter (where b1) from bool_test;
max
-----
0
(1 row)

--Testcase 584:
select (select max(0) filter (where b1)) from bool_test;
max
-----
0
(1 row)

-- check for correct detection of nested-aggregate errors in FILTER
--Testcase 585:
select max(unique1) filter (where sum(ten) > 0) from tenk1;
ERROR: aggregate functions are not allowed in FILTER
LINE 1: select max(unique1) filter (where sum(ten) > 0) from tenk1;
^
--Testcase 586:
select (select max(unique1) filter (where sum(ten) > 0) from int8_tbl) from tenk1;
ERROR: aggregate function calls cannot be nested
LINE 1: select (select max(unique1) filter (where sum(ten) > 0) from...
^
--Testcase 587:
select max(unique1) filter (where bool_or(ten > 0)) from tenk1;
ERROR: aggregate functions are not allowed in FILTER
LINE 1: select max(unique1) filter (where bool_or(ten > 0)) from ten...
^
--Testcase 588:
select (select max(unique1) filter (where bool_or(ten > 0)) from int8_tbl) from tenk1;
ERROR: aggregate function calls cannot be nested
LINE 1: select (select max(unique1) filter (where bool_or(ten > 0)) ...
^
-- ordered-set aggregates
begin;
--Testcase 377:
Expand Down Expand Up @@ -3409,7 +3445,7 @@ rollback;
-- does not lead to array overflow due to unexpected duplicate hash keys
-- see CAFeeJoKKu0u+A_A9R9316djW-YW3-+Gtgvy3ju655qRHR3jtdA@mail.gmail.com
--Testcase 527:
set enable_resultcache to off;
set enable_memoize to off;
--Testcase 528:
explain (costs off)
select 1 from tenk1
Expand All @@ -3426,7 +3462,7 @@ explain (costs off)
(7 rows)

--Testcase 529:
reset enable_resultcache;
reset enable_memoize;
--
-- Hash Aggregation Spill tests
--
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -688,14 +688,14 @@ ERROR: rowkey-column update is not supported
SELECT * FROM public.griddb_fdw_version();
griddb_fdw_version
--------------------
20100
20101
(1 row)

--Testcase 111:
SELECT griddb_fdw_version();
griddb_fdw_version
--------------------
20100
20101
(1 row)

--Test pushdown LIMIT...OFFSET
Expand Down Expand Up @@ -880,7 +880,7 @@ WHERE t1.ten = ss2.id;
-> Foreign Scan on public.onek t2
Output: num.id, t2.two
Remote SQL: SELECT * FROM onek LIMIT 1 OFFSET 5
-> Result Cache
-> Memoize
Output: ((num.id)), (t2.two)
Cache Key: (num.id), t2.two
-> Foreign Scan on public.onek t3
Expand Down
File renamed without changes.
Loading

0 comments on commit 5dfaa13

Please sign in to comment.