バージョンごとのドキュメント一覧

42.12. Tclプロシージャ名 #

<title>Tcl Procedure Names</title>

In <productname>PostgreSQL</productname>, the same function name can be used for different function definitions if the functions are placed in different schemas, or if the number of arguments or their types differ. Tcl, however, requires all procedure names to be distinct. PL/Tcl deals with this by including the argument type names in the internal Tcl procedure name, and then appending the function's object ID (OID) to the internal Tcl procedure name if necessary to make it different from the names of all previously-loaded functions in the same Tcl interpreter. Thus, <productname>PostgreSQL</productname> functions with the same name and different argument types will be different Tcl procedures, too. This is not normally a concern for a PL/Tcl programmer, but it might be visible when debugging. 《マッチ度[67.537313]》PostgreSQLでは、その関数の引数の数または引数の型が異なっていれば、同じ関数名を異なる関数定義に使用することが可能です。 しかし、Tclではプロシージャ名の重複は許されません。 PL/Tclでは、プロシージャ名の一部にpg_procシステムテーブルにあるその関数のオブジェクトIDを持たせた内部的なTclプロシージャ名を作成することでこれに対応しています。 したがって、こういった異なる引数の型を持つ同じ名前のPostgreSQL関数は、異なるTclプロシージャになります。 PL/Tclプログラマから見ますと、通常は問題にはなりませんが、デバッグの際に表面に現れます。 《機械翻訳》PostgreSQLでは、関数が異なるスキーマにある場合や、引数の数や型が異なる場合に、同じ関数名前を異なる関数定義に使用することができます。 しかし、Tclでは、すべてのプロシージャ名が異なる必要があります。 PL/Tclでは、引数タイプ名を内部Tclプロシージャ名前に含め、必要に応じて関数のオブジェクトid(oid)を内部Tclプロシージャ名前に追加することで、これに対応しています。 これにより、同じTclインタプリタに以前にロードされたすべての関数とは異なる名前にmakeされます。 したがって、PostgreSQL同じ名前と異なる引数の型を持つ関数は、異なるTclプロシージャになります。 これは通常、PL/Tclプログラマでは問題になりませんが、デバッグ時に可視になる場合があります。

For this reason among others, a PL/Tcl function cannot call another one directly (that is, within Tcl). If you need to do that, you must go through SQL, using <function>spi_exec</function> or a related command. 《機械翻訳》この理由から、PL/Tclの関数は、他の呼び出しを直接(つまり、Tclの内部で)SQLすることはできません。 その必要がある場合、spi_execまたは関連するコマンドを使用して、東京を経由する必要があります。