Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8BB0D63307F for ; Tue, 8 Jun 2010 11:50:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 86353-01 for ; Tue, 8 Jun 2010 14:50:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id E715E632C5F for ; Tue, 8 Jun 2010 11:50:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o58Eoge5004765; Tue, 8 Jun 2010 10:50:42 -0400 (EDT) To: Ben Morrow cc: pgsql-sql@postgresql.org Subject: Re: Casts in foreign schemas In-reply-to: <20100608143327.GA67823@osiris.mauzo.dyndns.org> References: <20100608143327.GA67823@osiris.mauzo.dyndns.org> Comments: In-reply-to Ben Morrow message dated "Tue, 08 Jun 2010 15:33:27 +0100" Date: Tue, 08 Jun 2010 10:50:42 -0400 Message-ID: <4764.1276008642@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/31 X-Sequence-Number: 34222 Ben Morrow writes: > My understanding of things was that PL/pgSQL functions were compiled at > CREATE FUNCTION time, using the SEARCH_PATH currently in effect. Is that > wrong? Yes. They're compiled at first use within a given session. If you want to lock down the search path used by a function, it's possible to do that in recent PG versions, by annotating the function definition with a "SET search_path = whatever" clause. regards, tom lane