Determining if table exists before dropping

Поиск
Список
Период
Сортировка
От Dwayne Miller
Тема Determining if table exists before dropping
Дата
Msg-id 3E6CB696.2090606@espgroup.net
обсуждение исходный текст
Список pgsql-general
Is there any way of wrapping a DROP TABLE statement within a test in a
psql script?  I've constructed a script that should DROP a table if it
exists before trying to CREATE the table.  I'm passing this script in as
a command from a C program using PQsendQuery().  And the first DROP
statement results in an error being returned when the TABLE does not
exist.  The rest of the statements are ignored.  psql processes the
script to completion even though an error is generated.  I would like
the script to return an error if some other error was encountered.

Perhaps there is a way to treat this error as a warning?

Tks,
Dwayne


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [NOVICE] General Performance questions
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: [NOVICE] General Performance questions