Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpCxb-0008Iq-4O for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 13:32:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpCxZ-0002Jp-AT for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 13:32:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpCxZ-0002Jh-2G for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 13:32:37 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fpCxU-0006Iu-Sp for pgsql-general@postgresql.org; Mon, 13 Aug 2018 13:32:36 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 7761949041; Mon, 13 Aug 2018 15:32:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id mxxGrbzSqsYh; Mon, 13 Aug 2018 15:32:23 +0200 (CEST) Message-ID: <1534167141.2390.35.camel@cybertec.at> Subject: Re: How to get connection details from psql -> \e From: Laurenz Albe To: depesz@depesz.com, pgsql-general mailing list Date: Mon, 13 Aug 2018 15:32:21 +0200 In-Reply-To: <20180813104415.hatiez4soz6jvozp@depesz.com> References: <20180813104415.hatiez4soz6jvozp@depesz.com> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk hubert depesz lubaczewski wrote: > I'm trying to work on some extension to vim when invoked as \e from > psql. > > To make it fully work, I need to know connection details that psql was > using while it invoked \e. > > Is it possible to do in any way, or if not, any chance it could be added > to wishlist for next versions of Pg? Do you mean something like \set? test=> \set DBNAME = 'test' ENCODING = 'UTF8' HOST = '/var/run/postgresql' PORT = '5432' SERVER_VERSION_NAME = '10.5' SERVER_VERSION_NUM = '100005' VERSION_NAME = '10.5' VERSION_NUM = '100005' ... Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com