Re: Create or Update Function

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Steve Erickson <serickson(at)digitiliti(dot)com>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Create or Update Function
Date: 2012-07-10 01:12:14
Message-ID: 4FFB816E.5000507@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On 07/10/2012 04:28 AM, Steve Erickson wrote:
>
> I've got a script to update the schema on a number of servers. These
> servers are at various versions of the schema, so I used the following
> syntax for each function, not knowing if it needed to be created or
> merely updated:
>
> CREATE OR REPLACE FUNCTION foo() ...
>
> But I get the error, "function foo() does not exist" if it indeed does
> not exist. Shouldn't the "create or replace" just create it in this
> instance? Why the error?
>

I think you need to show us the full conversation with the server. I
suspect the CREATE OR REPLACE is failing because of bad function syntax
or similar, so a following invocation of the function is causing your
function foo() does not exist error.

--
Craig Ringer

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2012-07-10 12:19:54 Re: pgAgent reports failure upon success
Previous Message Steve Erickson 2012-07-09 20:28:36 Create or Update Function