Skip to content

pgrun does not connect on the specified port. #54

Open
@ksaito1125

Description

@ksaito1125

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions