Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ees7y-0002FG-Hk for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2018 00:44:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ees7w-0004j4-Py for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2018 00:44:20 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ees7w-0004iu-G0 for pgsql-hackers@lists.postgresql.org; Fri, 26 Jan 2018 00:44:20 +0000 Received: from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ees7t-0000Yv-0v for pgsql-hackers@postgresql.org; Fri, 26 Jan 2018 00:44:18 +0000 Received: by mail-wr0-x22a.google.com with SMTP id t16so9391026wrc.10 for ; Thu, 25 Jan 2018 16:44:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zPh9amMGcr1DLP3uGnZu2Ey8kAG6jTyURZ0AUZ8qlkA=; b=wJ6IrD7fP/HGpqA+WB+tDcpJjg1B+oJszRaL07/Q/TIExdYKGW78Qt8SSME6GsvfdB Txp46UqlOCth+OBaXco1u3GiLRiGDpAL7JSrdACyypB2L3A0G8LiOzyGUkZSJJuDxjdS R/61p5pkqFiZr3qFyU6R/+GQKa1BcyNmOpN8JEfvubDE6wUp/jTqMWG7dtVJ7gNJXAdd U+Cx1qaoo0/eY5O5CIoN/sH5vKmfD4sDEGaVVDBvWZzNrDQxh8K+xu9MSnLV9lc7FO1d r077uzAq3tVY0nM0dU0W8X8XeZqFZmS2cYoI1ttCq9D+odX1W0EV51ZX+jr1lGPTCRsr VjZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=zPh9amMGcr1DLP3uGnZu2Ey8kAG6jTyURZ0AUZ8qlkA=; b=C6piZVvhLA1bSFLDrey6IRgCOQQyKjm6KPS9KKkQf2mGy3nr7TDR/K55r97F308NKk eW7kVY1lWPJTqASpczu5EnyGv4egQJXhaScyzaZbEhtgJpVxAFMDVl2YRFLyZv6cQiHO DlNpYEg9s9U9XJnftcj0aGS2t8wez4yLBoCmyGsTp20DeyxDvFXQPpvoxvyPVY5j34Pv s+7Ots+SIUSpYi8VGXAT1ON6wH07M2vjNIgQEP6jLgCKvWAKvS/DMRaBDuR75x6VCsZJ gqsA2GmgppgTWUgBp+E83bs7fJP84HK/8QrAumTCbwrN4SdqCbHaDCR1jiP5yBw9g0cS mYug== X-Gm-Message-State: AKwxyteO/Azafkqcm9KhiRs4siBAxVncoNHogosRnyivTlb2n+t4pPyf PLKq/GryqUMBWJMizcbm2306xVxpEPl4DSn/4geVjBhYDR8WYMaIs3XbENwCAA7duSm3yCroGkf 27458rw17d0spR+XIT1vQn4t6Dxp/vLSrxihj+s18CXCW9AiHaPJE7WyARl8WB5Jnyh2BFikVuH PJjLMnXvGwew== X-Google-Smtp-Source: AH8x224vyR4bK8KzBSiyikI54SwuIk3iqqRtXd/uPwDoBd1YQC5xr6Fy8qqmg+T1p8og9QamIbBY8g== X-Received: by 10.223.152.83 with SMTP id v77mr4303622wrb.233.1516927454526; Thu, 25 Jan 2018 16:44:14 -0800 (PST) Received: from [192.168.0.3] (ath91-3-88-167-161-184.fbx.proxad.net. [88.167.161.184]) by smtp.gmail.com with ESMTPSA id i75sm2659599wmg.41.2018.01.25.16.44.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 16:44:13 -0800 (PST) Subject: Re: PATCH: psql tab completion for SELECT To: Edmund Horner Cc: Tom Lane , Andres Freund , pgsql-hackers@lists.postgresql.org, pgsql-hackers References: <882D6617-FA16-4C56-8FE0-884BCBBE5A4C@anarazel.de> <2738.1516234038@sss.pgh.pa.us> <3a919958-e508-3b66-686f-44a7937fb6e7@2ndquadrant.com> From: Vik Fearing Organization: 2ndQuadrant France Message-ID: Date: Fri, 26 Jan 2018 01:44:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 01/26/2018 01:28 AM, Edmund Horner wrote: > On 19 January 2018 at 05:37, Vik Fearing wrote: >> On 01/18/2018 01:07 AM, Tom Lane wrote: >>> Edmund Horner writes: >>>> On 15 January 2018 at 15:45, Andres Freund wrote: >>>>> All worries like this are supposed to check the server version. >>> >>>> In psql there are around 200 such tab completion queries, none of >>>> which checks the server version. Many would cause the user's >>>> transaction to abort if invoked on an older server. Identifying the >>>> appropriate server versions for each one would be quite a bit of work. >>> >>>> Is there a better way to make this more robust? >>> >>> Maybe it'd be worth the effort to wrap tab completion queries in >>> SAVEPOINT/RELEASE SAVEPOINT if we're inside a user transaction >>> (which we could detect from libpq's state, I believe). >>> >>> That seems like an independent patch, but it'd be a prerequisite >>> if you want to issue tab completion queries with version dependencies. >>> >>> A bigger point here is: do you really want SELECT tab completion >>> to work only against the latest and greatest server version? >>> That would become an argument against committing the feature at all; >>> maybe not enough to tip the scales against it, but still a demerit. >> >> I don't really want such a patch. I use new psql on old servers all the >> time. > > I'm not sure where we got with this. I really should have put this > patch in a separate thread, since it's an independent feature. Yes, it should have been a separate thread. > The patch mentioned attempts to put savepoints around the tab > completion query where appropriate. I am -1 on this idea. -- Vik Fearing +33 6 46 75 15 36 http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support