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 1gVGO3-0000LE-29 for pgsql-general@arkaria.postgresql.org; Fri, 07 Dec 2018 13:41:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gVGO0-0001PY-DR for pgsql-general@arkaria.postgresql.org; Fri, 07 Dec 2018 13:41:44 +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 1gVGNz-0001PR-Sn for pgsql-general@lists.postgresql.org; Fri, 07 Dec 2018 13:41:44 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gVGNr-0000yr-K5 for pgsql-general@postgresql.org; Fri, 07 Dec 2018 13:41:42 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 1E6AA21D0A28; Fri, 7 Dec 2018 16:41:33 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.27.237] (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id E2FEC21D0A26; Fri, 7 Dec 2018 16:41:32 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1544190092; bh=73oYxKeiqrYcfRt32b/zagZhBluv0yQZs3UPT+SDcjo=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=MG+qBOVAeEJKlwOPCfB/KwjSn8+e7bF1IQAMpEcTRKs+90aXvxfOM4G3Jyr0UfyC1 Sl9hJ4XFBi6DKmirrjidx9B77Zj9NHKE5mfi1xVKXD/gLeGY3hfcMDihl7u9pt9HxT HjxJeK30/UEV5sG1p5B5hbc1Fj7brtuBe6jZCzuk= Subject: Re: psql profiles? To: Matt Zagrabelny , alvherre@2ndquadrant.com Cc: "pgsql-general@postgresql.org >> PG-General Mailing List" References: <20181206222318.6jolbk3oscgbvb4c@alvherre.pgsql> From: Arthur Zakirov Message-ID: <3a918aca-6d16-5799-94cb-daf790128c5d@postgrespro.ru> Date: Fri, 7 Dec 2018 16:41:32 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07.12.2018 01:34, Matt Zagrabelny wrote: > > > On Thu, Dec 6, 2018 at 4:24 PM Alvaro Herrera > wrote: > > Sure, just define a pg_service.conf file. > https://www.postgresql.org/docs/11/libpq-pgservice.html > > > Thanks Alvaro! > > Is there any shorter version than: > > psql "service=foo" > > ? > > If not, I can make a shell alias that puts the "service=$@" into the > command. Also you can set environment variable PGSERVICE=foo in your .bashrc. Or you can just set variable PGHOST=db-host-1.example.com. In last case you don't need pg_service.conf file. -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company