Skip to content

Commit

Permalink
Support EXTENSION.
Browse files Browse the repository at this point in the history
Since FDW appears from 9.1 as well, we don't bother multi-version
support for this module.
  • Loading branch information
umitanuki committed May 13, 2011
1 parent 12bda65 commit 58a2fa2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -3,9 +3,9 @@
LIBJSON = libjson-0.8 LIBJSON = libjson-0.8
MODULE_big = twitter_fdw MODULE_big = twitter_fdw
OBJS = twitter_fdw.o $(LIBJSON)/json.o OBJS = twitter_fdw.o $(LIBJSON)/json.o
EXTENSION = twitter_fdw
DATA = twitter_fdw--1.0.sql


DATA_built = twitter_fdw.sql
DATA = uninstall_twitter_fdw.sql
REGRESS = twitter_fdw REGRESS = twitter_fdw
SHLIB_LINK = -lcurl SHLIB_LINK = -lcurl


Expand Down
4 changes: 1 addition & 3 deletions expected/twitter_fdw.out
@@ -1,6 +1,4 @@
SET client_min_messages = warning; CREATE EXTENSION twitter_fdw;
\set ECHO none
RESET client_min_messages;
SELECT count(*) FROM twitter; SELECT count(*) FROM twitter;
count count
------- -------
Expand Down
6 changes: 1 addition & 5 deletions sql/twitter_fdw.sql
@@ -1,8 +1,4 @@
SET client_min_messages = warning; CREATE EXTENSION twitter_fdw;
\set ECHO none
\i twitter_fdw.sql
\set ECHO all
RESET client_min_messages;


SELECT count(*) FROM twitter; SELECT count(*) FROM twitter;


Expand Down
9 changes: 3 additions & 6 deletions twitter_fdw.sql.in → twitter_fdw--1.0.sql
@@ -1,17 +1,14 @@
/* contrib/twitter_fdw/twitter_fdw.sql.in */ /* contrib/twitter_fdw/twitter_fdw--1.0.sql */

-- Adjust this setting to control where the objects get created.
SET search_path = public;


-- create wrapper with validator and handler -- create wrapper with validator and handler
CREATE OR REPLACE FUNCTION twitter_fdw_validator (text[], oid) CREATE OR REPLACE FUNCTION twitter_fdw_validator (text[], oid)
RETURNS bool RETURNS bool
AS 'MODULE_PATHNAME','twitter_fdw_validator' AS 'MODULE_PATHNAME'
LANGUAGE C STRICT; LANGUAGE C STRICT;


CREATE OR REPLACE FUNCTION twitter_fdw_handler () CREATE OR REPLACE FUNCTION twitter_fdw_handler ()
RETURNS fdw_handler RETURNS fdw_handler
AS 'MODULE_PATHNAME','twitter_fdw_handler' AS 'MODULE_PATHNAME'
LANGUAGE C STRICT; LANGUAGE C STRICT;


CREATE FOREIGN DATA WRAPPER twitter_fdw CREATE FOREIGN DATA WRAPPER twitter_fdw
Expand Down

0 comments on commit 58a2fa2

Please sign in to comment.