a row disapearing - Mailing list pgsql-general

From Rafal Pietrak
Subject a row disapearing
Date
Msg-id 1148752916.14902.22.camel@model.home.waw.pl
Whole thread Raw
In response to Re: error in SELECT  ("P.M" <pmdanger@yahoo.com>)
Responses Re: a row disapearing
List pgsql-general
Hi All,

This is ambarasing, but I've just noticed the following (which looks
inconsistant to inexperienced eye). Having a table:

    test=> CREATE TABLE xxx (id int, info text);

With some rows in it, I try:

    test=> SELECT count(1) from xxx where id=1;
     count
    -------
         0
    (1 row)

This is correct (meaning, I expected that). But when I try to fetch the
actual selector used in the query as well, I get no rows instead.

    test=> SELECT count(1),id from xxx where id=1 group by id;
     count | id
    -------+----
    (0 rows)

Is this a feature, or a bug? And in fact, is there a construct to get
both the count() and its selectors *in*case*, when the count is ZERO?

All the above in postgres 8.1.

Thenx.

--
-R

pgsql-general by date:

Previous
From: "Dawid Kuroczko"
Date:
Subject: Re: Making query without trigger
Next
From: Bruce Momjian
Date:
Subject: Re: a row disapearing