Re: Changes in functions bittoint4 and bitfromint4 - Function bit does not work - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Changes in functions bittoint4 and bitfromint4 - Function bit does not work
Date
Msg-id 1583.1040921550@sss.pgh.pa.us
Whole thread Raw
In response to Changes in functions bittoint4 and bitfromint4 - Function bit does not work  (Kenji Sugita <sugita@srapc1327.sra.co.jp>)
List pgsql-bugs
Kenji Sugita <sugita@srapc1327.sra.co.jp> writes:
> Functions bittoint4 and bitfromint4 are renamed to int4 and bit respectively.
> Int4 works well, but bit conflicts with type bit.

Spell it with quotes, or use cast syntax.

regression=# select "bit"(44);
               bit
----------------------------------
 00000000000000000000000000101100
(1 row)

regression=# select 44::bit(32);
               bit
----------------------------------
 00000000000000000000000000101100
(1 row)

This is not different from the situation with casts to numeric,
timestamp, interval, char, etc: if you want to use the function syntax
then you need quotes.

> [proposes]
>     =# select bitx(7);

We aren't going to use a name that doesn't follow the standard
convention for conversion functions.  As I recall, these two functions
already caused some trouble because they weren't named per convention
before 7.3 --- that caused Peter to miss them when looking for entries
to make in pg_cast.

            regards, tom lane

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #858: bitfromint4 not present in 7.3.1
Next
From: Lamar Owen
Date:
Subject: Re: pgdb.py is still wrong [not just] in Postgres 7.3.1 rpm