Re: Providing an alternative result when there is no result

From: David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com>
To: Joshua Berry <yoberi(at)gmail(dot)com>
Cc: Postgresql General Mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Providing an alternative result when there is no result
Date: 2009-05-18 19:38:11
Message-ID: e7f9235d0905181238l631f3793o8f69df5075f790dc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, May 18, 2009 at 3:13 PM, Joshua Berry <yoberi(at)gmail(dot)com> wrote:
> Any hints/tips? Is our original solution okay, or is there something we can
> do to improve things?

It seems as if you don't really care about the results of the query-
just whether or not it returns any rows. In that case, why not
something like:

select (case when exists (select * from foo where...) then true else
false end) as result;
--
- David T. Wilson
david(dot)t(dot)wilson(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2009-05-18 20:04:34 Re: "PostgreSQL in the cloud" now up on media.postgresql.org
Previous Message Martijn van Oosterhout 2009-05-18 19:36:56 Re: Providing an alternative result when there is no result