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 1kg7h8-0007AO-6G for pgsql-general@arkaria.postgresql.org; Fri, 20 Nov 2020 14:47:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kg7h7-0004bE-3D for pgsql-general@arkaria.postgresql.org; Fri, 20 Nov 2020 14:47:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kg7h6-0004b7-Pv for pgsql-general@lists.postgresql.org; Fri, 20 Nov 2020 14:47:24 +0000 Received: from mout.gmx.net ([212.227.17.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kg7h4-0007mK-Db for pgsql-general@lists.postgresql.org; Fri, 20 Nov 2020 14:47:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1605883639; bh=30eVc1TKzcZciRbtw1dp6phztY7ZNekBv3p6QWTuj98=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=F3+vgL8JTDhFtDUEaqfGMNZ+51Iat4TF49vNTdtxDd7kdqxGCyG0Bvz+XswEKFrx7 Kg6horS2M9cJTdSXiVZkv3CCzrJ5WdUVBfngtKu05OXwff3ty4a7j3w1UUCvjRISc2 9F+e7AOhIZVMqS+fv+IGn8LzaR1eByhHZNXZc81U= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermes ([77.13.242.222]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M3DNt-1kgxAo03rh-003cuE for ; Fri, 20 Nov 2020 15:47:19 +0100 Received: from ncq by hermes with local (Exim 4.94) (envelope-from ) id 1kg7gz-0003KI-Kr for pgsql-general@lists.postgresql.org; Fri, 20 Nov 2020 15:47:17 +0100 Date: Fri, 20 Nov 2020 15:47:17 +0100 From: Karsten Hilbert To: pgsql-general@lists.postgresql.org Subject: Re: Set COLLATE on a session level Message-ID: <20201120144717.GD5091@hermes.hilbert.loc> References: <0DDE56FB-89A8-4621-BF5E-8CE3461F4983@mikatiming.de> <9fd0eef06639e633e258461e5baad9734bcbc1ba.camel@cybertec.at> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) Sender: X-Provags-ID: V03:K1:WtdO6fEaCC5Wpdv0j1Mse8oNfGWH1KcJOpt+hDfAZanwdf90xyp AwRwXSsryKTrFRxStbN1fj4Gx/011GSq2YEn6YxkLQxCCaacwt3u+RT4AHRxLsUbQatr0aq EL8n9y67Ya2M03oiUAagZ760iI/YBDVRbn/4dF5uwrddnESKaM97oMw1QKbbL8OlyQyOb62 qBiGQe7Y3ObsPabbd9pWQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:7K9Iwgb2eHM=:/zKKcaMmAY0PLDOvDQUE7F MzdtmZmUqUvjRH2AAup+mHotRZpKG8dDhaP4JB9BmdeebobX9GfQ/1tLgIGW/A+xIKtT1aXDH Rde8AACzfPQ1jhuXny+sZyCJmESPINVpo6qVj0gx0dJB1fT0gcUVQp+z/f6CO/355rs9de9V3 2nKtxaa8iTtcm/6uHp4DW5SPRT6n7OGQGkJ6ZyPAbnHBbQJTncG1OQXduyk6Z/EHJfc10xOKy AejIMGHmEWn/WpdSvSYwvwhZ0V3TpzB189F9JvPhdm4hfUBq535iivrA9siLUUbDGWCc6Jqpb 2/M25Z8M7Ny20H94MIMwTA7qcqH67eGU0XRS59YgvJQBIxkt0gXRjnT0oP1aFb1vumkox5O6d juHYC06qWV32R8MAgb5KczFI+4GDrkJPv0/KLq/8IQW6wATxkY4RpQRF+tJ0I81LZkWO6oHJ4 ffErCBM1gX/sSi2FLvVi91SVEZtiGIQPdsUxvIxQ7AtVFIbge0C1Ka5CMfCvHX2PhmCiNEea1 vVcsi/5XxHtN0qSSR3lAqqkWEhBMfp40Fo8d+MC9wdBkv/KMk9q3xn6WxORUo7No3QZaM9bWE Rfn6AXuOtE+uWWQA069bt3O2mQWLHAyMhzT5ypdkKXAf2vdUVBX2+SAdiqKV9BiL4gfoWSh+Y IGCXY8kJ/wFSFL052ST6oXp6YIZNrvo7cXQPtiiWzYUiPKm07mTjk/QdlVnq2Ax/eSf/5o/0N V4Pv7Vp5ab143Xa1Qt0TUsqZzKAAoqfiAh2sK2093Tzb7vo9bFjcW0PTB0OS64UR4ffaSxykZ zraQRWn7dnEmoRRnJcyBo5Q+zmGmMmc1I5hV5sP8koWS+TVFRUe8nq8LzyJWclDsPfioMgvl0 c6ofBx2Y5bPTTSG6bV4I1KLjrnlzrXd21vTiqtMk8= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Nov 20, 2020 at 03:32:48PM +0100, Pavel Stehule wrote: > p=E1 20. 11. 2020 v 15:28 odes=EDlatel Dirk Mika > napsal: > > > Let's assume there is an app that accesses the same database from > > different countries. And in this app data should be displayed ordered.= And > > the sort order is not identical in all countries. > > > > Does the app have to send different SQL commands depending on the coun= try? > > Not nice. > > Do the data have to be sorted in the app? Not nice either. > > > > the query is the same - you just use a different COLLATE clause. For > Postgres there is not any other way. One might use a function producing a SELECT taking the locale as a paramet= er. Or views in schemas per locale. Selecting the search path per locale pulls in the right view. Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B