Skip to content

Commit 5b886af

Browse files
bichht0608hrkuma
authored andcommitted
Release 2.4.0
1 parent e6c224a commit 5b886af

File tree

203 files changed

+67547
-48636
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+67547
-48636
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ GridDB Foreign Data Wrapper for PostgreSQL
22
==========================================
33

44
This is a foreign data wrapper (FDW) to connect [PostgreSQL](https://www.postgresql.org/)
5-
to [GridDB](https://github.com/griddb). This FDW works with PostgreSQL 12, 13, 14, 15, 16 and confirmed with GridDB 5.1.0.
6-
5+
to [GridDB](https://github.com/griddb). This FDW works with PostgreSQL 13, 14, 15, 16, 17 and confirmed with GridDB 5.5.0.
76

87
<img src="https://upload.wikimedia.org/wikipedia/commons/2/29/Postgresql_elephant.svg" align="center" height="100" alt="PostgreSQL"/> + <img src="https://docs.griddb.net/logo.png" align="center" height="100" alt="GridDB"/>
98

@@ -39,6 +38,9 @@ For PostgreSQL version 14 or later:
3938
- Support discard cached connections to foreign servers by using function `griddb_disconnect('server_name')`, `griddb_disconnect_all()`.
4039
- Support deparse `ANY`/`ALL ARRAY` with the argument is constant.
4140

41+
For PostgreSQL version 16 or later:
42+
- Support Bulk INSERT with COPY command
43+
4244
### Pushdowning
4345

4446
- Support function push down in `WHERE` clause:
@@ -448,7 +450,7 @@ Reference FDW realisation, `postgres_fdw`
448450

449451
License
450452
-------
451-
Copyright (c) 2018, TOSHIBA CORPORATION
453+
Copyright (c) 2018, TOSHIBA CORPORATION
452454
Copyright (c) 2011-2016, EnterpriseDB Corporation
453455

454456
Permission to use, copy, modify, and distribute this software and its
@@ -458,4 +460,4 @@ the following two paragraphs appear in all copies.
458460

459461
See the [`LICENSE`][1] file for full details.
460462

461-
[1]: LICENSE
463+
[1]: LICENSE

compare.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,12 @@ int (*griddb_get_comparator_tuplekey(GSType gs_type)) (const void *, const voi
123123
/*
124124
* Comparison functions for hash key.
125125
* Arguments are a pointer of Datum.
126+
* keysize is not used but is needed because of the signature of HashCompareFunc
127+
* to avoid warnings when build source code.
126128
*/
127129

128130
static int
129-
griddb_compare_datum_string(const void *a, const void *b)
131+
griddb_compare_datum_string(const void *a, const void *b, Size keysize)
130132
{
131133
Datum val1 = *(Datum *) a;
132134
Datum val2 = *(Datum *) b;
@@ -143,7 +145,7 @@ griddb_compare_datum_string(const void *a, const void *b)
143145
}
144146

145147
static int
146-
griddb_compare_datum_integer(const void *a, const void *b)
148+
griddb_compare_datum_integer(const void *a, const void *b, Size keysize)
147149
{
148150
Datum val1 = *(Datum *) a;
149151
Datum val2 = *(Datum *) b;
@@ -154,7 +156,7 @@ griddb_compare_datum_integer(const void *a, const void *b)
154156
}
155157

156158
static int
157-
griddb_compare_datum_long(const void *a, const void *b)
159+
griddb_compare_datum_long(const void *a, const void *b, Size keysize)
158160
{
159161
Datum val1 = *(Datum *) a;
160162
Datum val2 = *(Datum *) b;
@@ -165,7 +167,7 @@ griddb_compare_datum_long(const void *a, const void *b)
165167
}
166168

167169
static int
168-
griddb_compare_datum_timestamp(const void *a, const void *b)
170+
griddb_compare_datum_timestamp(const void *a, const void *b, Size keysize)
169171
{
170172
Datum val1 = *(Datum *) a;
171173
Datum val2 = *(Datum *) b;
@@ -176,7 +178,7 @@ griddb_compare_datum_timestamp(const void *a, const void *b)
176178
}
177179

178180
/* Return comparator based on gs_type for hash used in griddb_fdw. */
179-
int (*griddb_get_comparator_datum(GSType gs_type)) (const void *, const void *)
181+
int (*griddb_get_comparator_datum(GSType gs_type)) (const void *, const void *, Size keysize)
180182
{
181183
switch (gs_type)
182184
{

connection.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ static GSGridStore * griddb_connect_server(char *address, char *port,
8888
char *passwd);
8989
static void make_new_connection(ConnCacheEntry *entry,
9090
UserMapping *user,
91-
Oid foreigntableid);
91+
Oid foreigntableid,
92+
Oid userid);
9293
static void griddb_begin_xact(ConnCacheEntry *entry);
9394
static void griddb_end_xact(ConnCacheEntry *entry, bool isCommit,
9495
GSGridStore * store);
@@ -109,7 +110,7 @@ static bool disconnect_cached_connections(Oid serverid);
109110
* is established if we don't already have a suitable one.
110111
*/
111112
GSGridStore *
112-
griddb_get_connection(UserMapping *user, bool will_prep_stmt, Oid foreigntableid)
113+
griddb_get_connection(UserMapping *user, bool will_prep_stmt, Oid foreigntableid, Oid userid)
113114
{
114115
bool found;
115116
ConnCacheEntry *entry;
@@ -182,7 +183,7 @@ griddb_get_connection(UserMapping *user, bool will_prep_stmt, Oid foreigntableid
182183
* connection.
183184
*/
184185
if (entry->store == NULL)
185-
make_new_connection(entry, user, foreigntableid);
186+
make_new_connection(entry, user, foreigntableid, userid);
186187

187188
/*
188189
* Start a new transaction if needed.
@@ -197,12 +198,12 @@ griddb_get_connection(UserMapping *user, bool will_prep_stmt, Oid foreigntableid
197198
* establish new connection to the remote server.
198199
*/
199200
static void
200-
make_new_connection(ConnCacheEntry *entry, UserMapping *user, Oid foreigntableid)
201+
make_new_connection(ConnCacheEntry *entry, UserMapping *user, Oid foreigntableid, Oid userid)
201202
{
202203
ForeignServer *server = GetForeignServer(user->serverid);
203204

204205
/* Fetch the options */
205-
griddb_opt *opt = griddb_get_options(foreigntableid);
206+
griddb_opt *opt = griddb_get_options(foreigntableid, userid);
206207

207208
/*
208209
* Determine whether to keep the connection that we're about to make here

deparse.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ typedef enum
5959
{
6060
FDW_COLLATE_NONE, /* expression is of a noncollatable type */
6161
FDW_COLLATE_SAFE, /* collation derives from a foreign Var */
62-
FDW_COLLATE_UNSAFE /* collation derives from something else */
62+
FDW_COLLATE_UNSAFE, /* collation derives from something else */
6363
} FDWCollateState;
6464

6565
typedef struct foreign_loc_cxt
@@ -1423,7 +1423,6 @@ foreign_expr_walker(Node *node,
14231423
case T_Const:
14241424
{
14251425
Const *c = (Const *) node;
1426-
HeapTuple tuple;
14271426

14281427
if (c->consttype == INTERVALOID ||
14291428
c->consttype == BITOID ||
@@ -2910,6 +2909,7 @@ griddb_set_container_info(GSContainerInfo containerinfo, Relation rel)
29102909
GSColumnInfo *columnInfoList;
29112910

29122911
container_info = (GSContainerInfo) GS_CONTAINER_INFO_INITIALIZER;
2912+
columnInfo = (GSColumnInfo) GS_COLUMN_INFO_INITIALIZER;
29132913

29142914
/* count number of columns */
29152915
for (i = 0; i < tupdesc->natts; i++)

0 commit comments

Comments
 (0)