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 1inUEI-000189-81 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jan 2020 21:11:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1inUEG-0000Zd-8v for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jan 2020 21:11:32 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1inUEF-0000ZW-Qd for pgsql-hackers@lists.postgresql.org; Fri, 03 Jan 2020 21:11:32 +0000 Received: from mail-yb1-xb44.google.com ([2607:f8b0:4864:20::b44]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1inUEC-0006Jf-Sm for pgsql-hackers@lists.postgresql.org; Fri, 03 Jan 2020 21:11:31 +0000 Received: by mail-yb1-xb44.google.com with SMTP id a2so19177123ybr.7 for ; Fri, 03 Jan 2020 13:11:28 -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=UnVD20hMekgjjvM8umtRIWxfL93HT7j8c3NL1PKJhZI=; b=KFU31Eg27u5aJhodpyCmeZuPOhA/e8FyLRFMvIkS9Znc7ccLnnsRWLoIsC04jyWmz7 BzwIHxXvTs65VdamnzeZyM80Nsv4kVFPEMqO0tc0PGpA+vyL71Z9It6EZ2GryJCAAJ+D hAWaa0Q1ceQz8//7fWCzvpRpLF1u6a3KJyeQ9s2qrYlJovEv/juuztbWOKKmFt0qMJuc 6exKMagwu8PAMC/G440wrVEGp1d/60JdQSb84V/8dX3GSeWCYnp3DEs6HQTwGbZKqbS5 kjTrqIo9fSZ8ibm9ln5vvxoq+dvzTTn5cjzWZNwgln5ZP5kqAQg56Z1mezjJrlMV8FuP ArmQ== 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=UnVD20hMekgjjvM8umtRIWxfL93HT7j8c3NL1PKJhZI=; b=V7HzI/rSuR1aBXdAg5XmcymJB0+va8IjswcIT7cW+fU0zuOzlkbnV6nQpEt7H2bEhU sD9sb7kF0nxC6r7c/d/Zpx5GaLTAVVjD3aw78r6lRfw0aqtCR8ZEYyrghaGxAqvJB5Ie 7iSEzlsKHFWohRqsQ1VT1iMi78bkDLqM6e2Dl7DN1ul2CsNyo4ammfSTzInmuXLNpWqV FOdJp8b9ndscUF03Vm8+tf+3LyA3brsPz5SVPt4qWI1sorNzXQAfveuAK9epcpahP3N7 ZeIAX1/dQke/kR3ttoswN1fwGBKawQ6lThisHAUwsTU1LhwqqiSiS2na09BOstPPHdMf BJvA== X-Gm-Message-State: APjAAAUX6U2tA3vYSwKVsuIWN+zybnaMOxUlHF9V4jQnsfb9Dc+lTtaB Lv3pGwRmuwe+pcSmDWafTqRNog== X-Google-Smtp-Source: APXvYqyvFz/2Uq3KRbp4DLx8dCMzhEwmrp5PQPHrjWeRJC5KuyHcfkkIccCsrlBW1D3f1ujtlQKJfg== X-Received: by 2002:a25:5705:: with SMTP id l5mr48690186ybb.349.1578085887296; Fri, 03 Jan 2020 13:11:27 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([66.115.169.196]) by smtp.gmail.com with ESMTPSA id d186sm24423677ywe.0.2020.01.03.13.11.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 13:11:26 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 8DBBA300A02; Fri, 3 Jan 2020 18:10:43 -0300 (-03) Date: Fri, 3 Jan 2020 18:10:43 -0300 From: Alvaro Herrera To: Merlin Moncure Cc: Robert Haas , Chapman Flack , Tom Lane , Peter Eisentraut , Dean Rasheed , Vik Fearing , Fabien COELHO , PostgreSQL Hackers Subject: Re: Greatest Common Divisor Message-ID: <20200103211043.GA597@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: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Jan-03, Merlin Moncure wrote: > On Fri, Jan 3, 2020 at 1:32 PM Robert Haas wrote: > > True, but because of the way search_path is typically set, they'd > > probably continue to get their own version anyway, so I'm not sure > > what the problem is. > > Is that right? Default search_path is for pg_catalog to resolve before > public. Lightly testing with a hand rolled pg_advisory_lock > implementation that raise a notice, my default database seemed to > prefer the build in function. Maybe I'm not following you. Maybe a very simple solution is indeed to have a separate pg_math or pg_extra or whatever, which by default is *last* in the search_path. That would make a user's gcd() be chosen preferently, if one exists. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services