IF EXISTS

Поиск
Список
Период
Сортировка
От stevethames
Тема IF EXISTS
Дата
Msg-id 6416894.post@talk.nabble.com
обсуждение исходный текст
Ответы Re: IF EXISTS  (Jeff Davis <pgsql@j-davis.com>)
Список 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 по дате отправления:

Предыдущее
От: Jonathan Vanasco
Дата:
Сообщение: Table Inheritance / VARCHAR search question
Следующее
От: "Johan"
Дата:
Сообщение: column names in select don't exists in insert to