Search Postgresql Archives

Re: Cast INTEGER to BIT confusion

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

 



On Tuesday, August 15, 2023, Erik Wienhold <ewie@xxxxxxxxx> wrote:
> On 15/08/2023 10:49 CEST [Quipsy] Markus Karg <karg@xxxxxxxxx> wrote:
>
> Hello PostgreSQL Community,
>
> I like to store just a single bit but that can be either 1 or 0, so I tried

You could create a custom domain if you're only interested in values 0 and 1
and don't use bit string functions.  The search path must be changed so that
domain bit overrides pg_catalog.bit:

The table using the system bit type already exists and thus the oid for the data type of the stored catalog column is that of the system bit type.  Creating a user bit domaim is going to have absolutely zero impact on this situation.
 
If you really want to make this work and are willing to risk and deal with side-effects of manual catalog updates you could maybe make the existing cast implicit.

David J.


[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 Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux