How to force Postgres to calculate MAX(boolean)

From: "Andrus" <noeetasoftspam(at)online(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: How to force Postgres to calculate MAX(boolean)
Date: 2005-07-07 13:26:35
Message-ID: dajail$4qn$2@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Douglas McNaught 2005-07-07 13:31:04 Re: postmaster link to postgres executable
Previous Message Andrus 2005-07-07 13:25:31 Implement updated column in all tables