Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1klmPL-0004o6-PR for pgsql-general@arkaria.postgresql.org; Sun, 06 Dec 2020 05:16:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1klmOn-0006It-My for pgsql-general@arkaria.postgresql.org; Sun, 06 Dec 2020 05:15:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1klmOn-0006Il-8h for pgsql-general@lists.postgresql.org; Sun, 06 Dec 2020 05:15:53 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1klmOi-0006xw-6X for pgsql-general@lists.postgresql.org; Sun, 06 Dec 2020 05:15:52 +0000 Received: by mail-ej1-x633.google.com with SMTP id ga15so14652221ejb.4 for ; Sat, 05 Dec 2020 21:15:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=vW9aoCuOHTutF7v5uI2mmSKkHMBxawVkzfE/b9+PjFQ=; b=1jca6npXShLzoPfWdEYZptU4BZZY+g9aD5l0FSAPx7KDqdVUhPRVC8Fu/OcVPb8ZOZ nLzCzCwhuU0ZrnHnoWGsT+o5t3TYYiqndG7I9PSGBSWftQ/Gy519BOSm/rlVCzGwPwU/ U0hjzSyCS85owfkkJTJOLzaFt43PM//WDV8k7mxftZhepGU/sEKeOu+ltIvRCGd5nC36 n0/rcH/kgyYyRlkak9XT/5fZXpvXSKXerfWrkEKtiGSOuUfy5+vh0eiY7hityu1lExtw YkRUNbVr4xf0rowKMTn2QEh/g2woIZgc49dSn4UmXk30usTdxceOLeCC62rJcxqiwQEF tx6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=vW9aoCuOHTutF7v5uI2mmSKkHMBxawVkzfE/b9+PjFQ=; b=XX1hc7NPIaxqR9vfd6oBcN3hQPrX0MHI1Fs8dlagFcmDcFbCwLHTb2wUL6/3KNcqk7 q7RwYNiYGIUI/mpo+x79Mw5YeW+slKeLsm47rvjvATy3tk6PeWwdc0jEeY3gNegYhxPW BvIMeUsr7RKqkEr8ct5lAJOh0xspiNLtaSm9L+uU24ixUUsdZh3LF5pxuZ/1+A4FWxTm 3BTOrlhV1JKOd4C3EOQGvPjyuQp0fWpcDL1h5vfsL+j9HeJTUJQDWuoiRT6URyrZKbH2 0URwts0qj7/Jon0m0nwYvT3h6+31pIquDHy7frez1iyXwit/tpRPiK/45PTO1VGFEcur HCsQ== X-Gm-Message-State: AOAM533o8L14A2XLQHS35PBTA4YeJn1nZrZjy3wj+XuXEM/VZ4jP9Ib+ P33DoXGsyy5kJylOjq1dlRtVAA== X-Google-Smtp-Source: ABdhPJx7YgYyHEDScr4TkVpmZ3K8+5d12OBxO1GFjaQIfh69dEPuRc3C20py84l3u+MvPQw3llswrw== X-Received: by 2002:a17:906:d10f:: with SMTP id b15mr13416041ejz.268.1607231744953; Sat, 05 Dec 2020 21:15:44 -0800 (PST) Received: from localhost.localdomain (91-115-151-182.adsl.highway.telekom.at. [91.115.151.182]) by smtp.gmail.com with ESMTPSA id n7sm7780938edb.34.2020.12.05.21.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2020 21:15:44 -0800 (PST) Message-ID: <03ede77a49f4e8085d885e0dc1c66128ebed8e27.camel@cybertec.at> Subject: Re: Set COLLATE on a session level From: Laurenz Albe To: Peter Eisentraut , Tom Lane Cc: Dirk Mika , "pgsql-general@lists.postgresql.org" Date: Sun, 06 Dec 2020 06:15:43 +0100 In-Reply-To: <67253506-9381-44ac-0bbd-5b4aea29cc19@enterprisedb.com> References: <0DDE56FB-89A8-4621-BF5E-8CE3461F4983@mikatiming.de> <98a8cdc2-ed4b-616c-7370-3d5e5ccb8f91@enterprisedb.com> <2156565.1607098719@sss.pgh.pa.us> <67253506-9381-44ac-0bbd-5b4aea29cc19@enterprisedb.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, 2020-12-05 at 13:12 +0100, Peter Eisentraut wrote: > On 2020-12-04 17:18, Tom Lane wrote: > > > There is a SET COLLATION command in the SQL standard that does this. > > > Someone just has to implement it. It wouldn't be terribly difficult, I > > > think. > > > > [ squint... ] Just because it's in the standard doesn't mean it's a > > good idea. It sounds like this is morally equivalent to a GUC that > > changes query semantics. We have learned painfully that such behaviors > > are best avoided, because they break things you didn't expect to break. > > I think it would be analogous to the schema search path. Usually you notice right away if the "search_path" is wrong, because relations won't be found. But with a bad collation set in a session, the problems would be more subtle. For example, if someone asks you why an index isn't used to support sorting, you'd always have to remember to ask what collation has been set in the session. Yours, Laurenz Albe