Re: DROP TYPE without error?

Поиск
Список
Период
Сортировка
От Mischa
Тема Re: DROP TYPE without error?
Дата
Msg-id 1112817807.4254408fecadc@webmail.telus.net
обсуждение исходный текст
Ответ на DROP TYPE without error?  ("Philippe Lang" <philippe.lang@attiksystem.ch>)
Список pgsql-sql
Quoting Philippe Lang <philippe.lang@attiksystem.ch>:

> Since it is not possible to use CREATE OR REPLACE TYPE, is there a way
> of using DROP TYPE on a non-existing type, without causing the entire
> script to abort? It may sound crazy to ask for this, but it could be
> really useful in my case, where Pl/Pgsql and Pl/Perl code is being
> generated automatically, based on data found in a database.

I've got a similar request for other objects that do/do not exist.
Maybe it's just that I got lazy using MSSQL, but it sure was convenient
to have:
  IF object_id('WorkTable') IS NULL      CREATE TABLE WorkTable(...
etc.

Given that you cannot just execute an anonymous block of PL/PGSQL code,
where you could do the test AND the create ...

-- 
"Dreams come true, not free."



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Dinesh Pandey"
Дата:
Сообщение: FW: createlang 'pltclu' with postgreSQL.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Problems with Set Returning Functions (SRFs)