这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@nicuveo
Copy link
Contributor

@nicuveo nicuveo commented May 12, 2020

Description

This PR fixes an oversight of #4270.

While the console never had explicit support for foreign tables, they used to be implicitly queried alongside tables and views, as foreign tables do appear in information_schema.tables. In #4270, we switched to a more direct approach, explicitly querying pg_class instead, and explicitly specifying which types of postgres items we wanted to return: tables, views, and materialized views, effectively dropping support for foreign tables.

This PR fixes this by adding foreign tables to the list of items that the console fetches. However, while this restores a previously lost functionality, the console still doesn't have explicit support for foreign tables: they are misclassified as views, and some of the features of the console won't work with them (for instance, the "delete view" (sic) button will fail to drop the foreign table).

Adding full support for them in the console is beyond the scope of this PR and will be added to the backlog for triage.

Changelog

  • CHANGELOG.md is updated with user-facing content relevant to this PR.

Affected components

  • Console

Steps to test and verify

This PR doesn't have tests. After discussing it internally, we agreed that the ROI of the effort it would take to add them wouldn't be worth it, especially considering foreign tables are only partially supported.

The simplest way to verify this is to do something along those lines, using a running postgres server as its own foreign server:

create table foo (id integer, name text);
create extension postgres_fdw;
create server foreign_test
  foreign data wrapper postgres_fdw
  options (host 'localhost', port '$PORT', dbname '$DB');
create user mapping for $USER server foreign_test options (user '$USER');
create foreign table foreign_foo (id integer, value text)
  server foreign_test
  options(schema_name 'public', table_name 'foo');

@nicuveo nicuveo requested review from a team as code owners May 12, 2020 10:11
@nicuveo nicuveo linked an issue May 12, 2020 that may be closed by this pull request
@nicuveo nicuveo changed the title console: restore partial foreign tables support (fix #4714) console: restore partial support for foreign tables (fix #4714) May 12, 2020
CHANGELOG.md Outdated
- console: avoid count queries for large tables (#4692)
- console: add read replica support section to pro popup (#4118)
- console: allow modifying default value for PK (fix #4075) (#4679)
- console: re-enable partial support for foreign tables
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it "partial"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there never was explicit support for foreign tables in the console. They were misclassified as views, meaning several features of the console never worked with them. It was kind of an "accidental support", in a way. This PR restores this, but doesn't go any further.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see.

@rikinsk rikinsk added the c/console Related to console label May 12, 2020
Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com>
@nicuveo nicuveo force-pushed the console-schemas branch from 2b39464 to 00b59da Compare May 12, 2020 10:47
@hasura-bot
Copy link
Contributor

Review app for commit 00b59da deployed to Heroku: https://hge-ci-pull-4742.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4742-00b59da8

@rikinsk rikinsk requested a review from tirumaraiselvan May 12, 2020 11:04
Copy link
Contributor

@tirumaraiselvan tirumaraiselvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog approved

@hasura-bot
Copy link
Contributor

Review app for commit ab1285c deployed to Heroku: https://hge-ci-pull-4742.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4742-ab1285c4

@rikinsk rikinsk merged commit 201dcca into hasura:master May 12, 2020
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-4742.herokuapp.com is deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/console Related to console

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking foreign data wrappers from another schema, v 1.2.1

4 participants