Re: checking for existence of a table in plpgsql.

Поиск
Список
Период
Сортировка
От Bo Lorentsen
Тема Re: checking for existence of a table in plpgsql.
Дата
Msg-id 1016093199.669.20.camel@netgroup
обсуждение исходный текст
Ответ на checking for existence of a table in plpgsql.  (Bhuvan A <bhuvansql@yahoo.com>)
Список pgsql-sql
On Thu, 2002-03-14 at 06:40, Bhuvan A wrote:
> how can one know that a particular table exists or not in plpgsql?
How about :

SELECT INTO cnt count( * ) FROM pg_class WHERE relname='mytable';
IF FOUND THEN ...
END IF;

or 

IF cnt > 0 THEN ...
END IF;

This plpgsql snip, will find the number of classes that have the
"mytable" name.

Would this do the trick ? 

/BL



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

Предыдущее
От: Bo Lorentsen
Дата:
Сообщение: Re: Large data sets and FOR LOOP's
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Large data sets and FOR LOOP's