|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hello,
I am trying to convert bits to text. query - select 127::bit(6) returns: 111111 I tried select 127::bit(6)::text but that returns - ERROR: cannot cast type bit to text This I want to convert to string/text so that I can display this. Thanks in advance -Hrishi |
|
#2
|
||||
|
||||
|
Use some extra (): SELECT (127::bit(6))::text;
The result of 127::bit(6) will be cast to text. Edit: Looks like version 8.2 and 8.3 behave differently. 8.2 gives an error while 8.3 works fine. ![]()
__________________
PostgreSQL-manual Last edited by pgFrank : April 18th, 2008 at 10:24 AM. |
|
#3
|
|||
|
|||
|
Thanks a lot for this.
I am currently using 8.2 but I can consider moving to 8.3. Thanks again -Hrishi |
![]() |
| Viewing: Dev Shed Forums > Databases > PostgreSQL Help > Bit to text |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|