Re: Query and the number of row result

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: Query and the number of row result
Дата
Msg-id 4A9D1848.9090102@iol.ie
обсуждение исходный текст
Ответ на Re: Query and the number of row result  (Tim Landscheidt <tim@tim-landscheidt.de>)
Список pgsql-general
On 31/08/2009 18:00, Tim Landscheidt wrote:

> Presuming that you are talking about a function written in
> PL/pgSQL, you will have to count them yourself or issue a
> second query "SELECT COUNT(*) FROM [...]". For the special
> case that you want to find out whether no row at all was
> found, you can look at "IF (NOT) FOUND".

In pl/pgsql you can also issue a GET DIAGNOSTICS command which gets the
row count:

http://www.postgresql.org/docs/8.4/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS

...although it is still has to be done as a second query, as in your
suggestions above.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

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

Предыдущее
От: Josef Wolf
Дата:
Сообщение: Re: pg_ctl with unix domain socket?
Следующее
От: Alexandr Varlamov
Дата:
Сообщение: Keys and indexes