Re: drop table if exists

Поиск
Список
Период
Сортировка
От Philip Hallstrom
Тема Re: drop table if exists
Дата
Msg-id 20010703153823.P89242-100000@oddjob.adhesivemedia.com
обсуждение исходный текст
Ответ на drop table if exists  ("Jason Watkins" <jason_watkins@pobox.com>)
Список pgsql-sql
Just drop the table using "DROP TABLE mytable;" and ignore the error...
I'm sure there are fancy ways of doing it by accessing system tables, but
the above works for me.

On Tue, 3 Jul 2001, Jason Watkins wrote:

> How can I duplicate the behavior of:
>
> DROP TABLE IF EXISTS mytable;
>
> CREATE TABLE mytable (
> blah,
> blah
> );
>
> INSERT INTO mytable
> (blah)
> VALUES
> (blah);
>
> in other words, so that I have a single sql file that restores the database
> to a known state.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>



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

Предыдущее
От: Alex Pilosov
Дата:
Сообщение: Re: count(*)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: simple function crashes my postmaster