Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
56.1. Foreign Data Wrapper Functions
Prev UpChapter 56. Writing A Foreign Data WrapperHome Next

56.1. Foreign Data Wrapper Functions

The FDW author needs to implement a handler function, and optionally a validator function. Both functions must be written in a compiled language such as C, using the version-1 interface. For details on C language calling conventions and dynamic loading, seeSection 37.9.

The handler function simply returns a struct of function pointers to callback functions that will be called by the planner, executor, and various maintenance commands. Most of the effort in writing an FDW is in implementing these callback functions. The handler function must be registered withPostgreSQL as taking no arguments and returning the special pseudo-typefdw_handler. The callback functions are plain C functions and are not visible or callable at the SQL level. The callback functions are described inSection 56.2.

The validator function is responsible for validating options given inCREATE andALTER commands for its foreign data wrapper, as well as foreign servers, user mappings, and foreign tables using the wrapper. The validator function must be registered as taking two arguments, a text array containing the options to be validated, and an OID representing the type of object the options are associated with (in the form of the OID of the system catalog the object would be stored in, eitherForeignDataWrapperRelationId,ForeignServerRelationId,UserMappingRelationId, orForeignTableRelationId). If no validator function is supplied, options are not checked at object creation time or object alteration time.


Prev Up Next
Chapter 56. Writing A Foreign Data Wrapper Home 56.2. Foreign Data Wrapper Callback Routines
epubpdf
Go to PostgreSQL 10
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp