Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zhf8l-0001Ol-HS for pgsql-admin@arkaria.postgresql.org; Thu, 01 Oct 2015 14:47:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zhf8k-0003XW-Qv for pgsql-admin@arkaria.postgresql.org; Thu, 01 Oct 2015 14:47:22 +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_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zhf8k-0003XP-D0 for pgsql-admin@postgresql.org; Thu, 01 Oct 2015 14:47:22 +0000 Received: from diminuendo-3.evaristesys.com ([208.52.173.21]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Zhf8g-0004hW-Bw for pgsql-admin@postgresql.org; Thu, 01 Oct 2015 14:47:21 +0000 Received: from [63.135.160.86] (helo=presto-1-2.evaristesys.com) by diminuendo-3.evaristesys.com with esmtp (Exim 4.72) (envelope-from ) id 1Zhf8d-0002K6-19 for pgsql-admin@postgresql.org; Thu, 01 Oct 2015 10:47:15 -0400 Received: from [172.30.106.254] by presto-1-2.evaristesys.com with esmtp (Exim 4.80) (envelope-from ) id 1Zhf8c-0002si-VW for pgsql-admin@postgresql.org; Thu, 01 Oct 2015 10:47:14 -0400 Subject: Re: "Dynamic routing" to different databases To: pgsql-admin@postgresql.org References: <560BFE58.9030201@evaristesys.com> <560C6F2D.1090107@evaristesys.com> From: Alex Balashov Message-ID: <560D4772.4020002@evaristesys.com> Date: Thu, 1 Oct 2015 10:47:14 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On 10/01/2015 09:44 AM, Igor Neyman wrote: > Why should it " take a lot of code modification"? > Modifying "search_path" is not enough? You're right, it's not that big of a deal. I had been under the impression that SET search_path TO schema; is a psql-level construct, not something that can be embedded in live queries. So, I was expecting to have to rewrite thousands of lines of stored procedures to take a schema parameter and construct dynamic query strings with dynamic table names and so on. Assuming one can simply do: SET search_path TO ; SELECT query_business_as_usual(); I'm in a pretty good place! -- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/ -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin