Re: Inserting Data

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Inserting Data
Дата
Msg-id 20060824060840.GA91205@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Inserting Data  (Bob Pawley <rjpawley@shaw.ca>)
Список pgsql-general
On Wed, Aug 23, 2006 at 05:34:27PM -0700, Bob Pawley wrote:
> Could you explain why Postgresql simply doesn't accept the simple 'where'
> statement that was in my earlier e-mail.

Because INSERT doesn't take a WHERE clause.  If you want to do the
insert conditionally then use an IF statement as Tom suggested or
use INSERT ... SELECT with a WHERE clause that would restrict the
SELECT result to an empty set if the insert shouldn't happen.

--
Michael Fuhr

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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Inserting Data