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

pgrun does not connect on the specified port. #54

Open
ksaito1125 opened this issue Oct 9, 2024 · 0 comments
Open

pgrun does not connect on the specified port. #54

ksaito1125 opened this issue Oct 9, 2024 · 0 comments

Comments

@ksaito1125
Copy link

I started two PostgreSQL instances on localhost 15432 and 25432.
I added one table and output the difference using pgdiff.

The output difference is as follows.

$ cat 5-TABLE.sql 
-- schemaType: TABLE
-- db1: {src_db localhost 15432 user password * sslmode=disable}
-- db2: {dest_db localhost 25432 user password * sslmode=disable}
-- Run the following SQL against db2:
CREATE TABLE public.sample_table();

Applying the difference with pgrun is as follows.

$ ./pgrun -U user -h localhost -p 25432 -d dest_db -O sslmode=disable -f 5-TABLE.sql
Enter password: 
---
2024/10/08 23:59:07 Executing SQL: CREATE TABLE public.sample_table();
Error:  dial tcp 127.0.0.1:5432: connection refused
Continue, Quit, or Redo?  Enter c, q, or r: 

I specified port 25432 with pgrun's -p option, but pgrun appears to be using port 5432.

The environment is as follows.

$ pgdiff -V
pgdiff - version 0.9.3
Copyright (c) 2017 Jon Carlson.  All rights reserved.
Use of this source code is governed by the MIT license
that can be found here: http://opensource.org/licenses/MIT
$ psql "postgresql://user:***@localhost:15432/src_db"
psql (13.16 (Ubuntu 13.16-1.pgdg22.04+1))
Type "help" for help.

src_db=# 
$ sql "postgresql://user:***@localhost:25432/dest_db"
psql (13.16 (Ubuntu 13.16-1.pgdg22.04+1))
Type "help" for help.

dest_db=# 
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

No branches or pull requests

1 participant