Re: Query and the number of row result

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Query and the number of row result
Date: 2009-08-31 17:00:27
Message-ID: m38wgz7wb8.fsf@passepartout.tim-landscheidt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

bilal ghayyad <bilmar_gh(at)yahoo(dot)com> wrote:

> I am talking in case I am writing a script for a function,
> and I need to know the number of the returned rows of the
> query, then I will do IF statement based on that number,
> how?
> [...]

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".

Tim

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2009-08-31 17:17:23 Re: Problem starting pgsql server on Mac OS X. Pg_hba.conf reading permission.
Previous Message bilal ghayyad 2009-08-31 16:51:06 Re: Query and the number of row result