Create or Update Function

From: Steve Erickson <serickson(at)digitiliti(dot)com>
To: <pgadmin-support(at)postgresql(dot)org>
Subject: Create or Update Function
Date: 2012-07-09 20:28:36
Message-ID: 004a01cd5e11$6ae770e0$40b652a0$@digitiliti.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

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?

Thanks,

Steve Erickson

Senior Developer

266 East 7th Street, Floor 4

Saint Paul, MN 55101

651.925.3237 office

612.242.1343 cell

NOTICE: This email, including any attachments, is covered by the Electronic
Communications Privacy Act, is confidential and may be legally privileged.
If you are not the intended recipient, you are hereby notified that any
retention, dissemination, distribution or copying of this communication is
strictly prohibited. If you have received this communication in error,
please immediately notify our office by return email or at our telephone
number (651) 925-3200. Then delete and destroy all copies of this email and
any attachments.

Thank you.

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Craig Ringer 2012-07-10 01:12:14 Re: Create or Update Function
Previous Message Martin French 2012-07-09 09:31:51 Re: pgAgent reports failure upon success