Re: [HACKERS] Creating temp tables inside read only transactions

From: Florian Pflug <fgp(at)phlo(dot)org>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: "'Christopher Browne'" <cbbrowne(at)gmail(dot)com>, "'Darren Duncan'" <darren(at)darrenduncan(dot)net>, "'Michael Nolan'" <htfoot(at)gmail(dot)com>, "'Robert Haas'" <robertmhaas(at)gmail(dot)com>, "'Jeff Davis'" <pgsql(at)j-davis(dot)com>, "'Guillaume Lelarge'" <guillaume(at)lelarge(dot)info>, "'mike beeper'" <mbeeper(at)hotmail(dot)com>, <pgsql-general(at)postgresql(dot)org>, "'PostgreSQL Hackers'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Creating temp tables inside read only transactions
Date: 2011-07-12 07:05:48
Message-ID: D243D48B-B564-4C2D-9485-CD1756BE8D9E@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Jul11, 2011, at 21:49 , David Johnston wrote:
> Right now I can emulate a hierarchical schema structure via a naming scheme
> - for example "schemabase_sub1_sub2_etc". I am simply looking for a formal
> way to do the above AND also tell the system that I want all schemas under
> "schemabase" to be in the search path. Heck, I guess just allowing for
> simply pattern matching in "search_path" would be useful in this case
> regardless of the presence of an actual schema hierarchy. Using "LIKE"
> syntax say: "SET search_path TO schemabase_sub1_%" or something similar.

create function set_searchpath_expand(v_pattern text) returns void as $$
declare
v_searchpath text;
begin
select string_agg(quote_ident(nspname), ',') into v_searchpath
from pg_catalog.pg_namespace where nspname like v_pattern;
execute 'set search_path = ' || v_searchpath;
end
$$ language plpgsql;

best regards,
Florian Pflug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chetan Suttraway 2011-07-12 08:18:28 Re: Concurrent read from a partition table.
Previous Message David Johnston 2011-07-12 03:01:28 Re: Unexpected results with joins on dates

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2011-07-12 07:05:53 Re: WIP: Fast GiST index build
Previous Message Shigeru Hanada 2011-07-12 05:31:45 Re: per-column generic option