Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8CeZ-0000GP-S3 for pgsql-novice@arkaria.postgresql.org; Mon, 04 Jul 2022 03:21:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o8CeY-0007DK-6y for pgsql-novice@arkaria.postgresql.org; Mon, 04 Jul 2022 03:21:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8CeX-0007DB-Td for pgsql-novice@lists.postgresql.org; Mon, 04 Jul 2022 03:21:37 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o8CeR-0007cH-B4 for pgsql-novice@postgresql.org; Mon, 04 Jul 2022 03:21:36 +0000 Received: by mail-io1-xd35.google.com with SMTP id y18so7567299iof.2 for ; Sun, 03 Jul 2022 20:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=w3BnXzu8ipg6XaLSNVG1lZzWp4JtnpLc9na0CtITtFM=; b=Xn8AitfFX+mJqlDHMxGbKgZMDU1RyVWD6jtq7KFjGOcQFVvA2C9gOL92cLJK3FsnYC hqm/73xMiujPAcGkpQraxXUsWF5uJMMi21MwklAErEKd/pdUEKcT5nHjfSqScRoR6woc oyrLLXXWX3RU2sYEZNMFGIhyV/y/yxU9c0kwZrFsqFQqKyXv0TCmL1IiKfl3/a26Buh0 BCaKhEPLi3B6IaLxPHlMP0PhT4gaQ8i+iMryxyyuXO7FWnS7WMdlAVrvdLwoOGqtS2s1 +jtkxyhaJ1bl/hcOJ5/I4Opf6D9CeWsUFheI5UK5fL7JilCL+/NHgRxq303JncxqzkdQ 2Wng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=w3BnXzu8ipg6XaLSNVG1lZzWp4JtnpLc9na0CtITtFM=; b=rb3+rAu59ZKWgrf/i7DD6T7chcScf3XSK65bwXuuBM9gDCZTf6PqPAkd1n5bpM8Dz1 DQnLH0x5xnDg/HdESTNad/5hc0LM8IRmxE5FHS+X2wDwCnkJ3FJ8r82PKVqjKkpQAzyj UyGXhimD/HSHkEHTSffJSl1mRWr+QabJWNcSnZLAiUq54LlluOg7lqpsr0J7Fvzmghrf UeOc+s0tEgOBQUetBn9hXPy+FVv1Nb39QHbuevMVvn/C2rdnCNGMDmVLyUw+L0qC97Ip dAxH85uWOlql21WO+i3V6hnroCJfkm1Ap7S3VWzamvEemcRWLpilpk6MBl6AfsgZ6az1 qIiw== X-Gm-Message-State: AJIora/jDyJx2UnPfckb0EKUofjP3F9Q5rX6oourRcxZm8MO34zxrm2e wGIOVaUjSUKLekXT/Rmag6FExezNTJQ= X-Google-Smtp-Source: AGRyM1uKhAEKJ/zAd/R8wFXeMIQz8uEyNVepmNF+C1ltUm/EPXDOh2lQK2LXiEUA1O85QKJNE7Tr+Q== X-Received: by 2002:a02:c651:0:b0:339:c72b:272f with SMTP id k17-20020a02c651000000b00339c72b272fmr16566292jan.138.1656904889132; Sun, 03 Jul 2022 20:21:29 -0700 (PDT) Received: from smtpclient.apple (pints.com. [206.248.184.17]) by smtp.gmail.com with ESMTPSA id q19-20020a056e02097300b002dc14d4c312sm344629ilt.53.2022.07.03.20.21.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Jul 2022 20:21:28 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: psql: error: could not connect to server: Connection refused From: BeeRich Lists In-Reply-To: <1435901.1656899131@sss.pgh.pa.us> Date: Sun, 3 Jul 2022 23:21:28 -0400 Cc: Submit Postgresql Novice Content-Transfer-Encoding: quoted-printable Message-Id: References: <5C6C7AA2-88FF-4F15-B7AC-92B2C2584877@gmail.com> <1435901.1656899131@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3696.100.31) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Oops, a re-reply: Hi Tom. Thanks for the reply. That=E2=80=99s what I=E2=80=99m thinking as it=E2=80=99s not showing up. = However I have told it to listen on '*'. Here are relevant settings: port | 5432 | Sets the TCP port the server listens on. tcp_keepalives_count | 0 | Maximum number of TCP keepalive retransmits. tcp_keepalives_idle | 0 | Time between issuing TCP keepalives. tcp_keepalives_interval | 0 | Time between TCP keepalive retransmits. tcp_user_timeout | 0 | TCP user timeout. unix_socket_directories | /var/run/postgresql, /tmp | Sets the = directories where Unix-domain sockets will be created. unix_socket_group | | Sets the owning group of the Unix-domain socket. unix_socket_permissions | 0777 | Sets the access permissions of the = Unix-domain socket. listen_addresses | * | Sets the host name or IP address(es) to listen = to. Other than that I=E2=80=99m not sure how to turn that on. BTW those = items come from `show all;`. In my postgresql.conf I have this: listen_addresses =3D '*' # what IP address(es) to listen on; Oh look at this=E2=80=A6I changed that out as you expected, as well as = its static IP on the LAN, and this showed up on restart: Jul 03 22:58:58 server_n.project33.ca postmaster[2534]: 2022-07-03 = 22:58:58.720 EDT [2534] LOG: listening on IPv4 address "192.168.1.23", = port 5432 Jul 03 22:58:58 server_n.project33.ca postmaster[2534]: 2022-07-03 = 22:58:58.720 EDT [2534] LOG: listening on Unix socket = "/var/run/postgresql/.s.PGSQL.5432" Jul 03 22:58:58 server_n.project33.ca postmaster[2534]: 2022-07-03 = 22:58:58.728 EDT [2534] LOG: listening on Unix socket = "/tmp/.s.PGSQL.5432" More testing=E2=80=A6 OK so it seems on the machine, the port is open (nmap localhost, nmap = box.local, nmap , but it is not showing up on my = workstation for some reason. But I think I found out why: Not shown: 5474 filtered tcp ports (no-response), 26 filtered tcp ports = (admin-prohibited) admin-prohibited? Port 5432 is showing up on that machine, but not on = my workstation. So the firewall is active, and here=E2=80=99s the = firewall list: $ sudo firewall-cmd --list-all public (active) target: default icmp-block-inversion: no interfaces: enp0s25 sources: services: cockpit dhcpv6-client ssh ports: protocols: forward: yes masquerade: no forward-ports: source-ports: icmp-blocks: rich rules: It seems I need to add postgresql as a `service`. `firewall-cmd = --get-services` shows postgresql as a service. =20 It worked! It was the firewall that needed a port hole poked in it. = This is what I did: $ sudo firewall-cmd --zone=3Dpublic --permanent --add-service=3Dpostgresql= $ sudo firewall-cmd --zone=3Dpublic --permanent --add-port 5432/tcp $ sudo firewall-cmd --reload $ sudo firewall-cmd --list-all public (active) target: default icmp-block-inversion: no interfaces: enp0s25 sources: services: cockpit dhcpv6-client postgresql ssh ports: 5432/tcp protocols: forward: yes masquerade: no forward-ports: source-ports: icmp-blocks: rich rules: And I can get in using psql as well. =20 Well done, Tom! Cheers, Bee > On Jul 3, 2022, at 9:45 PM, Tom Lane wrote: >=20 > BeeRich Lists writes: >> Hi folks. I cannot connect to my postgres server. I=E2=80=99ve run = through all the directives and I still can=E2=80=99t understand why this = isn=E2=80=99t showing up. =20 >=20 > It sure looks like the postmaster doesn't think you told it to > listen on any TCP sockets, because if it did they'd have been > listed in the initial log output. Are you sure that this setting > is really the active one? >=20 >> listen_addresses =3D '*' >=20 > It could also be that there is something weird about your system > environment that is causing '*' to expand to nothing. Try > explicitly specifying '127.0.0.1, ::1' instead. >=20 > regards, tom lane