Re: Using a boolean column with IF / THEN

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Using a boolean column with IF / THEN
Дата
Msg-id CAKFQuwaocJF=3vSsvG3cf4WTQq3vFjcjLWiX4s0WQhy1B46P9A@mail.gmail.com
обсуждение исходный текст
Ответ на Using a boolean column with IF / THEN  (Alexander Farber <alexander.farber@gmail.com>)
Ответы Re: Using a boolean column with IF / THEN
Список pgsql-general

On Saturday, December 5, 2020, Alexander Farber <alexander.farber@gmail.com> wrote:
Good evening,

hopefully my question is not too stupid, but -

in a 13.1 database I have a words_users table with a boolean column:

        -- the user is not allowed to chat or change the motto
        muted         boolean NOT NULL DEFAULT false,

Currently I check the value as follows, but I wonder if this is the best way with PL/pgSQL -


Maybe not “simpler” but for all those checks you could write a single query that pulls out all the data at once into a record variable and test against the columns pf that instead of executing multiple queries.

David J.

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

Предыдущее
От: Alexander Farber
Дата:
Сообщение: Using a boolean column with IF / THEN
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: Set COLLATE on a session level