Skip site navigation (1) Skip section navigation (2)

Re: Creating Functions in Separate Schema

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Mark Dexter <MDEXTER(at)dexterchaney(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Creating Functions in Separate Schema
Date: 2004-08-27 09:08:10
Message-ID: 1093597690.1286.252.camel@braydb (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Thu, 2004-08-26 at 22:42, Mark Dexter wrote:
> Our application currently runs in Microsoft SQL Server and we are
> porting it over to Postgres.  When we write enbedded SQL queries for
> SQL Server, we need to reference user-defined functions with the
> prefix "dbo." (e.g., "dbo.Function_Name()").  In experimenting with
> Postgres, it appears that we can create a schema called "dbo" and then
> reference functions with the same syntax (e.g.,
> "dbo.Function_Name()").  
> We're trying to understand whether there will be any disadvantages to
> doing this.  Are there any possible issues or problems with this
> approach?  Any help will be greatly appreciated.  Thanks.  

It should work fine.

If you set the search_path to include dbo, the "dbo." prefix would
become optional.
        CREATE SCHEMA dbo;
        CREATE FUNCTION dbo.function() ...
        SELECT dbo.function() ...
        SET SEARCH_PATH TO  '...,dbo,public';
        SELECT function() ...

Oliver Elphick

In response to

pgsql-general by date

Next:From: Bruno BaguetteDate: 2004-08-27 10:58:50
Subject: Primary key inheritance problem
Previous:From: David Suela FernándezDate: 2004-08-27 08:37:05
Subject: Re: copy a database

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group