Re: Changes in functions bittoint4 and bitfromint4 - Function bit does not work

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kenji Sugita <sugita(at)srapc1327(dot)sra(dot)co(dot)jp>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Changes in functions bittoint4 and bitfromint4 - Function bit does not work
Date: 2002-12-26 16:52:30
Message-ID: 1583.1040921550@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Kenji Sugita <sugita(at)srapc1327(dot)sra(dot)co(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Lamar Owen 2002-12-26 16:57:38 Re: [BUGS] pgdb.py is still wrong [not just] in Postgres 7.3.1 rpm
Previous Message pgsql-bugs 2002-12-26 15:17:19 Bug #858: bitfromint4 not present in 7.3.1