外部データソース内のテーブルの名前と ID を照会します。
構文
setof record ST_ForeignTables(cstring source,
cstring driver default '',
out integer id,
out cstring table_name);パラメーター
| パラメーター | 説明 |
|---|---|
source | テーブルを含むデータソースです。詳細については、「オブジェクトストレージのパス」をご参照ください。 |
driver | データソースにアクセスするために使用するドライバーです。「ST_FDWDrivers」をご参照ください。指定しない場合、デフォルトのドライバーが使用されます。 |
id | テーブルの ID です。 |
table_name | テーブルの名前です。 |
例
デフォルトのドライバーを使用する
SELECT table_name FROM (select (ST_ForeignTables('OSS://<access_id>:<secrect_key>@[<Endpoint>]/<bucket>/path_to/file')).*) table_test ORDER BY table_name::text ASC; ----------------- poi road countyESRI Shapefile ドライバーを使用する
SELECT table_name FROM (select (ST_ForeignTables('OSS://<access_id>:<secrect_key>@[<Endpoint>]/<bucket>/path_to/file', 'ESRI Shapefile')).*) table_test ORDER BY table_name::text ASC; ----------------- poi road