Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
446 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Generated subdirectories | ||
/results/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
########################################################################## | ||
# | ||
# foreign-data wrapper for ODBC | ||
# | ||
# Copyright (c) 2011, PostgreSQL Global Development Group | ||
# | ||
# This software is released under the PostgreSQL Licence | ||
# | ||
# Author: Zheng Yang <zhengyang4k@gmail.com> | ||
# | ||
# IDENTIFICATION | ||
# odbc_fdw/Makefile | ||
# | ||
########################################################################## | ||
|
||
MODULE_big = odbc_fdw | ||
OBJS = odbc_fdw.o | ||
|
||
EXTENSION = odbc_fdw | ||
DATA = odbc_fdw--1.0.sql | ||
|
||
REGRESS = odbc_fdw | ||
|
||
EXTRA_CLEAN = sql/odbc_fdw.sql expected/odbc_fdw.out | ||
|
||
SHLIB_LINK = -lodbc | ||
|
||
ifdef USE_PGXS | ||
PG_CONFIG = pg_config | ||
PGXS := $(shell $(PG_CONFIG) --pgxs) | ||
include $(PGXS) | ||
else | ||
subdir = contrib/odbc_fdw | ||
top_builddir = ../.. | ||
include $(top_builddir)/src/Makefile.global | ||
include $(top_srcdir)/contrib/contrib-global.mk | ||
endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,45 @@ | ||
ODBC FDW | ||
ODBC FDW (beta) for PostgreSQL 9.1+ | ||
=================================== | ||
|
||
This PostgreSQL extension implements a Foreign Data Wrapper (FDW) for | ||
remote databases using Open Database Connectivity(ODBC): http://en.wikipedia.org/wiki/Open_Database_Connectivity | ||
|
||
IMPORTANT: There're bugs in the existing version. I'm working on it and will | ||
be releasing another version very soon. | ||
|
||
|
||
Building | ||
-------- | ||
|
||
|
||
Limitations | ||
----------- | ||
|
||
|
||
Usage | ||
----- | ||
|
||
The following parameters can be set on a CouchDB foreign server: | ||
|
||
dsn: Database Source Name | ||
Default: myodbc | ||
|
||
|
||
Example | ||
------- | ||
|
||
CREATE SERVER odbc_server | ||
FOREIGN DATA WRAPPER odbc_fdw | ||
OPTIONS (dsn 'mydsn'); | ||
|
||
CREATE FOREIGN TABLE odbc_table (name text, age text) | ||
SERVER odbc_server | ||
OPTIONS (database 'testdb', name 'myname', age 'myage'); | ||
|
||
CREATE USER MAPPING FOR PUBLIC | ||
SERVER odbc_server | ||
OPTIONS (); | ||
|
||
-- | ||
Zheng Yang | ||
zhengyang4k@gmail.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/odbc_fdw.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*------------------------------------------------------------------------- | ||
* | ||
* foreign-data wrapper for ODBC | ||
* | ||
* Copyright (c) 2011, PostgreSQL Global Development Group | ||
* | ||
* This software is released under the PostgreSQL Licence | ||
* | ||
* Author: Zheng Yang <zhengyang4k@gmail.com> | ||
* | ||
* IDENTIFICATION | ||
* odbc_fdw/odbc_fdw--1.0.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; |
Oops, something went wrong.