Re: Search path & functions in temporary schemas

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jose luis pillado <josel(dot)pillado(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Search path & functions in temporary schemas
Date: 2018-12-11 16:27:29
Message-ID: 19174.1544545649@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

jose luis pillado <josel(dot)pillado(at)gmail(dot)com> writes:
> This solution worked with a real schema, but it did not with a temporary
> one. ...
> Is there any way to make this work?

The temp schema is intentionally excluded from the search path for
functions and operators, because otherwise it's just too easy to
trojan-horse things. If you really want to create and call a
temp function, you have to schema-qualify its name when you call it.

To make that a bit less messy, you can use "pg_temp" as an alias
for your session's temp schema, rather than having to find out which
numbered temp schema you're really using.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Lissner 2018-12-11 22:21:55 Re: Errors with schema migration and logical replication — expected?
Previous Message ramsiddu007 2018-12-11 16:17:30 Re: Newly Created Source DB Table Not Reflecting into Destination Foreign Tables