Re: [BUGS] We are not following the spec for HAVING without GROUP

2005-03-09 Thread Mark Shewmaker
On Wed, 2005-03-09 at 21:21 -0500, Tom Lane wrote: > Comments? Can anyone confirm whether DB2 or other databases allow > ungrouped column references with HAVING? In Sybase: 1> select 2 as id, max(myfield) from mytable where 2=1 2> go id --- -- 2

[BUGS] We are not following the spec for HAVING without GROUP BY

2005-03-09 Thread Tom Lane
I wrote in reference to bug#1528: > What the spec actually says, or at least implies, is that a HAVING > clause is to be evaluated only once per group --- where the "group" > is the whole table if there's no GROUP BY clause. In fact, reading the spec more closely, it is clear that the presence of

Re: [BUGS] BUG #1528: Rows returned that should be excluded by WHERE clause

2005-03-09 Thread Tom Lane
I wrote: > I think the problem can be expressed as > regression=# select 2 as id, max(b) from t2 having 2 = 1; > id | max > +- > 2 | > (1 row) > the issue is clearly that the known-false HAVING clause is pushed down > inside the aggregation, as though it were WHERE. The existing

Re: [BUGS] [pgsql-bugs] Daily digest v1.1387 (8 messages)

2005-03-09 Thread Josh Berkus
Tom, > the issue is clearly that the known-false HAVING clause is pushed down > inside the aggregation, as though it were WHERE. ÂThe existing code > pushes down HAVING to WHERE if the clause contains no aggregates, but > evidently this is too simplistic. ÂWhat are the correct conditions for > pus

Re: [BUGS] Fault when return strings over 256 characters in PLpgSQL

2005-03-09 Thread Neil Conway
[EMAIL PROTECTED] wrote: I have a PLpgSQL function that returns a string (varchar): if this string is over 256 characters long then the last three characters are corrupted: replaced by the string ' (.' I'm skeptical: there is nothing special about 256 characters as far as the varchar implementa

[BUGS] Fault when return strings over 256 characters in PLpgSQL function

2005-03-09 Thread cathy . hemsley
I have a PLpgSQL function that returns a string (varchar):  if this string is over 256 characters long then the last three characters are corrupted:  replaced by the string ' (.' This is my test function:- -- Function: testconverttousername(varchar, varchar) DROP FUNCTION testconverttousername()