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 1kjgrB-0002aJ-7E for pgsql-general@arkaria.postgresql.org; Mon, 30 Nov 2020 10:56:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kjgr8-0007vp-92 for pgsql-general@arkaria.postgresql.org; Mon, 30 Nov 2020 10:56:30 +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 1kjgr7-0007vV-Vt for pgsql-general@lists.postgresql.org; Mon, 30 Nov 2020 10:56:30 +0000 Received: from mout.gmx.net ([212.227.15.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjgr5-0001nr-SL for pgsql-general@lists.postgresql.org; Mon, 30 Nov 2020 10:56:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606733786; bh=GZx055xkWEvGW+XvjN/u2xXZ1wt5dkEB4kyN4is9RyQ=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=SXDCZ//NS1KqeCUOebHT8xAuBQbOYn7GKl9UsiXbprHu3Dm95oD0pTEZia/Pz3p6S hC74ClKd5RRo5H+J64wJrZlgJVGwzOCi+VefA+uudww9ikBuKFPJ0HVnle+6ArHIYj yx9V2ou6+cN8mmPeMTg0K//QnqCS4xYa5t3Se/0s= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermes ([89.12.6.138]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MGQnP-1kyImS29D3-00GnLv for ; Mon, 30 Nov 2020 11:56:25 +0100 Received: from ncq by hermes with local (Exim 4.94) (envelope-from ) id 1kjgr1-0002Ho-RV for pgsql-general@lists.postgresql.org; Mon, 30 Nov 2020 11:56:23 +0100 Date: Mon, 30 Nov 2020 11:56:23 +0100 From: Karsten Hilbert To: "pgsql-general@lists.postgresql.org" Subject: Re: Set COLLATE on a session level Message-ID: References: <0DDE56FB-89A8-4621-BF5E-8CE3461F4983@mikatiming.de> <9fd0eef06639e633e258461e5baad9734bcbc1ba.camel@cybertec.at> <20201120144717.GD5091@hermes.hilbert.loc> <17384830-38E8-4F5C-92F9-338A1F1C6333@mikatiming.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17384830-38E8-4F5C-92F9-338A1F1C6333@mikatiming.de> 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:VYVSuCo5SONCJqi1mr6Bswf5oubwhWuXpcE3XWiGr64Exp2mhjc wWVt4MJo+/WLuVQFJcse87TLHyiRyBBWiYCqP05JIBooeyt9YotfFPD+Juc0FJXQSfI7LPW r5LUYRHDmCq3USHVsNRNPH2LzcvuJJSnKrV89Zu4y1hykOoHkDRxC8Hk9agNLFSm88j3n22 3M8qncNnhs5qeNsaOkyVg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:oX5/rdrnZgg=:evyClwss+qVwHnrWTNRB+g TEJltRyItIoy71hQb047uQysF/Bq11jDiOyebpPbzFtEP8PI2nwSCw0TdymlXpOF/gz3JJv/q refD4A16ll8U4BR+TnS/uneTysogD7vRSWPokLT5lQnck4RnYNDhcLXO5Bt3TPmG0FHZmL28X Bdwxa0Yu9PMmjzne5R874tsr8fsk6rXU6OOrOWfs2gWcWwvLw70FLW83llN0V0VSA1fb6fyEW AVgQqLp2ErW0dkesWPGmBsiQpZ0lUxK9M2ukR9j5c5nPk4eZQuWDKJF8oXYJP89d3XQ/VEd7z H9fNp/YgeHZCjiOzv2QxC7PpTa9ofS3bMZKgCF1du44JBxm2vOwYzXz6iCG98YR0Gcd7RECv7 Cvu8gbhwgXWGewv3c4tIgFyowIeHctRD+57wOwJUPp8/E0mLxbV8l25JIWUK0QCi803Jo+PRU zbvUJ/JzM57YUaI+qt0Grw/3auslqUiqJv5rWDPxAfKar8upB44YmOnrACk7xi9n0A+G9HHlp jSBwx50bl+OhhwIVSahwqui4ZCKbUY0pgU55DCcTJkQOxgci5+dvmZvx0APYeI0dBh/bPUMg6 JIgtf7/A0jaejmz9kC33C8EHLZ2LeYrfRMgNmHEyFJus6YgGihSeD0OTmihYsJXXIfsPsOMqj KabvsA5MkXiXsKUlj/tnFNmQeSeIgFEZ02+Fdn+PBdoqXvsPb/cxCq2cF295pWEtSSX9hcb0i 1NsgnWoCR/o9wXPO6Qq9exTCoORJsi57XgfVnxAWsYExok5uvbF4cG+amLoesUfG2qZJ/Mj0M +1U6p7ipoZEM3RIYujJ8kZcLEaka/Oohai4L1zBxSbKDrMHYbB0Sl1NivEDLObNiMhVYzQAkf a5Hi0EtHnH1x3I1ApldA== Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Am Mon, Nov 30, 2020 at 10:11:38AM +0000 schrieb Dirk Mika: > > Or views in schemas per locale. Selecting the search path > > per locale pulls in the right view. > > And one view per locale would mean that I would have to > create a whole schema including all views for each locale I > want to support. I would have to roll out a new version of > the data model, just for an additional locale. Or a "smart" view. Set a session variable before running the query and have the (one) view return the locale'd data based on the session variable ... set session "mika.current_locale" =3D 'locale@2_use'; and use select current_setting('mika.current_locale') as needed inside the view definition > This all seems unnecessarily complicated to me. No one said it is going to be particularly convenient... You asked for possible, I guess. :-) Best, Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B