Uh oh!
There was an error while loading. Please reload this page.
Implementation of external data management #1158 - #8759
Conversation
paradox1307
commented
Sep 30, 2025
This is a draft implementation of external data management (SQL:MED). It will be improved after the metacache #7954 is merged. |
sim1984
commented
Sep 30, 2025
Are there any restrictions for users/roles on using foreign servers? I think there should be. That is, we should have something like: This is important, especially if the foreign server stores authentication data. Not every authenticated user should be able to use it in an |
| | RDB$FOREIGN_SERVER_NAME | CHAR \(63\) | The foreign server name | | ||
| | RDB$FOREIGN_OPTION_NAME | CHAR \(63\) | Option name | | ||
| | RDB$FOREIGN_OPTION_VALUE | VARCHAR \(32765\) | Option value | | ||
| | RDB$OWNER_NAME | SHORT | Option type | |
There was a problem hiding this comment.
May be RDB$FOREIGN_OPTION_TYPE ?
| continue; | ||
| buffer.append(option.first.c_str()); | ||
| buffer.append(";"); |
There was a problem hiding this comment.
Why is there a semicolon ; here? I would have expected an equals symbol =.
There was a problem hiding this comment.
The idea was that option names and option values follow each other and there is no sense in adding a special character to separate them, i.e. option_1_name;option_1_value;option_2_name;option_2_value;.... If this is confusing, it can be changed to something else.
There was a problem hiding this comment.
In principle, this approach will work, provided that each option requires a value. In this case, we eliminate the possibility of passing only the option name as a flag.
GRANT USAGE ON FOREIGN SERVER <server_name>
TO <grantee_list> [WITH GRANT OPTION]
[{GRANTED BY | AS} [USER] <grantor>];
REVOKE [GRANT OPTION FOR]
USAGE ON FOREIGN SERVER <server_name>
FROM <grantee_list>
[{GRANTED BY | AS} [USER] <grantor>];paradox1307
commented
Oct 29, 2025
Yes, there should be restrictions on using foreign servers. The MED standard requires |
| [[DROP] FOREIGN DATA WRAPPER | [DROP] USING PLUGIN <provider(plugin)>] [OPTIONS(<option> [, <option> ...] )] | ||
| <option> ::= { | ||
| [DROP] <option name> [= 'value'] | ||
| | [DROP] <option name> [{FILE | ENV}] ['value'] } |
There was a problem hiding this comment.
This description confuses people because it's unclear what's required and what's optional. A better explanation would be:
ALTER SERVER <foreign server name>
[[DROP] {FOREIGN DATA WRAPPER | USING PLUGIN} <provider(plugin)>] [OPTIONS (<option> [, <option> ...] )]
<option> ::= {
<option name> = 'value'
| <option name> [{FILE | ENV}] 'value' | DROP <option name>
}
sim1984
commented
Oct 29, 2025
This should be described in the |
paradox1307
commented
Dec 3, 2025
Added description |
sim1984
commented
Mar 16, 2026
I will join the testing with my ODBCEngine/MySQLEngine providers when the Windows builds are ready. |
| * TABLE_NAME - name of the table on the foreign server. | ||
| General column options are: | ||
| * COLUMN_NAME - the name of the column in the foreign table; | ||
| * PRIMARY_KEY - an identifier explicitly specifying that the column is used in the primary key. |
sim1984
commented
Mar 20, 2026
For consistency, it would be nice to add the ability to save user comments like for other database objects. This is how it should look for foreign servers. I can't imagine how this might look for user mappings, since they don't have simple names. For foreign tables, it might look like this. Perhaps the additional |
… condition for a foreign table if possible
…tements is finished
Link to RFC - Distributed queries (Management of External Data) proposal