Search Postgresql Archives

IF EXISTS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux