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

2012-07-16 Thread Philip Couling
On 16/07/2012 20:44, Tom Lane wrote: > Philip Couling 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 refere

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

2012-07-16 Thread Bartosz Dmytrak
2012/7/16 Philip Couling > > Is there any more flexible way to do this? > > Hi, in my opinion you should use fully qualified names instead of set search_path Your script should look like this: CREATE OR REPLACE FUNCTION my_schema.foo() RETURNS INTEGER AS $BODY$ BEGIN RETURN 42; END; $

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

2012-07-16 Thread Tom Lane
Philip Couling 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 wo