Re: Using a boolean column with IF / THEN

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using a boolean column with IF / THEN
Date: 2020-12-05 20:00:49
Message-ID: CAKFQuwaocJF=3vSsvG3cf4WTQq3vFjcjLWiX4s0WQhy1B46P9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Saturday, December 5, 2020, Alexander Farber <alexander(dot)farber(at)gmail(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2020-12-06 05:15:43 Re: Set COLLATE on a session level
Previous Message Alexander Farber 2020-12-05 19:28:14 Using a boolean column with IF / THEN