pg_temp implicit search path: functions vs. tables

Поиск
Список
Период
Сортировка
От Josh Kupershmidt
Тема pg_temp implicit search path: functions vs. tables
Дата
Msg-id AANLkTimU831+prvm=qw+AJ3aPdVp7LwDgTcAz4mDyVcm@mail.gmail.com
обсуждение исходный текст
Ответы Re: pg_temp implicit search path: functions vs. tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi all,

I notice slightly different handling of the implicit search_path for
temporary tables and temporary functions. Consider:

(with a default search path):

# SHOW search_path;
  search_path
----------------
 "$user",public
(1 row)


BEGIN;
  CREATE TABLE pg_temp.bar();

  CREATE FUNCTION pg_temp.foofunc() RETURNS int AS $$
      SELECT 1;
  $$ LANGUAGE SQL;

  SELECT * FROM bar;
  SELECT * FROM foofunc();

COMMIT;

The select from temporary table bar above succeeds, but I get:
ERROR:  function foofunc() does not exist

if I don't schema-qualify the function as pg_temp.foofunc(). So,
pg_temp is being implicitly included in the default search path when
looking for tables, but not for functions. Is there a reason for this
difference?

Josh

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

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Updates, deletes and inserts are very slow. What can I do make them bearable?
Следующее
От: Tim Uckun
Дата:
Сообщение: Re: Updates, deletes and inserts are very slow. What can I do make them bearable?