forked from bluthg/odbc_fdw
-
Notifications
You must be signed in to change notification settings - Fork 22
/
odbc_fdw--0.5.2.sql
44 lines (37 loc) · 1.19 KB
/
odbc_fdw--0.5.2.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*-------------------------------------------------------------------------
*
* foreign-data wrapper for ODBC
*
* Copyright (c) 2011, PostgreSQL Global Development Group
* Copyright (c) 2016-2020 CARTO
*
* This software is released under the PostgreSQL Licence
*
* Original author: Zheng Yang <zhengyang4k@gmail.com>
*
* IDENTIFICATION
* odbc_fdw/odbc_fdw--0.5.2.sql
*
*-------------------------------------------------------------------------
*/
CREATE FUNCTION odbc_fdw_handler()
RETURNS fdw_handler
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
CREATE FUNCTION odbc_fdw_validator(text[], oid)
RETURNS void
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
CREATE FOREIGN DATA WRAPPER odbc_fdw
HANDLER odbc_fdw_handler
VALIDATOR odbc_fdw_validator;
CREATE TYPE __tabledata AS (schema text, name text);
CREATE FUNCTION ODBCTablesList(text, integer DEFAULT 0) RETURNS SETOF __tabledata
AS 'MODULE_PATHNAME', 'odbc_tables_list'
LANGUAGE C STRICT;
CREATE FUNCTION ODBCTableSize(text, text) RETURNS INTEGER
AS 'MODULE_PATHNAME', 'odbc_table_size'
LANGUAGE C STRICT;
CREATE FUNCTION ODBCQuerySize(text, text) RETURNS INTEGER
AS 'MODULE_PATHNAME', 'odbc_query_size'
LANGUAGE C STRICT;