-
Notifications
You must be signed in to change notification settings - Fork 102
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
Import foreign schema #91
Conversation
Can one of the admins verify this patch? |
Test this, please |
Test FAILed. |
As IMPORT FOREIGN SCHEMA is only available for PostgreSQL >= 9.5, I will need to modify the script and the tests to support different PostgreSQL versions. @select-artur, let me think a little about it and I'll make a patch so you can rebase it into this branch. It won't take long. Meanwhile, may I suggest you squash your commits into a single one? |
Done.
Thank you. |
@select-artur, the patch is ready and merged. Now all the SQL files have a corresponding JSON file with, among other things, the minimum and maximum version required for each of the tests Please rebase changes from master into your branch, fix the conflicts and just add a file tests/tests/postgresql/003_import_schema.json with the following content:
As the foreign tables for all other tests are deleted before running the actual test (check tests/tests/postgresql/003_tinyintmin.sql for example), you could also create your test as number 032, to avoid renaming all the previous tests (if it's more comfortable for you) |
I see that there are no conflicts, so it should be enough if you just add the JSON file as "tests/tests/postgresql/003_import_schema.json" :-) |
Thanks! I will add it. |
Great! @GeoffMontee or me will run the tests as soon as one of us see the commit. |
I suppose I did it.
I've create import test as number 003 because I concern if IMPORT FOREIGN SCHEMA will be executed by the last query, then an error can be throwed. Because all foreign table will be exist. I cant test it now, because I will have the MS SQL environment only on monday. Of course I can create import test as number 032 if I'm wrong. |
Test this, please |
@select-artur, good point! I can't see any mention about what will happen if one of the tables already exist, so most probably it will fail as you correctly guessed. |
Test FAILed. |
retest this, please (test faileds because of a problem starting PostgreSQL, not because of the PR itself) |
Test PASSed. |
The tests passed, so this has been merged. Thanks a lot for the contribution, @select-artur! |
Thanks! |
Hi, Not working on Sybase (12.5), since Sybase use sysobjects to store Tables informations. |
Hello @elliotVR , Maybe the solution is to add new option to IMPORT FOREIGN SCHEMA. Depening on this option it is necessary use various queries to retreive information about objects. Or maybe there is a possibility to get from tds_fdw is server Sybase or SQL Server. |
Hi @elliotVR, I just created issue #104 to track that we do not have a Sybase implementation of IMPORT FOREIGN SCHEMA yet. @select-artur, If you are interested in trying to develop the Sybase implementation of |
Hi, |
That would be awesome, @select-artur! tds_fdw's Sybase users would probably appreciate having that functionality. Thanks! |
Hello,
This pull request fixes the issue #75
I added tests and some documentation. I added test postgresql/003_import_schema.sql, so other tests was renamed.
If you have notes about this I will fix it.