Using results from DELETE ... RETURNING

Поиск
Список
Период
Сортировка
От Shak
Тема Using results from DELETE ... RETURNING
Дата
Msg-id h00rnj$25j3$1@news.hub.org
обсуждение исходный текст
Ответы Re: Using results from DELETE ... RETURNING  (Joshua Tolley <eggyknap@gmail.com>)
Список pgsql-general
Hi all,

When RETURNING from a DELETE statement (or similar), how do you access the
results being returned?

Something like:

SELECT COUNT(*) FROM (DELETE FROM a RETURNING *) ;

sounds reasonable but results in a syntax error. I am able to return single
results into a variable or record, but not more than one result.

I could use a SELECT ... FOR UPDATE in the meantime (and then a DELETE), I
just wanted to know what the use of RETURNING * was if you can't do anything
with the results.

Thanks!

Shak


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

Предыдущее
От: "Carlos Oliva"
Дата:
Сообщение: Creating schema, database, or table in different folder.
Следующее
От: "Shak"
Дата:
Сообщение: Using results from RETURNING