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 1jT380-0007C9-MM for pgsql-general@arkaria.postgresql.org; Mon, 27 Apr 2020 12:44:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jT37z-00073N-Jk for pgsql-general@arkaria.postgresql.org; Mon, 27 Apr 2020 12:44:51 +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 1jT37z-00070O-Ao for pgsql-general@lists.postgresql.org; Mon, 27 Apr 2020 12:44:51 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jT37v-0000qg-HX for pgsql-general@postgresql.org; Mon, 27 Apr 2020 12:44:50 +0000 Received: by mail-wr1-x442.google.com with SMTP id i10so20363648wrv.10 for ; Mon, 27 Apr 2020 05:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=fy6eSEHVrIAA+bFGD5qaKub98552vGI8p8wJIV2BmZk=; b=XTs/gpJX1H899U9dW+Fvfc1e+JW67HCxcvbN0cj//ekhIJiGpqaewHUgRKWnAlS+Nu 0pVqEIVneK8vCtLP+kgCeTGpW87ZXnbH84UU3ie25uGP08W306R/3WxHDsBptaFVrjLe /EycrZDvE5NIVmRGdGLlKyjy7ByAMqGZzkODbQWVryD8f2ijJgIHUbQSZG90abtX/SQx GdJqovvwtPdeH2UhvDNLyqt8ukHvuJYCYclg0RHc6RcO5jAiN7u5LX4I93h1Y4l3Pxv7 uGnbGItPcDWolUk73aFzPZ/Lzlo8U+GhkRS2MC3yxvwt+DVz1r9+IS4YIhi00eDA+BZg xhRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=fy6eSEHVrIAA+bFGD5qaKub98552vGI8p8wJIV2BmZk=; b=PUgM8Muc3zXHAIFtLJDq6IGIw9C/R6zcbZ+X5xp0tj/Jao2xFwM3UDIIsz+HKDP7Me EGqryySsR1PF7Hk0PPAlrY/Yp1snOrf3cWlmRwqlrXidj9dZuZxp/ed2Tgngdp1+0kc2 qQ+zYeLfCRELdQof5AGt8VlTmLMmgs5Nl0dQ0U0WPLcC8VtpYAfGTMNaaDovpns9wWPO 7QU+Lmj7xrZpsLSQtYpm4mQTlCV2zPmQYtGRVYtnheAU6PG/jhlkI25LxJNW/8X6IAVz H38UNp7ya+25/Dksu5X0RZPQCa1ebsc1Yv8IlI6iD/qfG5DWBDxAhG/m1JQIrY9aqPa4 LE7A== X-Gm-Message-State: AGi0PubX8baI5W4wEiPfOdVtrNo9HpySXJt6wDLWr9i1zSEnjl8QEjwP +oLkLN2j56QHIH90Uphp6C8j6bFRGZ0= X-Google-Smtp-Source: APiQypL5cY4lwrXsgvhQPotVKUjvvBZiOGS/DpzmCMWEXEj058N7PW+po6NDrlvdicsr//7LRitOiw== X-Received: by 2002:a5d:404a:: with SMTP id w10mr26601548wrp.397.1587991484932; Mon, 27 Apr 2020 05:44:44 -0700 (PDT) Received: from [192.168.1.8] (241-57-239-77.dyn.cable.fcom.ch. [77.239.57.241]) by smtp.gmail.com with ESMTPSA id l16sm20755893wrp.91.2020.04.27.05.44.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Apr 2020 05:44:44 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: HOST variable in psql From: =?utf-8?Q?Paul_F=C3=B6rster?= In-Reply-To: <3325.1587990006@sss.pgh.pa.us> Date: Mon, 27 Apr 2020 14:44:44 +0200 Cc: pgsql-general Content-Transfer-Encoding: quoted-printable Message-Id: <0767EAE6-86F3-45D8-87B5-4A9275E3E924@gmail.com> References: <91ADA44B-9EFA-4784-A45F-8323B3F552B3@gmail.com> <3325.1587990006@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3608.80.23.2.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Tom, > On 27. Apr, 2020, at 14:20, Tom Lane wrote: > AFAICS, psql is behaving as documented. Why are you trying to = override > HOST like that, instead of just using some other variable? I could but a) HOST is HOST and should not point to a socket directory. A socket = directory is not a HOST. This makes no sense, especially since I see no = use for using a socket directory in any psql script. There are tons of = use cases for the hostname, though. b) it would require changing some scripts. c) the docs are IMHO not 100% clear on this. I think the psqlrc should = be executed on EVERY new connect, hence including \c, and this is how I = interpret the docs too. But it doesn't... also (slightly related) d) PostgreSQL unfortunately does not provide any = functionality to determine the server hostname it runs on. There is an = extension but I still don't see why PostgreSQL does not include this = natively. Cheers, Paul=