-
Notifications
You must be signed in to change notification settings - Fork 35
Run node.psql in a different port #240
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
Comments
Hello PostgresNode::psql method works with the own Postgres instance (host name + port number), not with another one. If you want to use an old psql utility to work with the new (another) Postgres instance - it requires another class, not PostgresNode. It is not a diffucult to create it over the current testgres infrastructure. Just copy PostgresNode::psql method to another class and append the pair of new arguments - host and port. 5 min of works. I think, here is needed to create a new class (PostgresUtilities?) with static methods those will call PostgreSQL utilities - psql and others. |
Another way - we can add the new arguments 'host' and 'port' with default values to PostgresNode.psql If they are not defined we will use host/port of this PostgresNode object. |
This patch adds the support of using other host and port in the following methods: - PostgresNode.psql (explicit new args: host and port) - PostgresNode.safe_psql (indirectly through **kwargs) It allows to run psql utility from one PostgreSQL instance to work with another one. If explicit host and port are not defined (are None), PostgresNode will use own ones. This patch closes postgrespro#240.
Hello @fabriziomello, Please see PR #242. I think, it must solve your problem completely. |
* [FIX] Tests include testgres by right way through import When we do not have root __init__.py tests must to import testgres through "import testgres" not through "from <relative_path> import testgres" * [#240] Using of node.psql with other host and port This patch adds the support of using other host and port in the following methods: - PostgresNode.psql (explicit new args: host and port) - PostgresNode.safe_psql (indirectly through **kwargs) It allows to run psql utility from one PostgreSQL instance to work with another one. If explicit host and port are not defined (are None), PostgresNode will use own ones. This patch closes #240.
Thank you very much. It will help a lot! |
Now with #234 that make
PostgresNode::port
read-only is not possible to runPostgresNode::psql
in a different port. We did this trick here in order to do some sanity checks after execute pg_upgrade to compare psql outputs but we should guarantee to use the same psql version (newest) over the new and old cluster to make sure the test output will be the same (psql output can change over major postgres versions).Are there a workaround for it?
The text was updated successfully, but these errors were encountered: