Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Tweak README example.

  • Loading branch information...
commit 69af465723bcc9c72a9d60ff9811a79157d93e7d 1 parent cade47c
Dave Page authored September 09, 2011

Showing 1 changed file with 5 additions and 19 deletions. Show diff stats Hide diff stats

  1. 24  README
24  README
@@ -71,21 +71,8 @@ password:	The password to authenticate to the MySQL server with.
71 71
 Example
72 72
 -------
73 73
 
74  
--- Create the require functions for the FDW.
75  
-CREATE FUNCTION mysql_fdw_handler() 
76  
-    RETURNS fdw_handler 
77  
-    AS '$libdir/mysql_fdw' 
78  
-    LANGUAGE C STRICT;
79  
-
80  
-CREATE FUNCTION mysql_fdw_validator(text[], oid) 
81  
-    RETURNS void 
82  
-    AS '$libdir/mysql_fdw' 
83  
-    LANGUAGE C STRICT;
84  
-
85  
--- Create the data wrapper or "transport".
86  
-CREATE FOREIGN DATA WRAPPER mysql_fdw 
87  
-    HANDLER mysql_fdw_handler 
88  
-    VALIDATOR mysql_fdw_validator;
  74
+-- Install the extension
  75
+CREATE EXTENSION mysql_fdw;
89 76
 
90 77
 -- Create the foreign server, a pointer to the MySQL server.
91 78
 CREATE SERVER mysql_svr 
@@ -104,16 +91,15 @@ CREATE FOREIGN TABLE employees (
104 91
 CREATE FOREIGN TABLE overtime_2010 (
105 92
     id integer,
106 93
     employee_id integer,
107  
-    ot_date date,
108  
-    ot_hours integer))
  94
+    hours integer)
109 95
     SERVER mysql_svr
110  
-    OPTIONS (query 'SELECT * FROM overtime WHERE year = 2010;');
  96
+    OPTIONS (query 'SELECT id, employee_id, hours FROM hr.overtime WHERE year = 2010;');
111 97
 
112 98
 -- Create a user mapping to tell the FDW the username/password to 
113 99
 -- use to connect to MySQL, for PUBLIC. This could be done on a per-
114 100
 -- role basis.
115 101
 CREATE USER MAPPING FOR PUBLIC 
116  
-    SERVER mysql 
  102
+    SERVER mysql_svr 
117 103
     OPTIONS (username 'dpage', password '');
118 104
 
119 105
 -- 

0 notes on commit 69af465

Please sign in to comment.
Something went wrong with that request. Please try again.