Search Postgresql Archives

How to force Postgres to calculate MAX(boolean)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I try to convert code from other database to Postgres.

CREATE TABLE test(test BOOLEAN);
SELECT MAX(test) FROM test;

causes error

ERROR:  function max(boolean) does not exist
HINT:  No function matches the given name and argument types. You may need 
to add explicit type casts.

I tried
SELECT MAX(test:integer)::boolean FROM test;

but this casuses error

ERROR:  cannot cast type boolean to integer

I have lot of MAX() functions applied to boolean expressions.

How to force Postgres to calculate MAX(boolean) ?

MAX(boolean) should return true if its argument evaluates true for at least 
one row. 



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux