Your SlideShare is downloading. ×
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Hachiojipm11
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Hachiojipm11

6,481

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
6,481
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Hachioji.pm #11 2011/12/3
  • 2. About MeHideaki Ohno Twitter : @hide_o_55 Hatena: id:hide_o_55 github: http://hideo55.github.com/
  • 3. Theme
  • 4. Theme
  • 5. DB
  • 6. DB
  • 7. MySQL
  • 8. PostgreSQL
  • 9. PostgreSQLForeign Data Wrapper Perl
  • 10. Foreign Data Wrapper SQL MED(Management of ExternalData) PostgreSQL PostgreSQLPostgreSQL 9.1MySQL, Twitter, IMAP ...
  • 11. Foreign Data Wrappertypedef FdwPlan *(*PlanForeignScan_function) (Oid foreigntableid, PlannerInfo*root, RelOptInfo*baserel);typedef void (*ExplainForeignScan_function) (ForeignScanState *node, struct ExplainState*es);typedef void (*BeginForeignScan_function) (ForeignScanState *node, int eflags);typedef TupleTableSlot *(*IterateForeignScan_function) (ForeignScanState*node);typedef void (*ReScanForeignScan_function) (ForeignScanState *node);typedef void (*EndForeignScan_function) (ForeignScanState *node);typedef struct FdwRoutine{ NodeTag type; PlanForeignScan_function PlanForeignScan; ExplainForeignScan_function ExplainForeignScan; BeginForeignScan_function BeginForeignScan; IterateForeignScan_function IterateForeignScan; ReScanForeignScan_function ReScanForeignScan; EndForeignScan_function EndForeignScan;} FdwRoutine;
  • 12. perl_fdwDatum perl_fdw_handler( PG_FUNCTION_ARGS) { FdwRoutine *fdwroutine = makeNode(FdwRoutine); fdwroutine->PlanForeignScan = perlPlanForeignScan; fdwroutine->ExplainForeignScan = perlExplainForeignScan; fdwroutine->BeginForeignScan = perlBeginForeignScan; fdwroutine->IterateForeignScan = perlIterateForeignScan; fdwroutine->ReScanForeignScan = perlReScanForeignScan; fdwroutine->EndForeignScan = perlEndForeignScan; PG_RETURN_POINTER(fdwroutine);}
  • 13. perl_fdw
  • 14. perl_fdwCREATE EXTENSION perl_fdw;CREATE SERVER perl_hoge FOREIGNDATA WRAPPER perl_fdwoptions ( wrapper Foo::Bar);
  • 15. perl_fdwCREATE FOREIGN TABLE hoge ( id INTEGER, name text) SERVER perl_hoge OPTIONS( foo ‘bar’);
  • 16. m(__)m
  • 17. PGXN(PostgreSQL Extension Network) Chrome Extension PGXN Searchhttps://github.com/hideo55/chrome-pgxn-search

×