Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL foreign tables: handle them like views (fixes #30990) [nee… #30992

Merged
merged 1 commit into from
Jul 31, 2019
Merged

PostgreSQL foreign tables: handle them like views (fixes #30990) [nee… #30992

merged 1 commit into from
Jul 31, 2019

Conversation

alkra
Copy link
Contributor

@alkra alkra commented Jul 30, 2019

Description

Fixes #30990

PostgreSQL data provider does not handle the case of a foreign table.

  1. Add a case matching for Relkind::ForeignTable
  2. Enable fetching the columns, so that the user can choose

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and contain sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit

…ds-docs]

PostgreSQL foreign tables are not explicitely supported by the PosgreSQL provider.
This commit removes the error message, and handle foreign tables like views.

A foreign table cannot (in PostgreSQL <10) state what column
is the primary key, so we let the user tell QGIS.
@alkra
Copy link
Contributor Author

alkra commented Jul 31, 2019

Checklist:

  • I am unsure whether this is a new feature.
  • The commit title seems too long, [needs-docs] is truncated, does it matter?
  • I don't know how to write a unit test for this.

(Under WSL; I had to comment out the changes introduced by 9b04a29 for scripts/prepare-commit.sh to run)

@nyalldawson
Copy link
Collaborator

I am unsure whether this is a new feature.

No - it's a fix.

The commit title seems too long, [needs-docs] is truncated, does it matter?

Nope, no issue

I don't know how to write a unit test for this.

I don't think it's a requirement for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsupported relation type 'ForeignTable'
2 participants