| От | Andreas Schlegel |
|---|---|
| Тема | if exists ... |
| Дата | |
| Msg-id | 3E1ED261.8080103@gmx.de обсуждение исходный текст |
| Ответы |
Re: if exists ...
|
| Список | pgsql-general |
Hi, writing Postgres SQL scripts I have the problem: how do I check if a database object already exists? Having a list of create table, create trigger, create view ... statements I have to decide if the script first drops the existing old object or if it doesn't already exist to create it without dropping. Transact-Sql allows the following construct: if exists (select * from sysobjects where id = object_id(...) = 1) drop trigger tCompUTrig GO I know that postgres has the "table_exists" function. But I don't know the syntax to integrate it in a script with create and drop statements. Any ideas? Greetings, Andreas
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера