File: getting-started.rst

package info (click to toggle)
postgresql-multicorn 1.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,244 kB
  • sloc: ansic: 3,324; python: 2,258; sql: 751; makefile: 259; sh: 81
file content (37 lines) | stat: -rw-r--r-- 988 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
*****
Usage
*****

The multicorn foreign data wrapper is not different from other foreign data
wrappers.

To use it, you have to:

- Create the extension in the target database.
  As a PostgreSQL super user, run the following SQL:

  .. code-block:: sql

      CREATE EXTENSION multicorn;


- Create a server.
  In the SQL ``OPTIONS`` clause, you must provide an options named wrapper,
  containing the fully-qualified class name of the concrete python foreign data
  wrapper you want to use:

  .. code-block:: sql

      CREATE SERVER multicorn_imap FOREIGN DATA WRAPPER multicorn
      options (
        wrapper 'multicorn.imapfdw.ImapFdw'
      );


You can then proceed on with the actual foreign tables creation, and pass them
the needed options.

Each foreign data wrapper supports its own set of options, and may interpret the
columns definitions differently.

You should look at the documentation for the specific :doc:`Foreign Data Wraper documentation <foreign-data-wrappers>`