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

Поиск
Список
Период
Сортировка
От Florian Pflug
Тема Re: [HACKERS] Creating temp tables inside read only transactions
Дата
Msg-id D243D48B-B564-4C2D-9485-CD1756BE8D9E@phlo.org
обсуждение исходный текст
Ответ на Re: [HACKERS] Creating temp tables inside read only transactions  ("David Johnston" <polobo@yahoo.com>)
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: Unexpected results with joins on dates
Следующее
От: Chetan Suttraway
Дата:
Сообщение: Re: Concurrent read from a partition table.