LOAD

Name

LOAD  --  Dynamically loads an object file 動的にオブジェクトファイルを読み込む。

Synopsis

LOAD 'filename'
  

入力

filename

Object file for dynamic loading.

動的に読み込むオブジェクトファイル。

出力

LOAD

Message returned on successful completion.

正常終了した時に返されるメッセージ。

ERROR: LOAD: could not open file 'filename'

Message returned if the specified file is not found. The file must be visible to the Postgres backend, with the appropriate full path name specified, to avoid this message.

指定したファイルが存在しなかった時に返されるメッセージ。この メッセージを防ぐためには、指定するファイルは適切なフルパスで 指定した、Postgres バッ クエンドに対して 可視なものである必要があります。

説明

Loads an object (or ".o") file into the Postgres backend address space. Once a file is loaded, all functions in that file can be accessed. This function is used in support of user-defined types and functions.

オブジェクト(すなわち、".o")ファイルを Postgres バックエンドのアドレス空間に読 み込みます。ファイルがいったん読み込まれると、そのファイルの中の全 ての関数にアクセスできます。この関数はユーザ定義の型及び関数のサポ ートに使用されます。

If a file is not loaded using LOAD, the file will be loaded automatically the first time the function is called by Postgres. LOAD can also be used to reload an object file if it has been edited and recompiled. Only objects created from C language files are supported at this time.

ファイルが LOAD を使って読み込まれていない場合、 Postgres によってその関数が最初に呼び出 された時点で自動的にファイルが読み込まれます。オブジェクトファイル を編集し再コンパイルした場合にも、その再読み込みに LOAD を使用します。現時点では C 言語で作成された オブジェクトファイルのみがサポートされています。

注意

Functions in loaded object files should not call functions in other object files loaded through the LOAD command. For example, all functions in file A should call each other, functions in the standard or math libraries, or in Postgres itself. They should not call functions defined in a different loaded file B. This is because if B is reloaded, the Postgres loader is not able to relocate the calls from the functions in A into the new address space of B. If B is not reloaded, however, there will not be a problem.

読み込まれたオブジェクトファイル内の関数は、他の LOADコマンドを使って読み込まれるオブジェクトフ ァイル中の関数を呼び出してはいけません。例えば、ファイル A 中の全関数は、互いを、標準または数学ライブラ リにある関数を、Postgres内にある関数を呼び出すことができます。別の 読み込まれたファイル B 内で定義された関数を呼び 出してはいけません。この理由は、B が再読み込みさ れた場合に Postgres ローダが A 内の関数からの呼 び出しを B の新しいアドレス空間に再度合わせるこ とができないからです。B が再読み込みされなけれ ば、問題にはならないのですが。

Object files must be compiled to contain position independent code. For example, on DECstations you must use /bin/cc with the -G 0 option when compiling object files to be loaded.

オブジェクトファイルは、位置に依存しないコードを持つようにコンパイ ルされなければいけません。例えば DECstations の場合、読み込むべき オブジェクトをコンパイルする時には /bin/cc-G 0 オプ ションを付けて実行しなければなりません。

Note that if you are porting Postgres to a new platform, LOAD will have to work in order to support ADTs.

Postgres を新しいプラットホームに移植す る場合、LOAD が ADT をサポートするようにしなけ ればなりません。

使用法

Load the file /usr/postgres/demo/circle.o:

/usr/postgres/demo/circle.o ファイルを読み込 みます。

LOAD '/usr/postgres/demo/circle.o'
   

互換性

SQL92

There is no LOAD in SQL92.

SQL92 には LOAD はありませ ん。