Skip site navigation (1) Skip section navigation (2)

Bug #503: case and LIMIT not working together

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #503: case and LIMIT not working together
Date: 2001-10-30 19:00:15
Message-ID: 200110301900.f9UJ0FT09155@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Carl Anderson (candrsn(at)mindspring(dot)com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
case and LIMIT not working together

Long Description
PostreSQL 7/1/3 i686-pc-linux-gnu compiled by GCC 3.0

when I count ( case ... ) LIMIT

The count is from the entire table not from the LIMIT

in the below example the count is returned with the
same value in all three statements

Sample Code
select count( case when b='T' then 1 else null) from test limit 50;

select count( case when b='T' then 1 else null) from test;

select count(*) from test where b = 'T';

No file was uploaded with this report


Responses

pgsql-bugs by date

Next:From: pgsql-bugsDate: 2001-10-30 19:53:21
Subject: Bug #504: multiple cursors cause transaction problems
Previous:From: Bruno Wolff IIIDate: 2001-10-30 15:49:45
Subject: Re: Porting issue with openssl and no /dev/random

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group