IF EXISTS - Mailing list pgsql-general

From stevethames
Subject IF EXISTS
Date
Msg-id 6416894.post@talk.nabble.com
Whole thread Raw
Responses Re: IF EXISTS  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-general
I have a script that sets up my databases which I run whenever I change any
of the functions.  It has a number of things it does that are unnecessary
and cause errors.  I create some types, sequences, etc.  The error messages
are irritating.  I'd like to do something like this:

IF NOT EXISTS (SELECT relname FROM pg_class WHERE relname='seqid')
  CREATE SEQUENCE SeqID;

This works in other SQL languages like SQLServer and MySQL.  Is there
anything like this in PostgreSQL?

--
View this message in context: http://www.nabble.com/IF-EXISTS-tf2308139.html#a6416894
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Jonathan Vanasco
Date:
Subject: Table Inheritance / VARCHAR search question
Next
From: "Johan"
Date:
Subject: column names in select don't exists in insert to