Skip to content

Commit

Permalink
skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhengYang committed Jun 14, 2011
1 parent 210925c commit fc2a350
Show file tree
Hide file tree
Showing 8 changed files with 446 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
# Generated subdirectories
/results/
38 changes: 38 additions & 0 deletions Makefile
@@ -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

46 changes: 45 additions & 1 deletion README
@@ -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
1 change: 1 addition & 0 deletions expected/.gitignore
@@ -0,0 +1 @@
/odbc_fdw.out
29 changes: 29 additions & 0 deletions odbc_fdw--1.0.sql
@@ -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;

0 comments on commit fc2a350

Please sign in to comment.