2012/7/16 Philip Couling <p...@pedal.me.uk>

>
> 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;
$BODY$
  LANGUAGE plpgsql IMMUTABLE
  COST 100;

CREATE OR REPLACE FUNCTION another_schema.bar()
  RETURNS INTEGER AS
$BODY$
BEGIN
        RETURN my_schema.foo();
END;
$BODY$
  LANGUAGE plpgsql IMMUTABLE
  COST 100;

then script is readable and uses full qualified names.
http://www.postgresql.org/docs/9.1/static/ddl-schemas.html#sql-createschema.html

Regards,
Bartek

Reply via email to