Some SQL92 functionality is missing from the BIT and VARBIT types.

It should be possible to enter hexadecimal values as:

  B'[<bit>...]'[{<separator>...'[<bit...]'}...]
  X'[<hexdigit>...]'[{<separator>...'[<hexdigit...]'}...]

(Cannan and Otten: SQL - The Standard Handbook, p.38)

but the hexadeximal form is not accepted.

For example:

bray=# \d junk
            Table "junk"
 Attribute |     Type     | Modifier 
-----------+--------------+----------
 id        | character(4) | not null
 flag1     | bit(1)       | 
 flags     | bit(8)       | 
Index: junk_pkey

bray=# insert into junk values ('BBBB',B'0',X'FF');
ERROR:  Attribute 'flags' is of type 'bit' but expression is of type 'int4'
        You will need to rewrite or cast the expression

-- 
Oliver Elphick                                [EMAIL PROTECTED]
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "For a child will be born to us, a son will be given to
      us; And the government will rest on His shoulders; And
      His name will be called Wonderful Counsellor, Mighty 
      God, Eternal Father, Prince of Peace." 
                                        Isaiah 9:6 


Reply via email to