Re: "Dynamic routing" to different databases

From: Alex Balashov <abalashov(at)evaristesys(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: "Dynamic routing" to different databases
Date: 2015-10-01 14:47:14
Message-ID: 560D4772.4020002@evaristesys.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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 <schema>; 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/

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Nicholson, Brad (Toronto, ON, CA) 2015-10-01 16:48:15 Re: "Dynamic routing" to different databases
Previous Message Igor Neyman 2015-10-01 13:44:44 Re: "Dynamic routing" to different databases