microsoft / microsoft/vscode-pgsql
Foreign Table not recognized as such
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 395
- Forks
- 33
- Avg merge
- 1h 46m
- Merged PRs (30d)
- 3
Description
Describe the bug
The Foreign Data Wrapper tables are displayed like tables, but their properties are not correct. For example. nothing displayed in properties
The Create Script fails with:
Error running command pgsql.scriptCreate: 'NoneType' object has no attribute 'get'. This is likely caused by the extension that contributes pgsql.scriptCreate.
To Reproduce
CREATE EXTENSION IF NOT EXISTS postgres_fdw;
CREATE SERVER s
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (
host 'localhost',
port '5432',
dbname 'postgres'
);
CREATE USER MAPPING FOR current_user
SERVER s
OPTIONS (
user 'postgres',
password 'xxx' --------------> change to your password
);
CREATE SCHEMA IF NOT EXISTS schema1;
CREATE SCHEMA IF NOT EXISTS schema2;
CREATE TABLE schema1.t AS SELECT 'Hello World' AS message;
IMPORT FOREIGN SCHEMA schema1
FROM SERVER s
INTO schema2;
EXPLAIN SELECT * FROM schema1.t; --------> should show Seq Scan
EXPLAIN SELECT * FROM schema2.t; --------> should show Foreign Scan
Then click on the schema2 table t and try the different actions
Expected behavior
I think they should show in a Foreign Table list rather than with Table, and properties / create script should work
VS Code version
Extension version 1.24
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied PostgreSQL reproduction, including postgres_fdw, then inspect the schema2 table actions in the VS Code extension. Compare how the foreign table is classified with the properties and create-script paths. Done means foreign tables appear in the appropriate list and both properties and create script work without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100