Re: How do write schema independent install files for functions.

From: Philip Couling <phil(at)pedal(dot)me(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How do write schema independent install files for functions.
Date: 2012-07-16 19:49:57
Message-ID: 50047065.2030905@pedal.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 16/07/2012 20:44, Tom Lane wrote:
> Philip Couling <phil(at)pedal(dot)me(dot)uk> writes:
>> I have a number of functions which I wish to wrap up in a SQL script
>> (well technically DDL script). The functions reference one another and
>> for safety it is necessary for them to ether set the search_path or
>> directly reference the schema for one another.
>
>> I was wondering if there is good / recommended way to write the install
>> script to easily install to an arbitrary schema.
>
> CREATE FUNCTION's "SET search_path FROM CURRENT" option might help you.
>
> regards, tom lane
>

Thanks tom. That was exactly what I was looking for and what I'd missed
in the manual.

For the sake of future readers "FROM CURRENT" is documented here:
http://www.postgresql.org/docs/current/static/sql-createfunction.html

Regards

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brar Piening 2012-07-16 20:29:54 Re: Create stored procedure from C#.net
Previous Message Bartosz Dmytrak 2012-07-16 19:45:30 Re: How do write schema independent install files for functions.