Re: How to force Postgres to calculate MAX(boolean)

Поиск
Список
Период
Сортировка
От Ropel
Тема Re: How to force Postgres to calculate MAX(boolean)
Дата
Msg-id 42CD4CD7.60009@ropel.it
обсуждение исходный текст
Ответ на How to force Postgres to calculate MAX(boolean)  ("Andrus" <noeetasoftspam@online.ee>)
Список pgsql-general
Andrus wrote:

>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.
>
>
Use bool_or(boolean)  instead.
Bye




В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: cache lookup failed for relation 438095645
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Implement updated column in all tables