Advertisement

10.11.2007 at 09:22AM PDT, ID: 22887486
[x]
Attachment Details

PostgreSQL check if object Exists

Asked by FreightTrain in PostgreSQL Database

Tags: check, postgresql, exists

I am creating a SQL Script in PostgreSQL.  I need it to check if a function exists in the database and if so, I need to execute the drop first and then a CREATE...the pseudo code would be something like this:

IF My_Function() EXISTS

THEN DROP My_Function();

CREATE FUNCTION My_Function();Start Free Trial
[+][-]10.11.2007 at 06:01PM PDT, ID: 20062380

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.12.2007 at 04:25AM PDT, ID: 20064374

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PostgreSQL Database
Tags: check, postgresql, exists
Sign Up Now!
Solution Provided By: earthman2
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_1_20070628