Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rz1hR-001ZMV-GE for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 21:59:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rz1hP-000lBg-W7 for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 21:59:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rz1hP-000lBO-LB for pgsql-general@lists.postgresql.org; Mon, 22 Apr 2024 21:59:43 +0000 Received: from fout1-smtp.messagingengine.com ([103.168.172.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rz1hN-0049aX-5M for pgsql-general@postgresql.org; Mon, 22 Apr 2024 21:59:42 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id 6B14B13800C1; Mon, 22 Apr 2024 17:59:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 22 Apr 2024 17:59:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1713823180; x=1713909580; bh=DQLMABFXFGhxeI6sKFaj6gkqUYEfF3y5CFj60g4JKtE=; b= o5IsCa3n5pq0o9LBrN/zo0tLb7KqOtx3paUWDMIykwrIWDlLaJH3qB22FVCOxj6c XElPXxvgq0Eb2UdB/crb0iLRc0oZnii4M0Q4I2u1XB0dEmh45P98BXetTkPiyw5J sVZjJXuXIeoASY8kjg4Zqsy07+ZXsh662NWmjg4Ff9ezXlZnjVkFbM5m1nUip16x l/Wnyr+hg3/hXz2FC/0xyBx+olqjAbrP5VvQ4DSpMyJRD7um+OCw7Equ9TMCmapv sN8H+i0SrSAzjbPFOBffLsQ84AAFHE7M2vn/j6bcQgy6oNzk+Ahnauv49Dc4X5GW B6tAsR6ElHdNEaQjnvCBjw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1713823180; x= 1713909580; bh=DQLMABFXFGhxeI6sKFaj6gkqUYEfF3y5CFj60g4JKtE=; b=P sEeXl8dSkm9LZ0yGlnKUzk+WzGrfr/5n3JNHSrx5wzA03+iv0zePxz1ucZoKvMxQ 3LPR7Rq+T3+PnttzjIUD7n7UcbqbDnfPS8uTTcZDgGjs7cRqBAof6NmH51/5cXY4 4tvza/9YFTt9uYkBIPCQz0gqU/uUU2Nghfm+fmTOs9cL6Fuws41pPI+6OwUXI9Sn R2rM/3T62xKMZNyfYmwljdd2UhBnruOPoW0CL+q9o60JhgPOSnAcBJO7k26s7C6r GANw2qsFsoFvtCWkGWGn/BTOd5dwHP1KeHGzzCZzTJMf+P85wWEyDrgF5yQ3To7U NRgvK1XLpHDAiOE8Jf0/A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeltddgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepfeegfeeiuedtgffgteeggfehkeejheetieeliefg teeikeejvdeiveeigfehvedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 Apr 2024 17:59:39 -0400 (EDT) Message-ID: Date: Mon, 22 Apr 2024 14:59:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: issue with reading hostname To: Atul Kumar Cc: pgsql-general References: <2015f756-b188-4840-922d-6f927997ab51@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/22/24 14:54, Atul Kumar wrote: > I mean, Once I change the hostname then how will the socket read the new > hostname ? Does it require a postgres service restart ? The host name of the machine? > > > > On Tue, Apr 23, 2024 at 3:19 AM Adrian Klaver > wrote: > > On 4/22/24 14:37, Atul Kumar wrote: > > Can we edit the socket to change the hostname in it ? > > On Ubuntu 22.04 install, given: > > srwxrwxrwx  1 postgres postgres    0 Apr 22 14:01 .s.PGSQL.5432= > -rw-------  1 postgres postgres   68 Apr 22 14:01 .s.PGSQL.5432.lock > > The contents of .s.PGSQL.5432.lock(the file that indicates a Postgres > instance has a lock on the socket) are: > > 862 > /var/lib/postgresql/15/main > 1713795311 > 5432 > /var/run/postgresql > > There is no hostname to be changed as you are working with a local > socket. > > > > > Regards. > > > > On Tue, Apr 23, 2024 at 2:41 AM Ron Johnson > > > >> wrote: > > > >     On Mon, Apr 22, 2024 at 4:14 PM Atul Kumar > > >      >> wrote: > > > >         Hi, > > > >         I have postgresql  version 15 running on centos7. > > > >         I have below query that reads hostname from /tmp directory: > > > >         psql postgres -A -t -p 5432 -h /tmp/ -c 'SELECT > >         pg_is_in_recovery();' > > > > > >     If you installed from the PGDG repository (possibly also the > CENTOS > >     repos, but I'm not sure), then the domain socket also lives in : > >     /var/run/postgresql > > > >     * I find that more expressive than /tmp. > >     * No need to specify the host when using sockets. > >     * Using a socket name makes parameterizing the hostname easier in > >     scripts. > > > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com