Re: [HACKERS] confused about bit strings

2003-10-08 Thread Peter Eisentraut
Neil Conway writes: > nconway=# select 1::bit; > bit > - > 0 > (1 row) Oops. I've always thought that casting between int and bit should be disallowed, but apparently it keeps sneaking back in. > nconway=# select X'4'::bit varying; > varbit > > 0100 > (1 row) > -- why is that 4

[HACKERS] confused about bit strings

2003-10-08 Thread Neil Conway
Is the following behavior intentional? If so, what's the reasoning behind it? nconway=# select 1::bit; bit - 0 (1 row) nconway=# select '1'::bit; bit - 1 (1 row) nconway=# select X'1'::bit; bit - 0 (1 row) nconway=# select 1::bit varying; ERROR: cannot cast type integer to bi