Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gV23K-0005R7-9K for pgsql-general@arkaria.postgresql.org; Thu, 06 Dec 2018 22:23:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gV23I-0000S0-Ub for pgsql-general@arkaria.postgresql.org; Thu, 06 Dec 2018 22:23:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gV23I-0000Rt-J7 for pgsql-general@lists.postgresql.org; Thu, 06 Dec 2018 22:23:24 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gV23F-0006KU-GN for pgsql-general@postgresql.org; Thu, 06 Dec 2018 22:23:23 +0000 Received: by mail-qt1-x844.google.com with SMTP id d19so2397440qtq.9 for ; Thu, 06 Dec 2018 14:23:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Jef0lO3uwNjz4bnJ2xzw9aesqiRksd6LNhD8gXzMOuw=; b=quGQF+jH4l4ud690Gxt5bAjQnI2E0w5RvyYVnwpTBhIMWdnjRV7iwKTs5suxAr30zb 0LRDV/3aP955aqmnhMFItY2IN/nYnW8E9Ogi7udpUVVuxnI6BqbIMP3auhQZNjWI5bqE UewEDS9R4qE4T5/vzcWAhvUfWn2YiEKKAj+aEmXIGR1mbfsBR1Nwd62j7o9e7XaW4lmg XhX9A+1+UrzHv+gTheFlHLoXiO8/hb79NRRLTMYuRmWZFnCUAVMW0ruUgvGllw110iOK 028OkHXQQoxQklLnK8vKkGZg+BRFK+XfY5+voPP6DCzGvom+WEMa02hZgfNiKIekZrN3 hbUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Jef0lO3uwNjz4bnJ2xzw9aesqiRksd6LNhD8gXzMOuw=; b=KbpSLoWFoeCyID+YBUQFRb40co/SGSfs+xf9DpDXXlqmUIWwdmp3V0QTjRryqMHirr Ek6Pwia8Cy0np+75KB3bcSWhCLHiKf6TrFEQWuY1io6iB6APnnMV4YGyhvEo64MwM/8X w2FmUsvGufPK7MtUyXMsRXv8TmS5KsPJxZcdyIbl/oZoQFbfJiCdHZ61fx1X59RRWMR0 M7/GQDfF8unugdPjR3jqI0LnPnxLTqZCHpKh4HbBfuFmUZflGBkS49Ivx8TVB8K2h5Mk SrY2v7/2Ff5PluQ+CtkLeoqDScsm4rcfdzis8ySoqI6vjVmQleLHwBOXWR2LYtkWMFgx 0hoQ== X-Gm-Message-State: AA+aEWY1YQ01qkP/1TxHEiDQfOUmvIVBCQ+PavA9zGXiA2iD1il+4qwE HyzNPf54SCgpUluVmMGawCVB2g== X-Google-Smtp-Source: AFSGD/V+jkoQ+DnuQUN+vgyRS3t0ILhX3CT6lSWLLR4BXC+Z24zZOBiMY4gOsJrMDM2WQ+RD0Fst3w== X-Received: by 2002:ac8:fb4:: with SMTP id b49mr29098939qtk.2.1544135000894; Thu, 06 Dec 2018 14:23:20 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id b20sm1248892qkb.17.2018.12.06.14.23.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 14:23:20 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 7BD8271C; Thu, 6 Dec 2018 19:23:18 -0300 (-03) Date: Thu, 6 Dec 2018 19:23:18 -0300 From: Alvaro Herrera To: Matt Zagrabelny Cc: "pgsql-general@postgresql.org >> PG-General Mailing List" Subject: Re: psql profiles? Message-ID: <20181206222318.6jolbk3oscgbvb4c@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Dec-06, Matt Zagrabelny wrote: > I'd rather do: > > psql foo > > and have it know that I connect to foo on host db-host-1.example.com. > > Is this possible with psql or do I hack together some wrapper script? Sure, just define a pg_service.conf file. https://www.postgresql.org/docs/11/libpq-pgservice.html -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services